algorithmic modeling for Rhino
Is it possible to get the ObjectTable from an unopened Rhino file?
I assume I would set the scriptcontext.doc to a file instead of the ActiveDoc. Not sure how to do this...
Update 1: Using RhinoDoc.ReadFile(filename,FileReadOptions) replaces the currently opened file's RhinoDoc with the one from the referenced file. Interesting, but not useful.
Tags:
You'll need to use Rhino.FileIO.File3dm class to open 3dm files without loading them into Rhino. Functionality is somewhat limited this way, but you can probably harvest all the geometry you need.
Yep! Thanks, this works...
import Rhino.FileIO as io
sc.doc = ghdoc
objs = io.File3dm.Read(filename).Objects
geos = []
for obj in objs:
geo = obj.Geometry
geos.Add(geo)
a = geos
Thanks for the awesome script David.
also added the following line to sort geometry by layer--
geos1 = objs.FindByLayer(Layer1)
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by