MoI discussion forum
MoI discussion forum

Full Version: Toggle all snaps on or off

From: Metin Seven (METINSEVEN)
30 Aug 2018   [#1]
Hi,

The MoI 3D Command Reference contains three individual inline scripts to toggle each snap type on or off, but not one script to toggle them all on or off at the same time, so I combined the script lines. In case you could also use it, here it is:

script: /* Toggle snaps on or off */ moi.drawingAids.gridSnap = !moi.drawingAids.gridSnap; moi.drawingAids.objectSnap = !moi.drawingAids.objectSnap; moi.drawingAids.straightSnap = !moi.drawingAids.straightSnap;

You can also hold the Alt key to temporarily disable all snaps, but sometimes I find it easier to toggle them on or off.

Sorry if this is already discussed in an old MoI forum thread. I couldn't find it, but I didn't search thoroughly.

Regards,

Metin

———————

visualization • pixel art • illustration • animation • 3D design — https://metinseven.nl
From: Metin Seven (METINSEVEN)
30 Aug 2018   [#2]
P.S.: I personally assigned the script to toggle all snaps on or off to the ';' key, because that's also the snap toggle key in Affinity Photo and Affinity Designer.

Message 9045.3 was deleted


From: Metin Seven (METINSEVEN)
31 Aug 2018   [#4]
Hi Michael,

I've noticed one drawback to this way of turning off or on all snaps: if one of the snaps is already turned off it will be toggled on again.

Is there a way to turn off or on all snaps at once (while keeping the snap subtypes intact) ?

Thanks in advance.

Regards,

Metin

———————

visualization • pixel art • illustration • animation • 3D design — https://metinseven.nl
From: Michael Gibson
31 Aug 2018   [#5] In reply to [#4]
Hi Metin, try using this:

script: /* Toggle snaps on or off */ moi.drawingAids.gridSnap = !moi.drawingAids.gridSnap; moi.drawingAids.objectSnap = moi.drawingAids.gridSnap; moi.drawingAids.straightSnap = moi.drawingAids.gridSnap;

That one will toggle grid snap, then make object snap and straight snap match the new grid snap state.

- Michael
From: Metin Seven (METINSEVEN)
31 Aug 2018   [#6] In reply to [#5]
Nice! Thank you Michael!

Message 9045.7 was deleted


Message 9045.8 was deleted


From: Chris (CEEN)
4 Dec 2022   [#9] In reply to [#6]
Hi,

bumping this thread: is there a way to toggle only the active snapping?

The last version of the script alway activates all three snapping when used for toggle. Thx!
From: Michael Gibson
4 Dec 2022   [#10] In reply to [#9]
Hi Chris,

re:
> bumping this thread: is there a way to toggle only the active snapping?

Sorry I don't understand what you mean by "active snapping", can you maybe describe a little bit more about what you are asking?

- Michael
From: pior (PIOR_O)
5 Dec 2022   [#11] In reply to [#10]
I believe that by "active snapping "the OP means "the currently activated snap mode(s), whichever they may be." In other words the OP is likely looking for a functionality similar to that of Inkscape, where "Enable Snapping" on/off turns off all current snapping options altogether (but without losing the granular snap settings).

Image Attachments:
2022-12-05 16_45_44-New document 1 (no filters) - Inkscape.png