Hotkey for Toggles Custom snap mode

Hotkey for Toggles Custom snap mode

Vuxvix
Advocate Advocate
1,257 Views
6 Replies
Message 1 of 7

Hotkey for Toggles Custom snap mode

Vuxvix
Advocate
Advocate

hi! everyone
-There is my custom snap:
^C^C_OSMODE;1085
I created custom command and set hotkey (F5) for it.
while i drawing, i want to switch beetween my custom snap and perpendicular snap by hotkey . So i copy toggles perpendicular
^P'_.osmode 128 $(if,$(eq,$(getvar,osnapoverride),0),'_.osnapoverride 1)
-Then edit:
^P'_.osmode 128 $(if,$(eq,$(getvar,osnapoverride),1085),'_.osnapoverride 1)
then set hotkey (F6)
-ISSUE:
When i put F6. snap mode switch to perpendicular then not comback to Custom snap.
I dont have exp in lisp and code. Where is wrong in my code!? and how to fix. Many thanks for help

0 Likes
Accepted solutions (1)
1,258 Views
6 Replies
Replies (6)
Message 2 of 7

Sea-Haven
Mentor
Mentor

In some cases you can use a transparent command, for me its say '47 this is osnap mode 47, so if you want different snaps can just make a few defuns that (setvar 'osmode value), typing the number without apostrophe on the command line sets the osnaps before running a command.

 

eg Line '47 then pick point

 

Using shift and right button mouse is still very quick. 

0 Likes
Message 3 of 7

Vuxvix
Advocate
Advocate

hi!thanks for reply

if it's only done a few times, it shouldn't be a problem. But when you have to make it a few hundred or a thousand times. then I think the reduction to 1/3 operations is a significant number.

0 Likes
Message 4 of 7

ВeekeeCZ
Consultant
Consultant

Just simple 'per for F5 won't help? 

0 Likes
Message 5 of 7

ВeekeeCZ
Consultant
Consultant
Accepted solution

BTW not sure what functionality you're expecting from it. There are three possibilities

 

* temporary override for next 1 input

_per

 

* temporary override for the time the button being pressed. It can switch to something else while the butting is released. While this is where you aiming to, I would no recommend it much. But it could be just me.

Macro1: ^P'_.osmode 128 $(if,$(eq,$(getvar,osnapoverride),0),'_.osnapoverride 1)

Macro2: ^P'_.osmode 1085

Z9E3zK5E_0-1628589260407.png

 

* permanent toggle: you need to hit the button to turn it on, then again when youre done to turn it off

^P'_.osmode $M=$(if,$(eq,$(getvar,osmode),128),1085,128)

 

Message 6 of 7

Vuxvix
Advocate
Advocate

Hi Mr.Bee

Firstly, thanks for your help.

 As you said, I would like the hotkey to toggle between custom snap settings and snap perpendicular. In the default way, I would need: Shift+Rmouse, then pick (or keyboard shortcut P). I think it's not just me but you will agree. All snap options should not be selected (I had to do and fix many drawings with minor deviations, which is really annoying). snapping perpendicular is one of them.

 2nd solution: It helped me to solve the problem by holding down the hotkey(F5) during the operation(I mean, it's the same way Shift+Rmouse+Snap option does.).Many thanks! Also, Is it possible to just press the F5 key(I mean, it's the same way Shift+Rmouse+Snap option does. the command will end after the operation is over)

P/s:you advise me not to do this. So is there any reason?

0 Likes
Message 7 of 7

ВeekeeCZ
Consultant
Consultant

@Vuxvix wrote:

...

P/s:you advise me not to do this. So is there any reason?


 

Feel free to use it if you like it.

I have just bad experience with it. I think the major issue to me was a limitation that you cannot just aim with osnap and type a distance while holding this key. 

Also, another issue is when using these overrides with the Shift key combination - as they are set by default. That's totally unreliable to me. Often ended op with EEEEEEEEEEE. So.

0 Likes