+ Reply to Thread
Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 26
  1. #1
    Super Member MarcoW's Avatar
    Computer Details
    MarcoW's Computer Details
    Operating System:
    Microsoft Windows 7 Pro 64-bit
    Computer:
    A black one
    CPU:
    Intel Xeon E5520 Quad Core
    RAM:
    8 GB
    Graphics:
    NVIDIA Quadro FX 580 - 512MB
    Primary Storage:
    300 GB 10000 RPM
    Using
    AutoCAD 2011
    Join Date
    Apr 2009
    Location
    The Netherlands
    Posts
    599

    Default Tip: how to prevent the "Save changes to Drawing1.dwg?" message.

    Registered forum members do not see this ad.

    Most of us have encountered the AutoCAD message:

    "Save changes to Drawing1.dwg?"
    Like this:

    1.jpg

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

    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):

    Code:
    (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.

  2. #2
    Super Moderator rkmcswain's Avatar
    Computer Details
    rkmcswain's Computer Details
    Operating System:
    Windows 7 Pro x64
    Motherboard:
    Intel DZ77RE-75K
    CPU:
    i7-3770K 3.50GHz
    RAM:
    32GB
    Graphics:
    Nvidia Quadro 2000
    Primary Storage:
    125GB SSD
    Secondary Storage:
    500GB SATA
    Monitor:
    ASUS 27" / ASUS 24"
    Discipline
    Civil
    Using
    Civil 3D 2013
    Join Date
    Sep 2005
    Location
    Houston
    Posts
    3,633

    Default

    Three other options.

    1. Get rid of all code that modifies the drawing at startup.
    2. Set STARTUP to 1 to open AutoCAD with a startup dialog.
    3. Set STARTUP to 2 (AutoCAD 2012 and later) to open AutoCAD with no drawing loaded.

  3. #3
    Forum Deity BlackBox's Avatar
    Using
    Civil 3D 2011
    Join Date
    Nov 2009
    Posts
    3,940

    Default

    Code:
    ;;;--------------------------------------------------------------------;
    ;;; Load personal settings
    (defun c:LoadPersonalSettings  (/ vars var val)
      (setq vars '(("cmdecho" . 0)
                   ("osmode" . 229)
                   ("orthomode" . 1)
                   ("gridmode" . 0)))
      (foreach v  vars
        (if (/= (setq val (cdr v)) (getvar (setq var (car v))))
          (setvar var val)))
      (princ))
    ;;;--------------------------------------------------------------------;
    ;;; Load personal settings - shortcut
    (defun c:LPS () (c:LoadPersonalSettings))
    ;;;--------------------------------------------------------------------;
    ;;; Conditional load
    (if (= 1 (getvar 'dwgtitled))     ; If drawing is named (i.e., not Drawing1.dwg)
      (c:LPS))                        ; Then load personal settings
    ;;;--------------------------------------------------------------------;
    (princ)                           ; Silent load
    Last edited by BlackBox; 27th Apr 2011 at 07:33 pm.
    "Potential has a shelf life." - Margaret Atwood

  4. #4
    Super Member MarcoW's Avatar
    Computer Details
    MarcoW's Computer Details
    Operating System:
    Microsoft Windows 7 Pro 64-bit
    Computer:
    A black one
    CPU:
    Intel Xeon E5520 Quad Core
    RAM:
    8 GB
    Graphics:
    NVIDIA Quadro FX 580 - 512MB
    Primary Storage:
    300 GB 10000 RPM
    Using
    AutoCAD 2011
    Join Date
    Apr 2009
    Location
    The Netherlands
    Posts
    599

    Default

    Thanks for the replies!

    @ rkmcswain:
    Your suggestions are no option to me: I want AutoCAD to set some variables the way I want.
    None of your suggestions will work the way I would like.
    Thanks anyway for sharing your idea!

    @ RenderMan
    Nice idea but this would mean that a new drawing is not set how I want them.
    So I need to save the file with a decent name and then close / reopen it.
    Thanks also!

    -> Still stick to my approach <-

  5. #5
    Forum Deity BlackBox's Avatar
    Using
    Civil 3D 2011
    Join Date
    Nov 2009
    Posts
    3,940

    Default

    Quote Originally Posted by MarcoW View Post
    Thanks for the replies!

    @ rkmcswain:
    Your suggestions are no option to me: I want AutoCAD to set some variables the way I want.
    None of your suggestions will work the way I would like.
    Thanks anyway for sharing your idea!

    @ RenderMan
    Nice idea but this would mean that a new drawing is not set how I want them.
    So I need to save the file with a decent name and then close / reopen it.
    Thanks also!

    -> Still stick to my approach <-
    Your comments contradict the thread title.

    I'm not sure you understand the point... if you're not going to save Drawing1.dwg (i.e., avoid the "Save" prompt), then don't change the drawing at all.

    Could you not just change the desired System Variables in your Template (.DWT) to avoid -> your approach <- altogether...?
    "Potential has a shelf life." - Margaret Atwood

  6. #6
    Super Member
    Computer Details
    designerstuart's Computer Details
    Operating System:
    xp
    Computer:
    various
    Discipline
    Architectural
    designerstuart's Discipline Details
    Occupation
    architect
    Discipline
    Architectural
    Using
    ADT 2009
    Join Date
    Jun 2010
    Location
    near london, near europe
    Posts
    756

    Default

    thanks marco for this topic, i have been interested in this ever since i started using a lisp to change a load of my variables
    now i am interested to see which method i will use........ let the discussion continue!

  7. #7
    Super Member Dana W's Avatar
    Computer Details
    Dana W's Computer Details
    Operating System:
    Windows 8 64 bit
    Computer:
    Dell XPS ONE 2710
    Motherboard:
    Dunno
    CPU:
    Intel I-5 3330S @ 2.7 Ghz
    RAM:
    6 Gb
    Graphics:
    On board barely adequate
    Primary Storage:
    1 Terrabyte
    Secondary Storage:
    1 Terrabyte external
    Monitor:
    All in one 27" touch & pen
    Discipline
    Construction
    Dana W's Discipline Details
    Occupation
    Independent Architectural Draftsman
    Discipline
    Construction
    Details
    Residential Homes, Construction and Renovation
    Using
    AutoCAD LT 2009
    Join Date
    Feb 2010
    Location
    Chuluota, Florida
    Posts
    1,770

    Default

    Well, in that case...

    Avoid touching the mouse wheel while drawing1.dwg is open. That causes about 99.9% of the cases where AutoCAD thinks you have changed drawing1.dwg. Even an unintentional zoom will set the change flag whether you move back to the original view or not.
    Yogi Berra: "In theory there is no difference between theory and practice. In practice there is."

  8. #8
    Super Member MarcoW's Avatar
    Computer Details
    MarcoW's Computer Details
    Operating System:
    Microsoft Windows 7 Pro 64-bit
    Computer:
    A black one
    CPU:
    Intel Xeon E5520 Quad Core
    RAM:
    8 GB
    Graphics:
    NVIDIA Quadro FX 580 - 512MB
    Primary Storage:
    300 GB 10000 RPM
    Using
    AutoCAD 2011
    Join Date
    Apr 2009
    Location
    The Netherlands
    Posts
    599

    Default

    Quote Originally Posted by RenderMan View Post
    Your comments contradict the thread title.

    I'm not sure you understand the point... if you're not going to save Drawing1.dwg (i.e., avoid the "Save" prompt), then don't change the drawing at all.

    Could you not just change the desired System Variables in your Template (.DWT) to avoid -> your approach <- altogether...?
    What do you mean by "contradict"? I found why AutoCAD propmts for the and wanted to share my solution. It works and suits my situation. And since I do not contribute as much as others do to the forum I thought I'd share this.

    So let me return the question: do you understand the point? If I open an existing AutoCAD drawing by windows explorer then AutoCAD opens an empty drawing and the file I selected in the explorer.

    Without this code it remains and closes only after the prompt. With the code, the drawing1.dwg is closed automatically, I do not even notice it being opened.

    @ DesignerStuart: thanks for your reply. Let's see where this ends. In my case it works just fine!

  9. #9
    Forum Deity BlackBox's Avatar
    Using
    Civil 3D 2011
    Join Date
    Nov 2009
    Posts
    3,940

    Default

    Perhaps I've overlooked something; correct me where I may be wrong.

    Quote Originally Posted by MarcoW View Post
    What do you mean by "contradict"?
    The thread title is "How to prevent the 'Save Changes to Drawing1.dwg' message", and yet advocate changing system variables despite having no desire to save Drawing1.dwg ... this appears (to me) to be a contradiction.

    Why expend effort, only to discard the result?
    (^^ Sun Tzu would not approve ^^)

    If one wants to avoid the "Save Changes to Drawing1.dwg" prompt, the solution is simple... don't make changes prior to opening another, titled drawing.

    If you want to customize the System Variables (in a blank drawing), then the simplest solution is for those changes to be saved to your drawing template (DWT).

    However, not everyone has write-access to their DWT(s). Hence the code I posted... If a titled drawing is opened, one's personal settings are loaded automatically. However, if Drawing1 (a blank drawing) is opened, one's personal settings are not loaded... but it (SomeFunction) is still available to be manually called without the need to save the drawing, close, and re-open.

    I provide my users with a keyboard command for this (Example c:SomeFunction).

    Quote Originally Posted by MarcoW View Post
    I found why AutoCAD propmts for the and wanted to share my solution. It works and suits my situation. And since I do not contribute as much as others do to the forum I thought I'd share this.
    I've not made any attempt to deter you from posting things you feel will help others. Doing so is an admirable pursuit, and appreciated, as designerstuart has already pointed out.

    Quote Originally Posted by MarcoW View Post
    So let me return the question: do you understand the point? If I open an existing AutoCAD drawing by windows explorer then AutoCAD opens an empty drawing and the file I selected in the explorer.

    Without this code it remains and closes only after the prompt. With the code, the drawing1.dwg is closed automatically, I do not even notice it being opened.
    I do not experience this behavior... when I open a drawing from Windows Explorer only that drawing is opened, and not Drawing1.
    "Potential has a shelf life." - Margaret Atwood

  10. #10
    Forum Deity Jack_O'neill's Avatar
    Computer Details
    Jack_O'neill's Computer Details
    Operating System:
    xp
    Discipline
    Architectural
    Jack_O'neill's Discipline Details
    Discipline
    Architectural
    Details
    The bulk of my business is commercial curtainwall, site plans and floor plans. I do occasionally get a bit of tool and die, and the odd house now and again.
    Using
    AutoCAD 2010
    Join Date
    Sep 2008
    Location
    lost in the Arkansas wilderness
    Posts
    2,146

    Default

    Registered forum members do not see this ad.

    Guys...what difference does it make? If you don't want to do it that way, don't do it. I quite often open autocad to do some little something, sometimes just to see if it works, or to recreate a question that someone here has posted and don't save the drawing. Sometimes I do it because of some cryptic file name and the little preview bmp isn't big enough to tell what it is, so I open it to see if its what i'm looking for. If it's not, there is absolutely no reason to save it again.

    Now having said that, being the forgetful old windbag I am, I rely on that very dialog box to keep me from screwing up and either not saving something I should, or saving something I shouldn't.
    Never try to teach a pig to sing. It wastes your time and annoys the pig. -Robert Heinlein

Similar Threads

  1. How to solve "Drawing Recovery" message
    By khoshravan in forum AutoCAD Bugs, Error Messages & Quirks
    Replies: 4
    Last Post: 10th Dec 2010, 08:06 pm
  2. Replies: 0
    Last Post: 15th Nov 2010, 08:30 am
  3. "save" in the file "pull down menu" not working
    By kfarrar in forum Civil 3D & LDD
    Replies: 9
    Last Post: 17th Feb 2010, 06:45 am
  4. AcadMap3D 2010_freezes on "open" or "save" ...
    By Jest in forum AutoCAD Bugs, Error Messages & Quirks
    Replies: 8
    Last Post: 26th Aug 2009, 08:27 am
  5. After command 'copy': "Autocad message: item added" WHY?
    By MarcoW in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 25th Aug 2009, 12:24 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts