I was wondering if there is a setting somewhere that could hold my snapmode settings after I use a lisp routine. I found a lisp routine to rotate text and have noticed that everytime I use that lisp command I lose my osnap settings....any help would be appreciated.
at beginning of routine
(setq osm (getvar "osmode")
echo (getvar "cmdecho")
snp (rtos (car (getvar 'snapunit)))
snpm (getvar 'SNAPMODE))
(setvar "cmdecho" 0)
at end of routine
(command "snap" snp)
(setvar "snapmode" snpm)
(setvar "osmode" osm)
(setvar "cmdecho" echo)
you can add this to help as well near the top of your routine after the first defun line
(defun *error* ( msg )
(if osm (setvar 'OSMODE osm))
(if snpm (setvar 'SNAPMODE snpm))
(if snp (command "snap" snp))
(if echo (setvar 'CMDECHO echo))
(if (not (member msg '("Function cancelled" "quit / exit abort")))
(princ (strcat "\nError: " msg))
)
(princ)
)
You can place those snippets into the routine that is causing your snaps to go away and it should fix that issue for you, as it records snap (and a few other commonly used system variables) and places them into a variable then after the rotate lisp program portions run it'll reset whatever it changed back to the values recorded at the beginning .
The error handler does the same thing but in case of a user pressing the escape button midroutine
Can't find what you're looking for? Ask the community or share your knowledge.