ACAD OSNAP Help

Troubleshooting the loss of OSNAP settings in ACAD 2002. February 25, 2005

Question
I am having fits with losing my osnap settings in 2002. I frequently toggle them off and on with F3, but all of a sudden all my settings are gone. I can't figure out if it is some combination of key strokes and clicks which clears them, but it is driving me crazy. Any ideas?

Forum Responses
(CAD Forum)
Do you have any third party or lisp routines installed? I've run into this problem before when I've used some custom applications. Don't know how to fix it, though. I'm finding it harder and harder to get these lisp routines to work with each new iteration of ACAD.



If you are having trouble with lisp routines not returning your settings to where they were, chances are that they don’t have any error trapping written in the program. I’ve found most simple routines will change your system variables in the beginning of the routine and then restore them at the end. This is okay as long as you let the routine do its thing, but if you use the undo command, it will step back through every line of the routine.

So, you might undo until you see the object gone from your screen, but you didn’t go back far enough to undo the system variable changes it made, like snap settings. If this is the case, you need to write some error trapping into your lisp routines, so if you hit escape or undo, it will automatically return to the top of the routine so your settings are the same as before the routine ran.

AutoCAD does the same thing with its programs. Say you have your snap settings to endpoint and midpoint, then you uncheck them and draw a line, then undo a few times. You will see that the snap settings are back to end and mid because you went back to the point where they were on. Same thing with f3 toggling the snaps on/off.

One thing you can do is make a button that will set your snaps to your basic setup.
1. Get your snaps to what you want for a default. Click ok.
2. In the command window, type osmode and you will see a number at the end example. Check endpoint and midpoint type osmode and you should see “3”.
3. Right click on any button and select "customize" from the dropdown menu.


4. Select the command tab and at the bottom of the categories window, select user defined.
5. To the right, drag the text that says user defined button off to a blank part of the screen.
6. Click in the center of the blank button and it will change the dialog box to the button properties tab. Type in a name and description, i.e. Snap return.
7. In the macro window after the ^C^C, type osmode, then hit the spacebar once and the number you saw in step #2, then put a semicolon right after the # example ^C^Cosmode 3;
8. If you want, edit the button image with a pretty picture.
9. Hit apply the close or close.


From the original questioner:
Thanks. I am using express tools, but beyond that I can't think of any lisp routines I may have imported. I am wondering if hitting escape in the middle of certain functions is clearing my settings. It's always after I have f3 toggled osnaps off that I lose my settings.


I like to set my favorite snaps with autolisp using key commands. I need this because I have a program working within AutoCAD that turns off the osnaps for some operations. I prefer the key command rather than tool button for real estate reasons.

Here is my lisp.

; DESCRIPTION: favorite Osnaps
;
; Entering "fs" sets current Osnap mode as defined in expression:
;
; 0=none
; 1=endpoint
; 2=midpoint
; 4=center
; 8=node
; 16=quadrant
; 32=intersection
; 64=insert
; 128=perpendicular
; 256=Tangent
; 512=Nearest
; 1024=Quick
; 2048=apparent Intesection
; 4096=Extension
; 8192=Parallel
;
; If more than one mode is required, enter the sum of those modes.
;


; RE: 63=1+2+4+8+16+32 (End+Mid+Ctr+Node+Quad+Int)
;
;**********************************************************************
(defun C:fs () (command "_osmode" "191")

(princ "\nYour favorite Snaps have been set !!")
(PRINC))



From the original questioner:
Well, as it turns out, it is the multi pline edit in express tools. It turns off the osnaps and clears the selections. Go figure.