用vb 和 vb.net 进行CAD二次开发有什么区别?
<p>用vb 和 vb.net 进行CAD二次开发有什么区别?</p> Public Sub NewDwg()<br/> Dim acadDoc As Autodesk.AutoCAD.Interop.AcadDocument '连接CAD文档<br/> Dim acadapp As Autodesk.AutoCAD.Interop.AcadApplication '连接CAD环境<br/> ' 连接至 AutoCAD 应用程序<br/> Try<br/> ' 可能导致异常的代码<br/> acadapp = GetObject(, "AutoCAD.Application.17")<br/> Catch<br/> ' 当异常发生时处理异常的代码<br/> Err.Clear()<br/> Try<br/> acadapp = CreateObject("AutoCAD.Application.17")<br/> Catch<br/> MsgBox(Err.Description)<br/> Exit Sub<br/> End Try<br/> Finally<br/> ' 清理现场<br/> End Try<br/> ' 连接至 AutoCAD 图形<br/> acadDoc = acadapp.ActiveDocument<br/> acadapp.Visible = True<br/> '==========================================================<br/> '新建Dwg文件<br/> Try<br/> acadDoc = acadapp.Application.Documents.Add<br/> acadDoc.SaveAs("f:\houlinbo.dwg")<br/> 'acadDoc.Close()<br/> 'acadDoc.Application.Documents.Open("f:\houlinbo.dwg", False)<br/> Catch<br/> End Try<br/> End Sub
页:
[1]