Accepts a program ID and attempts to load it into AutoCAD as an in-process server.
Supported platforms: AutoCAD for Windows only; not supported in AutoCAD LT for Windows
Signature
VBA:
RetVal = object.GetInterfaceObject(ProgID)
- object
-
Type: Application
The object this method applies to.
- ProgID
-
Access: Input-only
Type: String
The program ID of the interface object to return.
Remarks
Although the object will be loaded into AutoCAD, it will not show up in its type library. The object will have its own type library. This method lets you connect to an ActiveX Automation server.
If possible, use version-dependent ProgIDs. If a GetInterfaceObject method uses a version-independent ProgID, change the method to use a version-dependent ProgID. For example, you would change AcadLayerStateManager to AutoCAD.AcadLayerStateManager.25.
Examples
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
Visual 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))) ) )