# Assign F3 to toggle OSnap on/off?

**URL:** <https://discourse.mcneel.com/t/assign-f3-to-toggle-osnap-on-off/66103>\
**Category:** Rhino for Windows\
**Created:** [July 1, 2018, 2:44am UTC](https://discourse.mcneel.com/t/assign-f3-to-toggle-osnap-on-off/66103 "2018-07-01T02:44:11Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![CalypsoArt](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/calypsoart/32/770614_2.png) [@CalypsoArt](https://discourse.mcneel.com/u/CalypsoArt)\
**Post date:** [July 1, 2018, 2:44am UTC](https://discourse.mcneel.com/t/assign-f3-to-toggle-osnap-on-off/66103/1 "2018-07-01T02:44:11Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Toshiaki\_Takano](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/toshiaki_takano/32/483707_2.png) [@Toshiaki\_Takano](https://discourse.mcneel.com/u/Toshiaki_Takano)\
**Post date:** [July 1, 2018, 3:01am UTC](https://discourse.mcneel.com/t/assign-f3-to-toggle-osnap-on-off/66103/2 "2018-07-01T03:01:54Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![Jarek](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jarek/32/776329_2.png) [@Jarek](https://discourse.mcneel.com/u/Jarek)\
**Post date:** [July 1, 2018, 4:42am UTC](https://discourse.mcneel.com/t/assign-f3-to-toggle-osnap-on-off/66103/3 "2018-07-01T04:42:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pascal](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/pascal/32/479395_2.png) [@pascal](https://discourse.mcneel.com/u/pascal)\
**Post date:** [July 1, 2018, 5:00am UTC](https://discourse.mcneel.com/t/assign-f3-to-toggle-osnap-on-off/66103/4 "2018-07-01T05:00:21Z")

</div>

Hello - use

`_DisableOsnap _Toggle`

-Pascal

---

<div class="post-metadata">

**Author:** ![CalypsoArt](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/calypsoart/32/770614_2.png) [@CalypsoArt](https://discourse.mcneel.com/u/CalypsoArt)\
**Post date:** [July 1, 2018, 4:55pm UTC](https://discourse.mcneel.com/t/assign-f3-to-toggle-osnap-on-off/66103/5 "2018-07-01T16:55:15Z")

</div>

Thanks all. Got it.

---

<div class="post-metadata">

**Author:** ![LeGaulois](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/legaulois/32/476047_2.png) [@LeGaulois](https://discourse.mcneel.com/u/LeGaulois)\
**Post date:** [January 18, 2021, 8:24pm UTC](https://discourse.mcneel.com/t/assign-f3-to-toggle-osnap-on-off/66103/6 "2021-01-18T20:24:28Z")

</div>

hi @pascal,

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

![1234](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/0/2/f/02fc7ca8136fa50453925c843fcb7119d4253da1.jpeg)

ideas ?

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

Regards,  
CC

---

<div class="post-metadata">

**Author:** ![LeGaulois](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/legaulois/32/476047_2.png) [@LeGaulois](https://discourse.mcneel.com/u/LeGaulois)\
**Post date:** [January 18, 2021, 8:35pm UTC](https://discourse.mcneel.com/t/assign-f3-to-toggle-osnap-on-off/66103/7 "2021-01-18T20:35:50Z")

</div>

was missing a space -.-’

\_DisableOsnap \_Toggle

---

<div class="post-metadata">

**Author:** ![emartingr](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/emartingr/32/769871_2.png) [@emartingr](https://discourse.mcneel.com/u/emartingr)\
**Post date:** [August 31, 2022, 12:04pm UTC](https://discourse.mcneel.com/t/assign-f3-to-toggle-osnap-on-off/66103/8 "2022-08-31T12:04:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pascal](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/pascal/32/479395_2.png) [@pascal](https://discourse.mcneel.com/u/pascal)\
**Post date:** [August 31, 2022, 1:44pm UTC](https://discourse.mcneel.com/t/assign-f3-to-toggle-osnap-on-off/66103/9 "2022-08-31T13:44:11Z")

</div>

> [@emartingr](#):
>
> \_DisableOsnap \_Toggle

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

-Pascal

---

<div class="post-metadata">

**Author:** ![emartingr](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/emartingr/32/769871_2.png) [@emartingr](https://discourse.mcneel.com/u/emartingr)\
**Post date:** [September 1, 2022, 11:22am UTC](https://discourse.mcneel.com/t/assign-f3-to-toggle-osnap-on-off/66103/10 "2022-09-01T11:22:28Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![pascal](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/pascal/32/479395_2.png) [@pascal](https://discourse.mcneel.com/u/pascal)\
**Post date:** [September 1, 2022, 2:10pm UTC](https://discourse.mcneel.com/t/assign-f3-to-toggle-osnap-on-off/66103/11 "2022-09-01T14:10:29Z")

</div>

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

-Pascal

---

<div class="post-metadata">

**Author:** ![Hulki\_Aydoğmuş](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/hulki_aydo%C4%9Fmu%C5%9F/32/768025_2.png) [@Hulki\_Aydoğmuş](https://discourse.mcneel.com/u/Hulki_Aydo%C4%9Fmu%C5%9F)\
**Post date:** [January 18, 2024, 5:58am UTC](https://discourse.mcneel.com/t/assign-f3-to-toggle-osnap-on-off/66103/12 "2024-01-18T05:58:11Z")

</div>

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