Jump to content
cat3appr

how to set OSNAP always on?

Recommended Posts

cat3appr

hi all

for some reason my OSNAPS are always off, when i want to move an object i need to right click and chose the osnap and then right click again to chose the end point for destination object move ... i find it absurd... my OSNAP are awalys on but i need to evoke them each time...

please help?

thanks!

Share this post


Link to post
Share on other sites
dtkell

Maybe some lisp is turning them off and not resetting them.
Try setting them with OSNAP and toggle them off and on using F3.

Share this post


Link to post
Share on other sites
ReMark

Do you make use of any lisp routines?  It's possible one of them is turning your OSNAPS off before it runs then it forgets to reset them after running.

Share this post


Link to post
Share on other sites
Aftertouch

Your OSNAP can be on, but do you have any default snaps actualy set?

image.png.9ac8683d8539fe8e119687962a5ac434.png

Share this post


Link to post
Share on other sites
BIGAL

Easy way is make a simple defun that sets your osnaps to what you want and load at start up.

 

To work out what your desired osnap seting is just do osnap set to what you want then type osmode a number will appear thats your osnaps setting.

 

Once loaded you can just call what you want. I have used numbers for the defun name to make easier and shorter to use.

 


(defun C:15 ()(setvar "osmode" 15359))   ; sets all snaps on
(defun C:47 ()(setvar "osmode" 47)(setvar "AUNITS" 0))
(defun C:99 ()(setvar "osmode" 99))
(defun C:8 ()(setvar "osmode" 8))
(defun C:59 ()(setvar "osmode" 15359))
(defun C:9 ()(setvar "osmode" 9))

 

Share this post


Link to post
Share on other sites
CyberAngel

There is a difference between using snaps and having snaps on. Unless the variable is set to ON, you must manually choose the snap every time.

 

You probably have an object snap button on your status bar to turn snaps on and off, make sure it is not grayed out. You can also use the F3 key or the OSNAP command, as dtkell points out. In every case you will get a message that the Osnap variable has turned on or off. The OSNAP command, unlike the button, will give you the list of active snaps. Also, as Aftertouch suggests, select the types of snap you normally use (too many gets confusing).

 

If this doesn't solve your problem, please provide more information.

Share this post


Link to post
Share on other sites
cat3appr
On 4/27/2019 at 2:54 AM, BIGAL said:

Easy way is make a simple defun that sets your osnaps to what you want and load at start up.

 

To work out what your desired osnap seting is just do osnap set to what you want then type osmode a number will appear thats your osnaps setting.

 

Once loaded you can just call what you want. I have used numbers for the defun name to make easier and shorter to use.

 

 


(defun C:15 ()(setvar "osmode" 15359))   ; sets all snaps on
(defun C:47 ()(setvar "osmode" 47)(setvar "AUNITS" 0))
(defun C:99 ()(setvar "osmode" 99))
(defun C:8 ()(setvar "osmode" 8))
(defun C:59 ()(setvar "osmode" 15359))
(defun C:9 ()(setvar "osmode" 9))

 

 

thanks but I don't get it, what number do I need to place if I want say :  endpoint, midpoint, center, intersection, perpendicular, to be ALWAYS ON?

when I type OSMODE, I geet number 199, i'm not sure what shall I write?

 

Also, the defun text you suggested... where shall I place them? is this a lisp?

Share this post


Link to post
Share on other sites
cat3appr
On 4/29/2019 at 5:16 PM, CyberAngel said:

There is a difference between using snaps and having snaps on. Unless the variable is set to ON, you must manually choose the snap every time.

 

You probably have an object snap button on your status bar to turn snaps on and off, make sure it is not grayed out. You can also use the F3 key or the OSNAP command, as dtkell points out. In every case you will get a message that the Osnap variable has turned on or off. The OSNAP command, unlike the button, will give you the list of active snaps. Also, as Aftertouch suggests, select the types of snap you normally use (too many gets confusing).

 

If this doesn't solve your problem, please provide more information.

 

Sorry it all sounds so complicated... I want my osnap: endpoint, midpoint, center, intersection, perpendicular, to be always on,   still didn't understand how to do it :)

Share this post


Link to post
Share on other sites
BIGAL

If you add this to acaddoc.lsp or if you have a startup lisp that you load, or make this as a start of your custom lisp use appload and add to the History so it loads every time. If you lose your osnaps maybe a lisp crashed, then just type 199. You can do transparent command within commands like Line then type '199 note the apostrophe '

 

You can change the defun c:199 if you want c:1 will work. I just stayed away from letters need to check 1st if Autocad is using.

 


