File name

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi to all.
I'm trying to save two drawings sequentially with the following code:
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.Runtime
Public Class Class1
<CommandMethod("SaveTwoDrawings")> _
Public Sub SaveTwoDrawings()
Dim doc As Document
Dim strDWGName As String
Dim acDocMgr As DocumentCollection = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager
Dim obj As Object
doc = acDocMgr(0)
strDWGName = doc.Name
strDWGName = "c:\MyDrawing#1.dwg"
doc.Database.SaveAs(strDWGName, True, DwgVersion.Current, doc.Database.SecurityParameters)
doc = acDocMgr(1)
strDWGName = doc.Name
strDWGName = "c:\MyDrawing#2.dwg"
doc.Database.SaveAs(strDWGName, True, DwgVersion.Current, doc.Database.SecurityParameters)
End Sub
End Class
While the two drawings are correctly saved in the desired position whith the desired names, only the name of the last drawing is updated ("Drawing2.dwg"--->"MyDrawing#2.dwg"), but the name of the first drawing still remains the original assigned by autocad "Drawing1.dwg", the autocad title bar is not updated too.
Some suggestions?
Thanks