I’m using the below code to select all my meshes to some work down the line inside of grasshopper. I would like to hide what ever objects this script selects. I can’t seem to figure it out.
I tried using RhinoApp.RunScript("-Hide", true);
but I still have to manually select the object.
I feel like I should be using this "ObjectAttributes.AddHideInDetailOverride
" Rhinocommon item, but I’m unsure how.
Once you get the id of the referenced geometry, you could use:
Rhino.RhinoDoc.ActiveDoc.Objects.Hide(id, True)
I’m not great with C#, but maybe this python example helps?
If the geometry is already referenced into a component, (example; a geometry parameter) on the canvas, it might look like this:
refIds = []
def getRefGeoId():
ghdocObjs = ghenv.Component.OnPingDocument()
for obj in ghdocObjs.Objects:
if obj.SubCategory.ToString() == "Geometry":
for pobj in obj.PersistentData:
if pobj.IsReferencedGeometry:
refIds.append(pobj.ReferenceID)
def HideRefGeo():
for id in refIds:
Rhino.RhinoDoc.ActiveDoc.Objects.Hide(id, True)