Close SelectionFilter using RhinoCommon

Hi,

Is it possible to close dialog boxes for SelectionFilter and OSnap in Rhino 8 using RhinoCommon and C#?

And SelectionFilter/ShowDialog from command line does not work either.

How do I close the Selection filter dialog box?

Regards

Ove

Pasting SelectionFilter H and ShowOSnap H closes the UI elements for me, even if they are undocked. Are you not seeing this behvaiour? It should work if you use RhinoApp.RunScript(...).

Hi @OveJo, below is another way using Python, should be easy to port to C#:

#! python 2
import Rhino
import System

def ToggleSelectionFilterPanel():
    panel_id = System.Guid.Parse("918191ca-1105-43f9-a34a-dda4276883c1")
    visible = Rhino.UI.Panels.IsPanelVisible(panel_id)
    if visible:
        Rhino.UI.Panels.ClosePanel(panel_id)
    else:
        Rhino.UI.Panels.OpenPanel(panel_id)

if __name__=="__main__":
    ToggleSelectionFilterPanel()

Note that this works in Rhino 8 only.
_
c.

Thank you Callum and clement,
You gave me knowledge and inspiration – and I reckon I will manage to solve my problem using a combination of script and C# code!
SelectionFilter H – (with no dash for sub command like in Rhino7) works fine!!
But I wonder why the sub command ShowDialog still is available in Rhino8….

Ove

1 Like