Wish: disable Rhino geometry preview

Sure, but also check out the Lunchbox version I attached above.

I missed that! I’ll check it out. Thx

it doesn’t work properly ,can you check it

I’m not having any issue with it.

Actually here is a even better way so you just control with one bool.


hideshow_one button.gh (7.8 KB)

thanks , i did something like yours and it worked fine

1 Like

This is a ghpython example that hides/shows geometry. Similar to above examples, it’s dependent on referencing geometry into a geo parameter. If no geometry is referenced, it hides/shows all geometry in the Rhino Doc.
GHPY_HideShowObjs
GHPY_HideShowObjs.gh (5.8 KB)
unoptimized code below:

"""Show/Hide Objects.
   Inputs:
       Show: Boolean.  Show/Hide Objects in Rhino Document
       objs: Geo.  Optional.  Referenced Geometry to Show/Hide.  If ommitted, all geo will be shown/hidden."""

__author__ = "chanley"
__version__ = "2019.02.04"

import Rhino

def HideAllVisible():
   settings = Rhino.DocObjects.ObjectEnumeratorSettings()
   settings.VisibleFilter = True
   AllObjs = [obj for obj in Rhino.RhinoDoc.ActiveDoc.Objects.GetObjectList(settings)]
   for obj in AllObjs: 
       Rhino.RhinoDoc.ActiveDoc.Objects.Hide(obj, True)

def ShowAllHidden():
   settings = Rhino.DocObjects.ObjectEnumeratorSettings()
   settings.HiddenObjects = True
   AllObjs = [obj for obj in Rhino.RhinoDoc.ActiveDoc.Objects.GetObjectList(settings)]
   for obj in AllObjs: 
       Rhino.RhinoDoc.ActiveDoc.Objects.Show(obj, True)

def HideRefGeo():
   for id in objs:
       Rhino.RhinoDoc.ActiveDoc.Objects.Hide(id, True)
      
def ShowRefGeo():
   for id in objs:
       Rhino.RhinoDoc.ActiveDoc.Objects.Show(id, True)

if Show == False and len(objs) == 0:
   HideAllVisible()
   ghenv.Component.Message = "Hide All"
elif Show == True and len(objs) == 0:
   ShowAllHidden()
   ghenv.Component.Message = "Show All"
elif Show == False and len(objs) != 0:
   HideRefGeo()
   ghenv.Component.Message = "Hide Ref"
else:
   ShowRefGeo()
   ghenv.Component.Message = "Show Ref"

A nice addition, as mentioned above, would be to ping the ghdoc, get the parameters with referenced geo, then get the GUID of the Rhino Geometry from those parameters.

3 Likes

A nice addition, as mentioned above, would be to ping the ghdoc, get the parameters with referenced geo, then get the GUID of the Rhino Geometry from those parameters.

Which is what Blindfold is doing, I find referenced GUID’s

I still have the question. If you show all, should everything hidden in rhino come back? Or should only what hid when you hid with gh come back? Say you had hidden stuff previously directly in rhino, then you hide all with gh to hide everything else not currently hidden, what should come back with show from gh? Everything? Or only what gh hid?

good point…I think it would probably make sense to store the current visibility state of all the objects before doing anything from GH?

But…maybe it doesn’t make sense to hide anything besides the referenced geo? From a workflow standpoint, maybe it makes more sense to manage “non-GH Referenced geo” directly in the Rhino doc? Not entirely sure…While I find these type of things interesting, I find myself questioning if it’s adding enough value…like I usually do after writing some script and then saying to myself, “this seems like a long walk…”

Also, I totally missed you blindfold plugin! Sorry about that!

1 Like

maybe it doesn’t make sense to hide anything besides the referenced geo

This was my thinking exactly when making Blindfold, mainly I made it cuz the overlay glitch of gh and rhino display drives me insane :smiley:
bf_image_4

maybe group visible geometries and show/hide this group ?

Well I would just keep track of visible Rhino object GUID’s in that case. The question is, is that the correct behavior? Or the most useful behavior?

Tried that for the script I uploaded, but got lost in the Grasshopper SDK. Can you share the Code for this part?