Isolate Toggle Command

I’ve noticed that there are “Isolate” and “UnIsolate” commands added to Rhino 6 and they are very useful.
However, is it possible to add a “Isolate Toggle” command?

In this way, I can set a macro to assign it to certain hotkeys since they are sooooooooo often used in modelling.

OR, is there a way to combine two commands in one macro? I assume this need a state detection to see if it is in “isolation” mode at current state?

1 Like

Hi xliotx - There is not a command built in for this but you can make a macro with a script in it, like this, on a button:

! _-RunPythonScript (
import rhinoscriptsyntax as rs
import scriptcontext as sc

isoToggle = False
if sc.sticky.has_key("ISO_TOGGLE"):
    isoToggle = sc.sticky["ISO_TOGGLE"]

if isoToggle:
    rs.Command ("_Unisolate")
    if rs.LastCommandResult() == 0:
        sc.sticky["ISO_TOGGLE"] = False
    rs.Command ("_Isolate")
    if rs.LastCommandResult() == 0:
        sc.sticky["ISO_TOGGLE"] = True



1 Like

Hi Pascal,

Thank you for the script.
Actually, I can assign the two command to left and right click separately.

The reason I ask this question is I’d like to assign to a shortcut, like
the one in 3D Max.
Any ideas?

Besides, it is not very efficient to run a script like this for a single
There is lagging compared to the Isolate command.

1 Like

I also would try to offer the toggle as the default solution for these things… like hideswap an isolateswap and an isolatelocked swap…

Have you been using the script that @pascal posted?

yep. works fine for every toggle i ever wanted!
was just suggesting to include it in the defaults, because its so frequently used when modelling.