Turn Osanp to original settings if ESC key is used

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to figure out what to add to a lisp command so that Osnap settings revert back to user settings if the ESC key is used.
Here is the code I am currently trying to modify:
(Defun LRSD4 (/ sf e1 pt1 pt2)
(setq sf (getvar "dimscale"))
(command "ortho" "on")
(setq smode (getvar "osmode"))
(command "osnap" "none")
(prompt "Enter left location: ")
(command "insert" "lsd2" "scale" sf pause "0.0")
(setq e1 (entget (entlast)))
(setq pt1 (cdr (assoc 10 e1)))
(setq pt2 (getpoint "\nEnter right location: " pt1 ))
(command "insert" "rsd2" "scale" sf pt2 "0.0")
(command "ortho" "off")
(command "insert" "3RDL" "scale" sf pt2 PAUSE)
(command "setvar" "osmode" smode)
)
(Defun c:lrsd2 ()
(setvar "cmdecho" 0)
(lrsd4)
(setvar "cmdecho" 1)
(princ)
)
Any help would be greatly appreciated.