Why drawing1.dwg will not close

Generally when you open AutoCAD, your default template is loaded and a drawing named "Drawing1.dwg" is presented to you. If you open a drawing using the OPEN command or using the Sheet Set Manager, the other drawing will open and "drawing1.dwg" will go away.

If you open another drawing and "drawing1.dwg" does not go away, then that means the system variable DBMOD is set to a non-zero value in "drawing1.dwg".

DBMOD is a system variable that tells AutoCAD about the state of the drawing. If it is set to zero, then the drawing in the editor equals the drawing on disk, meaning no changes have been made.

Another side effect of DBMOD not equaling zero in "drawing1.dwg" is that when you go to manually close "drawing1.dwg", you will be prompted to save it.

So how did "drawing1.dwg" get modified if you didn't do anything to it? The answer is almost certainly startup code. Any of the AutoCAD startup files ("acad.lsp", "acaddoc.lsp", *.mnl files, the s::startup function, etc) that execute when a drawing is loaded, may contain code that is modifying the drawing. Even a change to a system variable saved in the drawing will change DBMOD. See the AutoCAD HELP entry on DBMOD for more details.

So what if you want to make changes to the drawing at startup but still avoid this problem? You can "trick" AutoCAD into ignoring the changes by resetting DBMOD to zero. But you can't do this with a setvar statement, because DBMOD is a read-only variable. You have to use some special functions named (acad-push-dbmod) and (acad-push-dbmod). JTB World has a writeup on this process..


All content is copyright © CAD PANACEA 2005-2013 unless otherwise noted and may not be reproduced. All comments posted to this blog are the sole responsibility of the person making the comment.

Google, as a third party vendor, uses cookies to serve ads on this site. Google's use of their cookies enables it to serve ads to users based on their visit to your sites and other sites on the Internet. You may opt out of the use of these cookies by visiting the Google ad and content network privacy policy.

Powered by Drupal