Jump to content

Turning off 3D Object Snap?


jjatho

Recommended Posts

I'm writing an AutoLISP script that will auto dimension some objects I use quite often, but in different configurations and patterns.

 

I'm using the following in the script to deal with 2D snap:

 

(setq snapMode (getvar "osmode")) ;Get current Object Snap Mode

(setvar "osmode" 0) ;Turn off Object snap

(setvar "osmode" snapMode) ;Restore Object Snap values

 

Those three lines are in the correct locations in the code to adjust the snap modes as needed. The code works flawlessly when 3D Object snap is turned off, but the dimensions end up in the wrong spots when 3D object snap is on.

 

Googling didn't help, so I'm hoping that there's a way to turn off 3D snap via AutoLISP. I work in both 2D and 3D all day long, so keeping 3D turned off at all times isn't the best option here.

Link to comment
Share on other sites

Thanks! Fixed it instantly. For some damn reason I couldn't find the system variable via googling.

 

When in doubt, and trying to figure out a system variable, try using SYSVDLG, where it is usually pretty easy to find what you are looking for, and much more.

An excellent way to learn plenty about the software, and available options, just use your keyboard cursor to scroll throught the list, to quickly review functionality, once you think you are in the right neck of the woods on the list.

sysvdlg is great.jpg

Link to comment
Share on other sites

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