vlax-safearray->list

AutoCad AutoLISP Functions

 
vlax-safearray->list
 
 
 

Returns the elements of a safearray in list form

(vlax-safearray->list var)

Arguments

var

A variable containing a safearray.

Return Values

A list.

Examples

Create a single-dimension array of doubles:

_$ (setq point (vlax-make-safearray
vlax-vbDouble '(0 . 2)))
#<safearray...>

Use vlax-safearray-put-element to populate the array:

_$ (vlax-safearray-put-element
point 0 100)
100
_$ (vlax-safearray-put-element
point 1 100)
100
_$ (vlax-safearray-put-element
point 2 0)
0

Convert the array to a list:

_$ (setq pointlist (vlax-safearray->list
point))
(100.0 100.0 0.0)

The following example demonstrates how a two-dimension array of strings is displayed by vlax-safearray->list:

_$ (vlax-safearray->list
matrix)
(("a" "b") ("c" "d"))