MarcoW Posted April 27, 2011 Share Posted April 27, 2011 Most of us have encountered the AutoCAD message: "Save changes to Drawing1.dwg?" Like this: In case of a new blank drawing in wich something is changed / added / etc. this is a logical thing. Sometimes this message appears even when nothing has changed in the drawing: opening a new AutoCAD session from scratch and then close it immediately without any input from the user results in the prompt wether so save it or not . Question is why does AutoCAD prompt for this when nothing has changed. Well the answer is easy: something did change but you did not notice. My situation: whenever AutoCAD opens a drawing, a new one or existing one, I have several Lisp routines that change setting so "the drawing behaves like I want it to". In other words: I changed some systemvariables. In the database of AutoCAD this is seen as a change and therefore it prompts to save it or not. In my case I have been pressing "no" for like a year or so. But now I found a way to protect myself against this prompt. If one is interested, please investigate the next two AutoCAD functions: acad-push-dbmod & acad-pop-dbmod. It is very simple to understand but I never had heard of it. I just happend to find it, lucky me. This is a small piece of code how I use it (based on some idea's from David Bethel): (defun SomeFunction (/ CmdEchoOld rst v var) (vl-load-com) ; load activeX functions (acad-push-dbmod) (setq CmdEchoOld (getvar 'CMDECHO)) (setq var '( ("CMDECHO" . 0) ("OSMODE" . 229) ("ORTHOMODE" . 1) ("GRIDMODE" . 0) ;; create your own list ) ) ;_setq (foreach v var (and (getvar (car v)) (setq rst (cons (cons (car v) (getvar (car v))) nw_rst)) (setvar (car v) (cdr v)) ) ;_and ) ;_foreach (setvar 'CMDECHO CmdEchoOld) (acad-pop-dbmod) (princ) ) ;_defun (SomeFunction) ; AutoLoad I thought maybe this can be of help to anyone else. Of course I am open to any additional info / suggestions / comments. Regards. Quote Link to comment Share on other sites More sharing options...
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.