"; error: no function definition: vlax-get-acad-object"
"; error: no function definition: vlax-ename->vla-object"
If you find yourself receiving either of these errors, this is an indication that the ActiveX component of the Visual LISP API has not been loaded prior to running a program which relies on this function library.
The Visual LISP ActiveX functions may be loaded using the (vl-load-com) function.
This function need only be called once per session to ensure the functions are available throughout the drawing session, hence many users will have (vl-load-com) located at the top of their ACADDOC.lsp / ACAD.lsp customisation files so that the expression is automatically evaluated on startup. For this reason, a developer may not notice the omission of this function in their program.
If you are receiving one of the above error messages when running a program, first try adding (vl-load-com) on a new-line at the top of the relevant LISP file.
Example:
Code without (vl-load-com):
(defun c:test ( / )
(vlax-get-acad-object)
(princ)
)
Modified:
(vl-load-com)
(defun c:test ( / )
(vlax-get-acad-object)
(princ)
)
If you still receive either of the above errors after reloading the program equipped with (vl-load-com) consider performing a repair or reinstallation of your AutoCAD software, as the Visual LISP ActiveX component can occasionally become corrupted following the installation of an AutoCAD patch.
If you are still stuck, search the forums or FAQ for more help.