Hello,
I would like to have a sub that gets the drawing name, saves it, closes the drawing, then re-opens it (because of a 2010 bug).
This is what I have, but from what I've read I need to have "commandflags.session" to work outside of the drawing. How would I use it for this sub? All I've seen is the commandflags.session included in the CommandMethod.
This code is in a sub, in a Module. The only CommandMethod I have is the command I use to start the code in the "Class" module. I tried putting it in that command, but it didn't work.
' This will save the current drawing, close the drawing, then re-open it
Public Sub SaveCloseOpenDwg()
Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
Dim acDocMgr As DocumentCollection = Application.DocumentManager
Dim strDWGName As String = acDoc.Name
' Save the active drawing
acDoc.Database.SaveAs(strDWGName, True, DwgVersion.Current, acDoc.Database.SecurityParameters)
acDocMgr.CloseAll()
acDocMgr.Open(strDWGName, False)
End Sub
Thanks