- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have created a command whereby I want to save the users OSNAP settings, current LAYER, create and set a layer, then run the Autocad REVCLOUD command. At the end of the routine, I want Autocad to return the OSNAP and current LAYER back to pre-command settings.
It seems to return the current layer back, but the osnap settings remain set to 0. I'm a novice at lisp, obviously, and would like to know how you can run an autocad command within the middle of a lisp routine, and at the end of the command it still runs a few settings to be reset.
(The SLAY variable you see below is set in the command line in the CUIX menu file)
Also, when you hit ESCAPE halfway through the routine, is there a way it will return all the settings back to before the command was started? Is it an error checking routine or something I need in it?
Can anybody look at it below and provide some direction. It would be muchly appreciated!
(defun C:SREVCLOUD (/ CLAY OSM)
(setvar "cmdecho" 0)
(setq CLAY (getvar "clayer"))
(setq OSM (getvar "osmode"))
(setvar "snapmode" 0)
(setvar "osmode" 0)
(command "-Layer" "M" SLAY "C" "80" "" "" "")
(command "_revcloud" pause pause)
(setvar "clayer" CLAY)
(setvar "osmode" OSM)
)
(princ)
;_ end of defun
Thx.
Doug
Solved! Go to Solution.