yuanhui_hust 发表于 2011-6-16 14:35:58

VB打开AutoCAD图纸的问题

Dim AcadApp As AcadApplication
    Dim AcadDoc As AutoCAD.AcadDocument
   
    On Error Resume Next
    Set AcadApp = GetObject(, "AutoCAD.Application")
   
    If Err.Number <> 0 Then
    Err.Clear
    Set AcadApp = CreateObject("AutoCAD.Application")
   
    End If
    AcadApp.Visible = True
    Set AcadDoc = AcadApp.Documents.Open("E:\气缸定位具.dwg")

createobject 的情况下AutoCAD启动了但是没打开图纸,大伙看看是什么原因?

getobject的情况下可以打开图纸的

conqibo 发表于 2011-7-17 20:13:13

回复 yuanhui_hust 的帖子

    Dim AcadApp As AcadApplication
    Dim AcadDoc As AutoCAD.AcadDocument
   
    On Error Resume Next
    Set AcadApp = CreateObject(, "AutoCAD.Application")
      AcadApp.Visible = True
    Set AcadDoc = AcadApp.Documents.Open("E:\气缸定位具.dwg")
   Set acaddoc = acadapp.ActiveDocument
页: [1]
查看完整版本: VB打开AutoCAD图纸的问题