AfraLisp Blog

The AutoLisp/Visual Lisp/VBA Resource Website

AfraLisp Blog

Home Newsletter Utter Rubbish Coding Tips AutoCAD Tips Contact Downloads WAUN


ARX Applications


When using certain AutoCAD commands in AutoLISP that are called from ARX applications (for example, ROTATE3D and MIRROR3D), the following error message is displayed:

UNKNOWN Command

This error occurs because the ARX application was not already loaded into memory. To work around this you must first determine what ARX application the command is from. 

The following example AutoLISP routine uses the ROTATE3D command and determines if the associated ARX application is loaded, and loads the application if it is not already loaded.

;;Start AutoLISP code

(defun c:drawsyl ( / acadObject Arxlist strArx)
(vl-load-com)
(setq acadObject (vlax-get-acad-object))
(setq Arxlist (vla-listarx acadObject))
(setq strArx (vlax-safearray->list (vlax-variant-value arxlist)))
	(if (= (member '"geom3d.arx" strArx) nil)
		(arxload "geom3d.arx")
	);if
(command "cylinder" "0,0,0" "5" "20")
(command "rotate3d" "last" "" "x" "0,0,0" "19")
(princ)
);defun
(princ)

;;End AutoLISP code
The AutoLisp/Visual Lisp/VBA Resource Website

Copyright © 1999-Perpetuity by AfraLisp

All rights reserved.
Information in this document is subject to change without notice.
Site created and maintained by Kenny Ramage

The AutoLisp/Visual Lisp/VBA Resource Website