Macro syntax to escape options

Hi :saluting_face: I am trying to create a button to switch on/off the 【SnapToLocked】 options.
But it always retain to this steps even I added a 【_Enter】.
How could I escape from that?

-_Options _NoEcho _ModelingAids _OSnaps _SnapToLocked=No

-_Options _NoEcho _ModelingAids _OSnaps _SnapToLocked=No _Enter

// _Enter makes it return to the previous option… I was expecting to escape the whole command.
// And why is it showing the command process even though I’ve written _NoEcho…

try (not tested)
_NoEcho -_Options _ModelingAids _OSnaps _SnapToLocked=Yes _EnterEnd

check the feedback in the commandline.

as soon as your macro works, add _NoEcho at the start: (not tested)
_NoEcho -_Options _ModelingAids _OSnaps _SnapToLocked=Yes _EnterEnd

if _EnterEnd does not do the trick, multiple _Enter _Enter _Enter might do the trick

check
https://wiki.mcneel.com/rhino/basicmacros

https://docs.mcneel.com/rhino/7/help/en-us/index.htm#information/rhinoscripting.htm

1 Like

:dizzy_face: It works! But I used to try EnterEnd and failed…
btw, THANK YOU!

ok - great.
please mark topic as soved / my answer as solution, so others don t need to dig into the topic.

There’s a default toggle button as well…

Clipboard - 2023-04-02 21.06.53

Hi All - SnapToLocked is its own command, with a Toggle option - that should be simpler than digging into -Options.

-Pascal