Valued Mentor
Posts: 354
Registered: ‎01-27-2010
Message 1 of 4 (158 Views)
Accepted Solution

How to check if a drawving is saved

158 Views, 3 Replies
01-23-2014 03:30 AM

Hi all.

i want to check if my file is saved or not. (already named). I need to do this for launch the command "-etransmit"


but i dont know how to do that.

No global var and found nothing here.


Thanks for your help.

Valued Mentor
Posts: 379
Registered: ‎04-11-2010
Message 2 of 4 (142 Views)

Re: How to check if a drawving is saved

01-23-2014 05:50 AM in reply to: AubelecBE



I think a combination of "DWGTITLED" and "DBMOD" system variables  should provide you the information needed to etransmit or to not etransmit.


Gaston Nunez

Posts: 221
Registered: ‎11-09-2012
Message 3 of 4 (126 Views)

Re: How to check if a drawving is saved

01-23-2014 08:07 AM in reply to: AubelecBE

If you check 'DBMOD' system variable, you can get the drawing modification status. Below is the sample code to check if drawing has been saved or not.


Imports Autodesk.AutoCAD.ApplicationServices 
Imports Autodesk.AutoCAD.DatabaseServices 
Imports Autodesk.AutoCAD.Runtime 
<CommandMethod("DrawingSaved")> _ 
Public Sub DrawingSaved() 
Dim obj As Object = Application.GetSystemVariable("DBMOD") 
'' Check the value of DBMOD, if 0 then the drawing has not been changed 
If Not (System.Convert.ToInt16(obj) = 0) Then 
If MsgBox("Do you wish to save this drawing?", _                 
MsgBoxStyle.YesNo, _
"Save Drawing") = MsgBoxResult.Yes Then Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
acDoc.Database.SaveAs(acDoc.Name, True, DwgVersion.Current, _
acDoc.Database.SecurityParameters) End If End If End Sub


You can find details about DBMOD variable in below location:



Valued Mentor
Posts: 354
Registered: ‎01-27-2010
Message 4 of 4 (92 Views)

Re: How to check if a drawving is saved

01-24-2014 03:20 AM in reply to: mzakiralam

Thanks, work fine.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community