ajs Posted January 31, 2009 Posted January 31, 2009 Can anyone tell me if there is a system variable that will cause a lisp program to ignore all snaps? I thought there was but I can't seem to find it. ---Thanks AJS Quote
NBC Posted January 31, 2009 Posted January 31, 2009 need somehow to set osmode temporarily to a value of 0 Quote
dbroada Posted January 31, 2009 Posted January 31, 2009 (setvar "OSMODE" 0) but it is better to save "what it was" and restore that afterwards. It can be done with a boolean function to toggle but I can't remember what that is. Quote
Lee Mac Posted January 31, 2009 Posted January 31, 2009 One from the guru himself: ;; CAB 02.04.08 (defun Set_osmode (flg) ; nil=OFF t=ON (if (or (and flg (>= (getvar "osmode") 16383)) ; ON & osmode is off (and (null flg) (<= (getvar "osmode") 16383)) ; OFF & osmode is ON ) (setvar "osmode" (boole 6 (getvar "osmode") 16384)) ; Toggle osmode ) ) Quote
Lee Mac Posted January 31, 2009 Posted January 31, 2009 When using with something like possibly the line function: (command "_line" "_non" pt1 "_non" pt2.... etc etc) Will ignore snaps. Quote
ajs Posted January 31, 2009 Author Posted January 31, 2009 Thanks for that bit of code. Much appreciated! ---AJS Quote
ollie Posted February 4, 2009 Posted February 4, 2009 Not quite as elegant as CAB's solution but a simple resolve i've used in the past was (Setq os_val (getvar "osmode")) (Defun C:myfunction() ;Function code here (setvar "osmode" os_val) ; last line of code ) Isn't practical for debugging but works pretty well other than that. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.