style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<brianhiroshi> a écrit dans le message de news:Hi,
href="mailto:6127211@discussion.autodesk.com">6127211@discussion.autodesk.com...
My Lisp function gets the variables like osmode for example and makes them 0.
Then, at the end of the function it sets the variables back to what they were.
The problem is when the user presses the ESC button in the middle of the
function. Is there any way to restore the variables back to what they were
when this happens? Thanks
Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.
I have this at the top and the pt3 and the bottom and it will not rest any of them when i hit esc
(setq ab (getvar "angbase"))
(setq ad (getvar "angdir"))
(setq pg (getvar "polarang"))
(setq om (getvar "CMDECHO"))
(SETVAR "CMDECHO" 0)
(setvar "angbase" 0)
(setvar "angdir" 0)
(setvar "polarang" 1)
((= pt3 "C")
(command "angbase" 0 "angdir" 0)
(command "_line" pt2 ptc "")
(vl-exit-with-error "")
(defun *cancel* (msg)
(if (/= msg "Function cancelled")(prompt (strcat "\n:Cancel")))
(SETVAR 'CMDECHO cm)
(setvar 'angbase ab)
(setvar 'angdir ad)
(setvar 'polarang pa)
)
); end condition C
((= pt3 "D")
(initget 128 "C W")
(setq dir (getkword "\Pick angle Direction Counter clockwise or clock Wise[C/W]"))
(if (null dir)(setq dir "C"))
You can probably use this one as well: vl-catch-all-error-p