Author Topic: Is active drawing new?[Solved]  (Read 1900 times)

0 Members and 1 Guest are viewing this topic.

shers

  • Guest
Is active drawing new?[Solved]
« on: June 27, 2015, 09:56:16 AM »
Hi,

How can I check if the active drawing is new or empty?

Thanks
« Last Edit: June 30, 2015, 01:32:37 PM by sresh »

Keith Brown

  • Swamp Rat
  • Posts: 601
Re: Is active drawing new?
« Reply #1 on: June 27, 2015, 10:08:08 AM »
You can check the DBMOD and DWGTITLED system variables to see if the drawing has been named and/or needs saving.

DBMOD (System Variable)
Indicates the drawing modification status.
(Read-only)

Type:   Integer
Saved in:   Not-saved
Initial value:   0
The setting is stored as a bitcode using the sum of the following values:

1   Object database modified
4   Database variable modified
8   Window modified
16   View modified
32   Field modified

The DBMOD value is reset to 0 when you save the drawing.

DWGTITLED (System Variable)
Indicates whether the current drawing has been named.
(Read-only)

Type:   Integer
Saved in:   Not-saved
Initial value:   0

0   Drawing has not been named
1   Drawing has been named
Keith Brown | AutoCAD MEP Blog | RSS Feed
AutoCAD MEP 2014 / Revit MEP 2014 / EastCoast CAD/CAM addon / Visual Studio 2013

shers

  • Guest
Re: Is active drawing new?
« Reply #2 on: June 30, 2015, 01:32:21 PM »
That worked! Thanks very much! :)