Assign F3 to toggle OSnap on/off?

I try to make commands in my software as consistent across UIs as I can. In AC F3 toggles the snaps off/on. (Enable/disable) I assigned Osnaps to F3 in Rhino using “!_Osnaps”. But this doesn’t toggle on/off. It gives the Osnap options. Is there a command to do what i want for Osnaps?

1 Like

I think you can do
!_Osnap _o _enter
to run the command.

So it gives the option of osnap then select none to remove osnap.

I guess to turn on it`d be

!_Osnap _E _N etc… _Enter

Personally I use the Alt key for on demand OSNAPs(enable/disable)

1 Like

You can put this macro into your F3 key shortcut under Options:

-Runscript ( if Rhino.Osnap() then Rhino.Osnap(False) Else Rhino.Osnap(True) )

That should work as a toggle.

2 Likes

Hello - use

_DisableOsnap _Toggle

-Pascal

7 Likes

Thanks all. Got it.

hi @pascal,

_DisableOsnap _Toggle binded to a key didn’t work for me in R7… its not toggling Osnap on/off.

1234

ideas ?

And i’d like to do the same with pointsON and SolidpointsON

Regards,
CC

was missing a space -.-’

_DisableOsnap _Toggle

Hello Pascal,

“_DisableOsnap _Toggle” works fine in Rhino 6 but it cancels the current command. Is there a way to toggle Osnap with a keyboard key while in a command? (e.g. Control Point Curve).

Thank you, EM

Hi EM- that should not happen… Is that the full macro exactly as you are using on F3?

-Pascal

Good morning Pascal,

You are right. I had assumed that macros should be preceded by !. Using the macro as written works fine.

Thanks a lot!

Hello- right, the “!” is specirfically a “cancel” to be used with ‘non-nestable’ commands (most).

-Pascal

Please Can He say how I write code or script for assign F3 to osnap? (Rhino8)
Properties > Aliases ?