GetInterfaceObject 方法 (ActiveX)
接受程序 ID 并尝试将其作为进程内服务器加载到 AutoCAD 中。 支持的平台:仅限 AutoCAD for Windows;AutoCAD LT for Windows 不支持 签名VBA: RetVal = object.GetInterfaceObject(ProgID)
言论尽管对象将加载到 AutoCAD 中,但它不会显示在其类型库中。该对象将具有自己的类型库。此方法允许您连接到 ActiveX 自动化服务器。 如果可能,请使用与版本相关的 ProgID。如果方法使用与版本无关的 ProgID,请将该方法更改为使用与版本相关的 ProgID。例如,您可以更改为 .GetInterfaceObjectAcadLayerStateManagerAutoCAD.AcadLayerStateManager.24 例子VBA: Sub Example_GetInterfaceObject() ' This example returns top level object of another application. On Error GoTo ERRORHANDLER Dim poly As Object Set poly = ThisDrawing.Application.GetInterfaceObject("Polycad.Application") ERRORHANDLER: MsgBox Err.Description, , "GetInterfaceObject Example" End Sub 可视化 LISP: (vl-load-com) (defun c:Example_GetInterfaceObject() ;; This example returns top level object of another application. (setq acadObj (vlax-get-acad-object) doc (vla-get-ActiveDocument acadObj)) (setq poly (vl-catch-all-apply 'vla-GetInterfaceObject (list acadObj "Polycad.Application"))) (if (= (type poly)'VL-CATCH-ALL-APPLY-ERROR) (alert (strcat "Error occured: \n" (vl-catch-all-error-message poly))) ) ) |
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-3-14 06:48
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.