Hi all,
I am trying to close current drawing without save and open existing drawing.
I arrived below code.
Public Shared Sub OpenDrawing(ByVal strFileName As String)
Dim acDocMgr As DocumentCollection = Application.DocumentManager
Dim doc As Document = acDocMgr.MdiActiveDocument
Try
If (File.Exists(strFileName)) Then
doc.CloseAndDiscard()
Dim acdoc As Document = acDocMgr.Open(strFileName, False)
acDocMgr.MdiActiveDocument = acdoc
Else
Throw New Exception("File " & strFileName & " does not exist.")
End If
Catch ex As Exception
Throw New Exception("Error occured when open drawing " & strFileName, ex)
End Try
End Sub
But when i calling from
<CommandMethod(.... , i got "Com exception error : Drawing is busy."
So, i tried to open existing drawing and make it current. But after making it current i lost my control over that drawing because my command running on first drawing.
How do i solve this?
![cry :cry:](http://www.theswamp.org/Smileys/black/cry.gif)
Any help / hint greatly appreciated.
Thanks for reading.