Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

?about OSNAP settings?

Status
Not open for further replies.

shadow

Computer
Mar 1, 2001
321
there was a Post here in this forum a while back that i just thought about and if the one who wrote it could give me an idea of how he did it it would be a nice little tip for us all
had some thing to do with or equal to OSNAP States

which means say you have certain OSNAPS that you use often and turned on when you do certain funtions in autocad but instead of going into drafting settings you just click a button and then they are all preset so take for example

i use the following OSNAPS often enough to warent this
NODE
End
MID
INT
PERP
so if in 1 button i want to use this "OSNAP State"
how would i do so if everyone helps everybody the world will be a better place
 
Replies continue below

Recommended for you

Not sure if it is the same (assuming that it is) for all recent versions of AutoCAD, there are 2 ways to do it.

1: Modify the existing osnap button that is on a standard Autocad toolbar (SNAPS toobar, in LT2000) (preferred if you are the only one that uses that machine)

or

2: Create a new button, and place it on the toolbar of your choice, usually a custom toolbar. (preferred if multiple users are on one machine)

(the following applies for sure to LT2000, and should be reasonably close to other releases, I think)

To modify the existing button, right click on it, and hit customize, then right click on it again, and hit properties
for your application, the command line should read
'-osnap_node,end,mid,int,perp_
where the underscores are spaces. Then click apply and close.

To create a new button, right click on any button and hit customize. Go to user commands, and drag the blank button to the toolbar desired, then right click on the button and hit properties. enter the command line above, and label the button as desired, with the icon desired, and hit apply.

I hope this info helps, and again, please let me know if I missed something in it and it gives you problems
 
I don't know if this will help, but this is how I use OSNAP in AutoCAD LT97:

I press (F3) to turn it on, and (F3) again to turn it off.
While on, pressing (Shift + right-clicking) brings up the OSNAP menu.

Hope it helps,
andyd211
 
I use the "osmode" system variable to accomplish this.
Osmode sets running object snap modes using the following bit-codes:

0 NONe
1 ENDpoint
2 MIDpoint
4 CENter
8 NODe
16 QUAdrant
32 INTersection
64 INSertion
128 PERpendicular
256 TANgent
512 NEArest
1024 QUIck
2048 APParent Intersection

To specify more than one object snap, enter the sum of their values. In your case, setting the button macro to '_osmode;171; will give the osnap settings you want.
 
ok Well with knowing this has anyone thought of making a lisp routine that saves these settings to a text file and is able to recall them later??

Like So

1 you set the running osnaps in the Drafting settings dialog
2 run the routine it reads this saves it out to a text file in the same location as the lsp file and names this set of osnaps 1st setting and then if the configureation changes it does it again
3 then when you want to recall those settings all you do is run the routine with the # of the setting list that you want restored.

And there you would have osnap states if everyone helps everybody the world will be a better place
 
The best place for these settings is in your acad.lsp file (or acadr14.lsp) if using R14. The syntax is (defun C:XX()command "OSMODE" "nn")), where XX is the keyboard shortcut you want to use and nn is the osmode value you want to set. For example, to assign the keyboard shortcut xs to the snap state you mentioned in your first post you would enter (defun C:xs() (command "OSMODE" "171")) in your acad.lsp file. Then any time you type in xs at the command prompt the snaps will be set. I would recommend also having a line (defun C:N() (command "OSMODE" "0")) so that you can also remove all snap settings easily. If you want to customize a toolbar button for this snap setting add a new button to a toolbar, right click on the button and enter '_osmode;171; in the button macro.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor