Well I'm embarrassed to have to ask this after using autocad for at least 15 years but I still really have trouble getting CUI to do what I want.
Could a kind person help me to set up a keyboard shortcut that toggles both snap and osnap at the same time?
I receive a lot of drawings in the office that are poorly aligned to grid and spend ages sorting out snap problems before I can get on with the work itself.
So I spend hours with my left hand stretched between F3 and F9 to alternately toggle them. And I'm getting RSI!
The combination I need is 'snap on' 'osnap off' and vice versa. Maybe F5 would be good as I don't use Isoplane.
(Yes I know I could move the functions so they are closer on the keyboard but this seems the wrong answer.)
Many thanks in advance for your help.
Paul
Solved! Go to Solution.
Solved by Kent1Cooper. Go to Solution.
On the Osnap modes issue, see this thread. Toggling Snap on/off is easier, since it's just a 1 or 0 choice -- subtract the current value from 1 to get the other value. Wherever you put it [command name, Ctrl+something key combination, remapped F key, toolbar, whatever], this code should do it:
(setvar 'osmode (boole 6 (getvar 'osmode) 16384))
(setvar 'snapmode (- 1 (getvar 'snapmode)))
But note that the above will toggle each of them independently of the state of the other, so if you do it when Osnap is on and Snap is off, it will change to Osnap off and Snap on [or vice versa]. If you want both on or both off, even if you're starting with one of each, that's a different problem. You would probably need one that turns both off, one that turns both on, and the above to toggle both once you get them synced with each other. Or just use the usual methods to change one of them to be in agreement with the other, then use the above to toggle.
Hi Kent,
I pasted your lines of code into the 'macro' line for a shortcut and remapped it to F5. It works nicely. I do take your point about toggling from the initial state of the keys though. I can live with that. Actually it may be more useful that way as I can use it for other things.
What I have ended up with is a re-purposing of the 'UCS3Point' option. Because that was the command I clicked before I customised it to the new function. So this is a bit untidy having the bottom line saying 'Element ID ID_Ucs3point'.
How would I create the same thing from scratch without choosing an existing command and editing it? Or alternatively how could I change the Element ID which is permanently greyed out here?
A bit off topic now but many thanks indeed for your help.
Paul