Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, everyone! I've been trying to create a simple lisp command that, depending on the value of the system variable SNAPMODE (either 0 or 1), toggles between two states of set values for both SNAPMODE and OSMODE. I want to be able to achieve the following:
- If SNAPMODE equals 0, set SNAPMODE to 1 and OSMODE to 0.
- If SNAPMODE equals 1, set SNAPMODE to 0 and OSMODE to 72.
I would have thought that with my barely basic knowledge of LISP I could easily figure it out using a few lines, but I guess not. I'm pasting the code I wrote, so maybe you guys can help me out.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Switch from OSMODE Snap to SNAPMODE Grid
(defun C:SGS ()
(if (= "SNAPMODE" 0)
(progn (setvar "SNAPMODE" 1) (setvar "OSMODE" 0));progn true
(progn (setvar "SNAPMODE" 0) (setvar "OSMODE" 72));progn false
);if
(princ)
);defun SGS
(princ)
Thanks in advance!
Solved! Go to Solution.