backarmy 发表于 2005-4-27 15:51:00

为何连接不上cad?望赐教~!

我用的是XP系统,VB6.0和AUTOCAD2005,为何用VB连接不上CAD,望赐教,谢过先!


Public acadApp As AcadApplication<BR>Public acadDoc As Object<BR>Public moSpace As Object<BR>Public paSpace As Object


Sub main()


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>Set acadDoc = acadApp.ActiveDocument<BR>Set moSpace = acadDoc.ModelSpace<BR>Set paSpace = acadDoc.PaperSpace<BR>acadApp.Visible = acTrue<BR>Form1.Show


End Sub<BR>下面是我相关图片:


bland 发表于 2005-4-28 06:28:00

Set acadApp = GetObject(, "AutoCAD.Application")加版本如何那?


Set acadApp = GetObject(, "AutoCAD.Application.16.2")<BR><BR>

backarmy 发表于 2005-4-29 13:43:00

不行啊,老大!


斑竹呢?快说说,急用!

雪山飞狐_lzh 发表于 2005-4-29 20:40:00

Set acadApp = GetObject(, "AutoCAD.Application.16")

backarmy 发表于 2005-4-30 11:25:00

好的,谢谢!
页: [1]
查看完整版本: 为何连接不上cad?望赐教~!