liub1979 发表于 2004-11-16 20:27:00

同时开着两个AutoCAD时,VB如何处理 @_@!

Ifis running, the GetObject function will retrieve the current AutoCAD Application object. When running multiple sessions of AutoCAD, the GetObject function will return the first instance of AutoCAD in the Windows Running Object Table. See the Microsoft Visual Basic documentation for the Running Object Table (ROT) and the GetObject function (for more information about verifying the session returned by GetObject).
我的问题是如何在running multiple sessions of AutoCAD时得到当前的 AutoCAD
而不是the first instance of AutoCAD in the Windows Running Object Table
还请各位帮忙指点迷津,我先谢谢大家了!!!
我的VB调用AutoCAD 方法如下
Function GetAcadApp()
                       Dim AcadApp As Object '定义一个对象
                       On Error Resume Next
                       Set GetAcadApp = GetObject(, "AutoCAD.Application")
                       If Err Then '如果没有一个AutoCAD副本在运行
                       Err.Clear
                       Set GetAcadApp = CreateObject("AutoCAD.Application")
                       AcadApp.Visable = True '启动一个AutoCAD副本并设为可见
                       If Err Then
                       MsgBox Err.Description '如果失败,给出错误提示
                       Exit Function
                       End If
                       End If
End Function

liub1979 发表于 2004-11-17 12:45:00

没有办法么......

yicol 发表于 2004-11-17 16:25:00

不明白什么意思
页: [1]
查看完整版本: 同时开着两个AutoCAD时,VB如何处理 @_@!