(defun c:199 ( / )(setvar 'osmode 199))

Share this post


Link to post
Share on other sites
cat3appr

thanks but where and how i can add this string ?

(defun c:199 ( / )(setvar 'osmode 199))


Please tell me step by step, i’m not familiar with writing and loading lisps

 

and where is acaddoc.lsp ? is it a default thing?

Share this post


Link to post
Share on other sites
rkmcswain
2 hours ago, cat3appr said:

thanks but where and how i can add this string ?


(defun c:199 ( / )(setvar 'osmode 199))


Please tell me step by step, i’m not familiar with writing and loading lisps

 

and where is acaddoc.lsp ? is it a default thing?

 

Acaddoc.lsp is a file that you create and maintain. AutoCAD will load the first one it finds (if any) starting at the top of the support file search path. It will not search for or load any others after the first one.

 

Hence, it's a good idea IMO, to create a folder (for example C:\CADSTUFF), and then put your "Acaddoc.lsp" in there. Then add C:\CADSTUFF to the TOP of your support file search path. Then AutoCAD will always find your Acaddoc.lsp first and load it.

 

Granted, there shouldn't be any other Acaddoc.lsp files out there, but this folder also serves the purpose of being a location where you can put other custom files, such as a PGP file, menu files, hatch definition files, custom fonts, etc. Then if you get a new AutoCAD version or change PCs or whatever, you only need to grab this one folder of data, instead of hunting around for your custom things or relying on AutoCAD to "migrate" things properly.

 

Getting back to the "199" thing. The OSMODE sysvar is a bitcode variable. Each value, such as END, MID, CEN has a value assigned to it. The 199 is a sum of all of these values. More importantly, there are tools to query the value of OSMODE (or any bitcode sysvar) and determine if a particular mode is ON or OFF.

 

You could use this guide and a calculator to calculate the "199" value, but the easy thing is to just set the modes you need, then read the value of OSMODE.

Share this post


Link to post
Share on other sites
cat3appr

What steps   I have to do in order to have the below osnaps always on, on startup?     please explain as you would do to a child :)

 

 

Screenshot - 16_05_2019 , 13_45_45.png

Share this post


Link to post
Share on other sites
eldon

Just a slight technical note. Osmode of 199 would give Endpoint, Midpoint, Centre, Insertion, Perpendicular.

 

If you wanted Intersection instead of Insertion, Osmode would be 167.

  • Thanks 1

Share this post


Link to post
Share on other sites
rkmcswain
1 hour ago, cat3appr said:

What steps   I have to do in order to have the below osnaps always on, on startup?     please explain as you would do to a child :)

 

 

Screenshot - 16_05_2019 , 13_45_45.png

 

There are many ways to accomplish this.

Here is my suggestion:

 

  • Open Notepad
  • Paste in the following blue line, including the parenthesis: (setvar "osmode" 167)
  • Save this file to C:\CADStuff\acaddoc.lsp
  • Open AutoCAD.
  • Run the OPTIONS command, Files Tab
  • Expand the Support File Search Path
  • Add C:\CADSTUFF to the list
  • Move it to the TOP of the list.
  • Go down to the Trusted Paths section
  • Add the location C:\CADSTUFF
  • Close Options.
  • Close AutoCAD.
  • Reopen AutoCAD
  • Your desired object snap settings will be applied
  • If you manually change them at some point and open a new or existing drawing they will be restored.

 

Share this post


Link to post
Share on other sites
Romero
;OS   OSANAP MODE

(defun C:OSEND()
	 (setvar "osmode" 1)
	 (prompt "\nOSMODE IN >>ENDPOINT<<")
	 (princ)
)

(defun C:OSMID()
	 (setvar "osmode" 2)
	 (prompt "\nOSMODE IN >>MIDPOINT<<")
	 (princ)
)

(defun C:OSCEN()
	 (setvar "osmode" 4)
	 (prompt "\nOSMODE IN >>CENTER<<")
	 (princ)
)

(defun C:OSNOD()
	 (setvar "osmode" 8)
	 (prompt "\nOSMODE IN >>NODE<< (MTEXT, POINTS)")
	 (princ)
)

(defun C:OSQUA()
	 (setvar "osmode" 16)
	 (prompt "\nOSMODE IN >>QUADRANT<<  (CIRCLE, ARC, ELLIPSE)")
	 (princ)
)

(defun C:OSINT()
	 (setvar "osmode" 32)
	 (prompt "\nOSMODE IN >>INTERSECTION<<")
	 (princ)
)

(defun C:OSINS()
	 (setvar "osmode" 64)
	 (prompt "\nOSMODE IN >>INSERTION<< (BLOQUES,TXT)")
	 (princ)
)


(defun C:OSPER()
	 (setvar "osmode" 128)
	 (prompt "\nOSMODE IN >>PERPENDICULAR<<")
	 (princ)
)

(defun C:OSTAN()
	 (setvar "osmode" 256)
	 (prompt "\nOSMODE IN >>TANGENT<<")
	 (princ)
)

(defun C:OSNEA()
	 (setvar "osmode" 512)
	 (prompt "\nOSMODE IN >>NEAREST<<")
	 (princ)
)

(defun C:OS0()
	 (setvar "osmode" 0)
	 (prompt "\nOSMODE  >>DISABLED<<")
	 (princ)
)

(defun C:OSALL()
	 (setvar "osmode" 16383)
	 (prompt "\nOSMODE  >>ENABLED<<")
	 (princ)
)

;In case you require several Snap, edit the lines below according to your needs

(defun c:OS1 () (command "osnap" "mid,int,per,nea,end"))
(defun c:OS2 () (command "osnap" "mid,cen,per,qua,end"))
(defun c:OS3 () (command "osnap" "mid,nod,per,nea,end"))

 

Share this post


Link to post
Share on other sites
BIGAL
Posted (edited)

Thanks Ric for the big explanation very clear and Eldon for the insert.

 

Cat3appr now that you have made your acaddoc.lsp you might like to add a few more common shortcuts. Sometimes the shortcut is just saving pressing enter in the steps. I am sure others will make suggestions for simple every day shortcuts.

 

(defun C:FD () (setvar "filedia" 1)) ; turns dialog input back on

(defun c:PTY ()
(setvar 'pdmode 35) ; turn on Autocad point ptype
(setvar 'pdsize 0.1)
)

(defun c:PTYY () ; turn off ptype
(setvar 'pdmode 0)
)

(defun C:ZE () (command "zoom" "E") ) ; zoom extents

(defun C:PJ ()
(command "Pedit" "J") ; pline join
)

(defun C:15 ()(setvar "osmode" 15359))   ; sets all snaps on
(defun C:47 ()(setvar "osmode" 47))
(defun C:99 ()(setvar "osmode" 99))
(defun C:8 ()(setvar "osmode" 8))
(defun C:9 ()(setvar "osmode" 9))


 

Edited by BIGAL

Share this post


Link to post
Share on other sites
cat3appr

thanks guys, but where  shall I place these codes?  

 

this one:   shall i copy in a .txt save it as .lsp and load it each time in CAD? what's the name of the lisp?

please don't give anything for granted...  don't know what to do with this code, just the way it is :)

 

(defun C:FD () (setvar "filedia" 1)) ; turns dialog input back on

(defun c:PTY ()
(setvar 'pdmode 35) ; turn on Autocad point ptype
(setvar 'pdsize 0.1)
)

(defun c:PTYY () ; turn off ptype
(setvar 'pdmode 0)
)

(defun C:ZE () (command "zoom" "E") ) ; zoom extents

(defun C:PJ ()
(command "Pedit" "J") ; pline join
)

(defun C:15 ()(setvar "osmode" 15359))   ; sets all snaps on
(defun C:47 ()(setvar "osmode" 47))
(defun C:99 ()(setvar "osmode" 99))
(defun C:8 ()(setvar "osmode" 8))
(defun C:9 ()(setvar "osmode" 9))

Share this post


Link to post
Share on other sites
BIGAL

Just add to your acaddoc.lsp that is the idea it will load automatically every time.

 


" add a few more common shortcuts"
 

Share this post


Link to post
Share on other sites
cat3appr
On 5/19/2019 at 6:46 AM, BIGAL said:

Just add to your acaddoc.lsp that is the idea it will load automatically every time.

 


" add a few more common shortcuts"
 

 

 

I can't find this acaddoc.lsp in my C , is it a file supposed to be somewhere ?  or do I have to create this acaddoc.lsp   if so where shall I put it ?  and what is the name to evoke it when I need to load the application ?    op

Please don't give anything for granted.. 

 

as it was suggested before in this tread ,   I have created  a folder C:\Cadstuff  where I placed a few lisps, and then under options I added this path in support file search path

 

However it's a curse, the osnaps keep on getting turned off each time i do a command.... 

I load the lisp attached, the osnap get turned on, then i executed a coomand, and they get turned off again....

 

Please help, but step by step, not just a copy&paste of a code, twithout further instructions , hanks you :)

OSNAP.lsp

Share this post


Link to post
Share on other sites
BIGAL
Posted (edited)

Ok will try again, as you have a support directory c:\cadstuff take what I have posted previously paste into notepad and then saveas c:\cadstuff\acaddoc.lsp. Add this also. The other commands will work also.

 


(defun c:167 (setvar "osmode" 167))

 

At any time your osnaps are wrong just type 167 it should work.

ACADDOC.LSP

Edited by BIGAL

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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