I’m using AddExplodedInstancePieces to get copies of block geometry to do some stuff with, is there an equivalent to this that doesn’t actually add the geometry to the document, so I don’t have to track down and delete what I don’t need?
# ObjectTable.AddExplodedInstancePieces("name" , "false" , "**true**")
What are you looking for - just the geometry of the objects in the block instance?
Maybe: (a bit cleaner)
import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino
obj_id=rs.GetObject("Select block instance",4096)
if obj_id:
inst_obj=sc.doc.Objects.Find(obj_id)
rhobjs=inst_obj.InstanceDefinition.GetObjects()
orig_objs_geo=[rhobj.Geometry for rhobj in rhobjs]
#orig_objs_geo has the untransformed geometry of the block definition
for obj in orig_objs_geo:
#apply the instance transform to the original geometry
obj.Transform(inst_obj.InstanceXform)
#now choose which objects you want to add here...
sc.doc.Objects.Add(obj)
sc.doc.Views.Redraw()
?
Something like that I think? I need copies of some of the geometry in various instances.