Creates a safearray
(vlax-make-safearray type '(l-bound . u-bound) ['(l-bound . u-bound)...)]
A maximum of 16 dimensions can be defined for an array. The elements in the array are initialized as follows:
- type
-
The type of safearray. Specify one of the following constants:
vlax-vbSingle (4) Single-precision floating-point number
vlax-vbDouble (5) Double-precision floating-point number
The integer shown in parentheses indicates the value to which the constant evaluates. It is recommended that you specify the constant in your argument, not the integer value, in case the value changes in later releases of AutoCAD.
- '(l-bound . u-bound)
Create a single-dimension safearray consisting of doubles, beginning with index 0:
_$ (setq point (vlax-make-safearray vlax-vbDouble '(0 . 3)))
#<safearray...>
Use the vlax-safearray->list function to display the contents of the safearray as a list:
_$ (vlax-safearray->list point)
(0.0 0.0 0.0 0.0)
The result shows each element of the array was initialized to zero.
Create a two-dimension array of strings, with each dimension starting at index 1:
_$ (setq matrix (vlax-make-safearray vlax-vbString '(1 . 2) '(1 . 2) ))
#<safearray...>
-
The vlax-make-variant, vlax-safearray-fill, vlax-safearray-get-dim, vlax-safearray-get-element, vlax-safearray-get-l-bound, vlax-safearray-get-u-bound, vlax-safearray-put-element, vlax-safearray-type, vlax-safearray->list, and vlax-variant-value functions. For more information on using these functions, see
Working with Safearrays in the AutoLISP Developer's Guide.