My two cents worth ...
You can check for the status
{code}
Dim isModified As Integer = System.Convert.ToInt32(Application.GetSystemVariable("DBMOD"))
Dim DOC As Document = Application.DocumentManager.MdiActiveDocument
If isModified = 0 Then
doc.CloseAndDiscard()
Else
doc.CloseAndSave(doc.Name)
End If
{code}
Then save and close based on it.
I know you can reset it using lisp.
(acad-push-dbmod)
; stuff
(acad-pop-dbmod)
I would be interested how to do this also.
---------------------------
(defun botsbuildbots() (botsbuildbots))