About Accessing External ObjectARX Functions from a Separate-Namespace VLX (Visual LISP IDE)

Functions defined in external ObjectARX applications can be accessed from a separate-namespace VLX, but you must first issue vl-arx-import to import the function.

Note: The Visual LISP IDE is available on Windows only.

ObjectARX functions are identified as the data type EXRXSUBR. For example, the following example identifies startapp as an external ObjectARX function:

Command: (type startapp)

EXRXSUBR

The following function works correctly if loaded from an AutoLISP file:

(vl-doc-export 'StartApp2)
(vl-load-com)
(defun StartApp2 ()
   (setq acadApp (vlax-get-acad-object))
   (setq acadDoc (vla-Get-ActiveDocument acadApp))
   (setq acadPrefs (vla-Get-Preferences acadApp))
   (setq acadPrefFiles (vla-get-Files acadPrefs))
   (setq hlpFile (vla-Get-HelpFilePath acadPrefFiles))
   (startapp "winhlp32" hlpFile)
   (princ)
)
(princ "\nStartApp2 is loaded, Type (StartApp2) to Run.")
(princ)

However, if you compile StartApp2 as a separate-namespace VLX and try to call the function, it fails with the following error message:

"no function definition: STARTAPP"

To correct this, import startapp using the vl-arx-import function, as shown in the following revised code:

(vl-doc-export 'StartApp2)
(vl-load-com)
(vl-arx-import 'startapp)
(defun StartApp2 ()
   (setq acadApp (vlax-get-acad-object)
)