C# equivalent of Isolate

I thought this would be something really easy to dig up in a Google search but I’m not finding anything.

Basically, I want to iterate through all solid polysurfaces in a model, isolate them one at a time to highlight them to the user, then allow the users to provide input on whether to process this specific solid using the tool.

The only methods I can find to hide/show items are on the ObjectTable class. I cannot find anything in the API docs about selecting or inverting a selection, so this is the only solution I’ve come up with:

  1. Create ObjectTable of found solid closed polysurfaces.
  2. Hide all items in the ObjectTable.
  3. Iterate through object table one at a time, adding an object to its own ObjectTable and calling the Show method (would also like to center the view on the polysurface extents here).
  4. Requesting user input and if requested, process solid.
  5. Hide the item again using the single-item object table.
  6. Repeat.

There’s got to be a better way to handle this, right? I’m trying to find a way that doesn’t involve adding a single object to an object table simply to show then hide it again.

I see the Visible, IsHidden, etc. properties but they’re all read only. The documention for IsHidden mentions the object state of Normal, Locked, or Hidden but I don’t see any way to change it.

You can also get and set object attribute mode.
https://developer.rhino3d.com/api/rhinocommon/rhino.docobjects.objectattributes/mode

Thank you! That’s what I was looking for.

Hi @Chris62,

To hide objects like the Isolate and Hide commands, use ObjectTable.Hide.

– Dale