mayuezxl 发表于 2005-9-6 15:32:00

如何用vb打开cad?

明总,请问,用vb如何打开磁盘上已经存在的cad文件?谢谢

alin 发表于 2005-9-7 21:10:00

<P>'对于2004,修改一下帮助里的例程有</P>
<P>Sub Ch2_ConnectToAcad()<BR>&nbsp;&nbsp;&nbsp; Dim acadApp As AcadApplication<BR>&nbsp;&nbsp;&nbsp; On Error Resume Next<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; Set acadApp = GetObject(, "AutoCAD.Application.16")<BR>&nbsp;&nbsp;&nbsp; If Err Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Err.Clear<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set acadApp = CreateObject("AutoCAD.Application.16")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Err Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MsgBox Err.Description<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exit Sub<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<BR>&nbsp;&nbsp;&nbsp; End If<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp; Dim acadDoc As AcadDocument<BR>&nbsp;&nbsp;&nbsp;&nbsp; Set acadDoc = acadApp.Documents.Open("F:\ALIN\3000091_siteplan.dwg")<BR>End Sub</P>

mayuezxl 发表于 2005-9-8 10:48:00

<P>实在太感谢版主了,在这里我对你致以最高的谢意。</P>
<P>我刚开始用vb和vba操作cad,有好多问题,不知道该看哪方面的书,我的mail是<A href="mailto:mayuezxl@163.com" target="_blank" >mayuezxl@163.com</A> ,方便的话指点我一下,谢谢。</P>

tjdxtm 发表于 2005-9-9 16:47:00

多查查这里以前的帖子。会有收获的。
页: [1]
查看完整版本: 如何用vb打开cad?