Lisp: warning box on close when snapang is not equal to 0

Lisp: warning box on close when snapang is not equal to 0

MANTONIOPM
Advocate Advocate
532 Views
7 Replies
Message 1 of 8

Lisp: warning box on close when snapang is not equal to 0

MANTONIOPM
Advocate
Advocate

Hello, I would like to know the lisp code so that when I go to close a drawing it warns me that snapang is not 0 value.

0 Likes
533 Views
7 Replies
Replies (7)
Message 2 of 8

Sea-Haven
Mentor
Mentor

You can define your own close command so can check snapang and set to zero then save and close. 

 

Look at help "Define" "Undefine" and using "_" & "." with commands _.close

0 Likes
Message 3 of 8

Kent1Cooper
Consultant
Consultant

@Sea-Haven wrote:

You can define your own close command so can check snapang and set to zero then save and close. 

....


I wouldn't bother checking the SNAPANG setting.  Just have your own Close command set it to zero regardless, then Save and Close.

 

But @MANTONIOPM , that assumes you simply want SNAPANG to always be zero when you get out of the drawing.  If you want a warning issued, allowing the option that the User may have good reason to leave it other than zero, that could be done, though it's obviously more complicated.

Kent Cooper, AIA
0 Likes
Message 4 of 8

Sea-Haven
Mentor
Mentor

You are right we have our own "I like" settings, so run a set them all before closing for next time, 8 users all had different osnap prefernces, toolbars etc. Work got done.

 

For OP put it in your personal appload startup so gets set when you open a dwg.

0 Likes
Message 5 of 8

ВeekeeCZ
Consultant
Consultant

How about set snapang 0 always on start.

Message 6 of 8

MANTONIOPM
Advocate
Advocate
First of all sorry for my english, I'm using google translate. I already wrote a lisp which sets snapang to 0, saves and finally closes the drawing. But sometimes I don't want to save the last thing I did, but the previous one, and I need to close without saving. In this case it is very likely that I don't remember how snapang was configured the last time I saved. I can edit the acaddoc.lsp, for example, with the setvar variable so that when I open the drawing it sets it to 0, but it would only solve the problem on my computer. That's why I want a lisp that warns me before closing the drawing to change it and when someone opens it the snapang finds it in 0
0 Likes
Message 7 of 8

pendean
Community Legend
Community Legend
@MANTONIOPM it appears you really want a startup routine that sets your SNAPANG to your desired setting when you OPEN a file instead of the same at file closing. How about that solution?
That way you never have to worry about what it is you want or not want to save when you close a file.

Or better yet, an active reactor that constantly checks for the setting you want and alerts you all the time.

HTH
0 Likes
Message 8 of 8

Kent1Cooper
Consultant
Consultant

@MANTONIOPM wrote:
.... I can edit the acaddoc.lsp, for example, with the setvar variable so that when I open the drawing it sets it to 0, but it would only solve the problem on my computer. ....

If such files are on a server, and if you can agree on a universal content for an acaddoc.lsp file, you can put that in a server location and put that location in everyone's search path list.

Kent Cooper, AIA
0 Likes