怎样将VB与AutoCAD连接起来
怎样将VB与AutoCAD连接起来?我 想用一个按钮,编写代码后,点击按钮后,自动打开AutoCAD
请大家帮帮忙吧,谢了 <FONT face=宋体 size=2>自己搜索一下,一大堆。。。</FONT> 示例一:从Visual Basic 连接到AutoCAD <BR>
Sub ConnectToAcad()<BR>Dim acadApp As AcadApplication<BR>On Error Resume Next<BR>Set acadApp = GetObject(, "AutoCAD.Application")<BR>If Err Then<BR>Err.Clear<BR>Set acadApp = CreateObject("AutoCAD.Application")<BR>If Err Then<BR>MsgBox Err.Description<BR>Exit Sub<BR>End If<BR>End If<BR>MsgBox "Now running " + acadApp.Name + _<BR>" version " + acadApp.Version<BR>End Sub <FONT color=#0909f7>楼上</FONT>,有一步你没跟人家说清楚哟:
<FONT color=#ff0066>VB模式-->"工程"-->"引用"-->选中"AutoCAD 2004 Type Library"项-->确定</FONT>
呵呵呵.....
洋葱老爹发表于2004-6-29 15:30:00static/image/common/back.gif楼上,有一步你没跟人家说清楚哟:
VB模式-->\"工程\"-->\"引用\"-->选中\"AutoCAD 2004 Type Library...
太棒了!<BR></FONT>
页:
[1]