AutoCAD2002与visual basic 6.0如何连接?
AutoCAD2000和visual basic的连接书上有,可我的是2002的,用那个程序不好用,不知道怎么连接了,请大家帮帮忙,谢谢 <p>与版本无关。</p><p>给段程序理解一下。</p><p>On Error Resume Next<br/>Set obj_Acad = GetObject(, "autocad.application")<br/>If Err Then<br/> Err.Clear<br/> On Error Resume Next<br/> Set obj_Acad = CreateObject("autocad.application")<br/> If Err Then<br/> Err.Clear<br/> MsgBox "不能运行AutoCAD,请检查是否安装!", vbOKCancel, "警告!"<br/> Exit Function<br/> End If<br/>End If<br/>obj_Acad.Visible = True<br/>Set obj_Doc = obj_Acad.ActiveDocument<br/>Set obj_ModelSpace = obj_Doc.ModelSpace<br/>'MsgBox "运行结束!", vbOKOnly, "工程1!"<br/>boo = True</p><p></p> <p>好用,谢谢!</p><p>Exit Sub应该是</p><p>不是Exit Function</p>
页:
[1]