新建文件
<div class="t_msgfont" id="postmessage_2847">我用下面的方法实现了新建一个db ,然后在这个新建的db上画圆,你看一下是否可行,有没有 没有被发现的潜在错误?<br/><br/> <CommandMethod("startCAD")> _<br/> Sub StartCAD()<br/> Try<br/> Dim cadApp As AcadApplication = GetObject(, "AutoCAD.Application.17")<br/> Dim olDb As Database = HostApplicationServices.WorkingDatabase<br/> Dim db As Database = New Database(True, False)<br/> HostApplicationServices.WorkingDatabase = db<br/> Dim trans As Transaction = db.TransactionManager.StartTransaction()<br/> Dim bt As BlockTable = trans.GetObject(db.BlockTableId, OpenMode.ForWrite)<br/> Dim br As Circle = CreateCircle(db, bt)<br/> db.SaveAs("d:\ff.dwg", DwgVersion.AC1015)<br/> HostApplicationServices.WorkingDatabase = olDb<br/> trans.Commit()<br/> trans.Dispose()<br/> Dim cadDoc As AcadDocument = cadApp.Documents.Open("d:\ff.dwg")<br/> cadDoc.WindowState = Common.AcWindowState.acMax<br/> cadDoc.Application.ZoomExtents()<br/> Catch ex As Exception<br/><br/> End Try<br/> End Sub<br/><br/> Dim db As Database = New Database(True, False)这一句的true 和false 是否正确<br/><br/> db.SaveAs("d:\ff.dwg", DwgVersion.AC1015) 这一句的DwgVersion.AC1015是否正确?<br/><br/>为什么在com中新建的文件会直接显示出来?arx中新建的db还要再专门打开?</div>
页:
[1]