.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to check if a drawving is saved

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
AubelecBE
1347 Views, 3 Replies

How to check if a drawving is saved

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.

3 REPLIES 3
Message 2 of 4
hgasty1001
in reply to: AubelecBE

Hi,

 

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

 

Gaston Nunez

Message 3 of 4
mzakiralam
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:

http://exchange.autodesk.com/autocad/enu/online-help/search#WS1a9193826455f5ffa23ce210c4a30acaf-50a8...

 

Message 4 of 4
AubelecBE
in reply to: mzakiralam

Thanks, work fine.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost