DBMOD Systemvariable Changed event??

DBMOD Systemvariable Changed event??

Anonymous
Not applicable
869 Views
3 Replies
Message 1 of 4

DBMOD Systemvariable Changed event??

Anonymous
Not applicable
Hi there,

I'm trying to retrieve the DBMOD system variable change...
No luck however.

I retrieve the variable with:
Application.GetSystemVariable("DBMOD")
But after retrieval (when a document has become active) i want my application to know if a document was changed. So the user can see what documents need saving (Tabs on a Palette)

I Tried a Handler to the SystemVariableChanged event of the Application, but it doesn't contain or raises the event (I do see that events are raised, so the event works.)

Does anybody know where (and if) the DBMOD variable is raised as a event if changed?
Or maybe how to see if the document was changed (maybe use the "ObjectModified" event of the database?, and reset a variable on a save....??


ps. The database systemvariablechanged doesn't raise it either!
0 Likes
870 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Not all system variables are supported by the event.

Why not just check the value in the handler of an event that fires routinely, and if non-zero, then act?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5856932@discussion.autodesk.com...
Hi there,

I'm trying to retrieve the DBMOD system variable change...
No luck however.

I retrieve the variable with:
Application.GetSystemVariable("DBMOD")
But after retrieval (when a document has become active) i want my application to know if a document was changed. So the user can see what documents need saving (Tabs on a Palette)

I Tried a Handler to the SystemVariableChanged event of the Application, but it doesn't contain or raises the event (I do see that events are raised, so the event works.)

Does anybody know where (and if) the DBMOD variable is raised as a event if changed?
Or maybe how to see if the document was changed (maybe use the "ObjectModified" event of the database?, and reset a variable on a save....??


ps. The database systemvariablechanged doesn't raise it either!
0 Likes
Message 3 of 4

Anonymous
Not applicable
I have a declaration of the variable in a module and a public sub that I call at the end of my routines that updates the status bar of my form, it's simple and harmless. In particular tools I have implemented also the other values of "dbmod", but it was specific for certain applications.

Friend myDBMOD As Integer 'Current Drawing Saved Status
'0=Drawing Saved 1=Object database modified 4=Database variable modified
'8=Window modified 16=View modified 32=Field modified


Sub UpdDwgStatus()
myDBMOD = Autodesk.AutoCAD.ApplicationServices.Application.GetSystemVariable("dbmod")
With frmMain.GTA_StripStatusFile
' frmMain.GTA_StripStatusFile is the StatusStripControl
Dim f As New System.Drawing.Font("Tahoma", 8.25)
.Font = f
If myDBMOD = 0 Then
.Text = "Saved"
.ForeColor = Drawing.Color.Green
.Font = New System.Drawing.Font(.Font, Drawing.FontStyle.Regular)
Else
.Text = "Not Saved"
.ForeColor = Drawing.Color.Red
.Font = New System.Drawing.Font(.Font, Drawing.FontStyle.Bold)
End If
End With

End Sub ' Updates StatusBar with Current Drawing Status

Sorry for the formatting, I just did a copy/past and added a few comments.

René
0 Likes
Message 4 of 4

Anonymous
Not applicable
Thanks Tony,

- I'll guess for now I'll set the property IsChanged of my custom per-document class to True if a ObjectModified event happens.
- on creation of the document I'll retrieve the DBMOD
- If as "Save" command ends I'll re-check the DBMOD variable, if 0 I'll set the IsChanged to false.

A Caddie.
0 Likes