How to get PageViews from Rhino.FileIO.File3dm?

Hi,

I’ve looked through the API, and I can’t seem to find a way to programmatically create a new 3dm file, add objects and layouts to it, and write it to disk without using RhinoDoc, since this would require me to close and open a file for each one that want to export.

Adding objects and layers is fine, but is there a way to add PageViews, or read layout geometry from a template file through the FileIO namespace?

The goal is to have a template Rhino file with some layouts and named objects which I would then load, copy, and populate with geometry, change data, etc. and then write to a folder. Ideally, I would do this through Python or C#, since I’d like to export geometry created in Grasshopper automatically. So far everything works, except the bit with the layouts.

Any tips or feedback would be much appreciated!

Tom

Hi @tom_svilans,

I am not seeing any of creating page view and writing them to 3dm files using File3dm. I’ve created an issue on YouTrack to address this.

https://mcneel.myjetbrains.com/youtrack/issue/RH-51647

When reading a 3dm file, using File3dm, you can detect layout geometry by querying the File3dmObject.Attributes.Space property.

– Dale

Thanks @dale! This would be super helpful; looking forward to it.