接受程序标识并尝试将其作为进程内服务器加载到 AutoCAD 中。 支持的平台:仅窗口 签名工 务 局: RetVal = object.GetInterfaceObject(ProgID)
言论尽管对象将加载到 AutoCAD 中,但它不会显示在其类型库中。该对象将具有自己的类型库。此方法允许您连接到 ActiveX 自动化服务器。 如果可能,请使用与版本相关的 ProgID。如果方法使用与版本无关的 ProgID,请将该方法更改为使用与版本相关的 ProgID。例如,您将更改为。GetInterfaceObjectAcadLayerStateManagerAcadLayerStateManager.22 例子工 务 局: 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
Visual LISP: (vl-load-com)
(defun c:Example_GetInterfaceObject()
;; This example returns top level object of another application.
(setq acadObj (vlax-get-acad-object))
(setq 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-10-29 08:43
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.