Hello Sea.heaven.
What I really want is, the following:
--------------------
Think about a user working on a drawing.
This momement wants not OSNAP ON but OFF.
Looks at the current state and sees that the OSNAP button is pressed (is ON).
Independently of what is the current state (maybe snap to line end is ON or else) wants the OFF state.
The useser presses the button "OSNAP" and autocad answers <osnap off> and now, no any osnap on ex.
The above is a code :::
(defun c:SetOsnapOff()
..........................
)
I what the button did
-----------------------------------
after he worked with multiple actions, he needs to set it ON again (to restore the previous state)
He presses the "OSNAP" button and the previous state restores.
Pressing the button autocad says <osnap on>
I suppose the current state was stored somewhere in someone system variable and the pre existant senario restores.
So a next defun is necessary :
(defun c:SetOsnapOn()
..........................
)
not a set of the modes to be one , but to restore the previous wich was on (before pressing button and set it off)
what the button does.
In your code
(defun c:0 ()
(cond
((= (getvar 'osmode) 0)(setvar 'osmode 47))
((> (getvar 'osmode) 0)(setvar 'osmode 0))
)
)
, everything happens during one defun.
That's the problem.
If autocad can do it two defuns can do it.
Thank you,
Gery.