Dim sFullFileName As String = "e:\giri\a.dwg"
Dim doc As Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument
Dim db As Database = doc.Database 'Autodesk.AutoCAD.DatabaseServices.HostApplicationServices.WorkingDatabase
Try
Dim strDWGName As String = doc.Name
Dim obj As Object = Autodesk.AutoCAD.ApplicationServices.Application.GetSystemVariable("DWGTITLED")
If System.Convert.ToInt16(obj) = 0 Then
db.SaveAs(sFullFileName, True, DwgVersion.Current, doc.Database.SecurityParameters)
else
db.save()
End If
Return True
Catch ex As Exception
Return False
End Try
执行上述存盘程序后,出现如下提示:
内部错误: !dbobji.cpp@7319 eNot Open For Write
然后AutoCAD2012异常退出。磁盘目录里留下一个sav9620.tmp文件。