Jump to content

Recommended Posts

Posted

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

Posted

need somehow to set osmode temporarily to a value of 0

Posted

(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.

Posted

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
   )
 )

Posted

When using with something like possibly the line function:

 

(command "_line" "_non" pt1 "_non" pt2.... etc etc)

 

Will ignore snaps.

Posted

Thanks for that bit of code. Much appreciated!

 

 

---AJS

Posted

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...