And your gonna need this one too...
(defun lisp-value (v)
;; Copyright 2002 Vladimir Nesterovsky.
;; Free for use by any commercial entity with
;; less then $100 million annual revenue.
(cond
((= (type v) 'variant)
(lisp-value (variant-value v)))
((= (type v) 'safearray)
(mapcar 'lisp-value (safearray-value v)))
(T v)
)
)
A good way to think of a variable is to think of it as a container of some-sort. Think of a variable as a empty glass that you can add stuff to. Now just imagine that that glass can only contain one type of ..."juice", you need a bunch of diff types of glasses to carry all the diff types of juice you have in your refrigerator. (One glass for orange juice and another for milk.) Now that doesn't sound very efficient --i.e. You would need to know what you're thirsty for before you open the refrigerator but that is how a computer works. They do what they are told and that is it. In other words, a computer cant "Judge for its self" what it needs for a specific task, the programmer has to do it for it, or build a condition into the code. But what happens if you don't really know what your thirsty for until you open the frig and look around a bit? You would need a special glass, one that can hold all sorts of diff types of juice. Well there is a glass like that, its called a variant. This glass is a bit over sized and that makes drinking out of it a bit awkward.
An Array is a different type of container; they allow you to clump a bunch of variables together. A safearray can only be filled by variables that are grouped by a common theme. i.e. strings, doubles, integers, etc. That is why Visual lisp calls them "safe"arrays; you can't accidentally assign values outside the array bounds and cause an error. So when you run, say, the "vlax-3d-point" function you are actually creating a safearray of "X" type and assigning it to a variant to send to the ARX.