Adds an element to an array
(vlax-safearray-put-element var index... value)
The value assigned to the element.
Create a single-dimension array consisting 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
Create a two-dimension array consisting of strings:
_$ (setq matrix (vlax-make-safearray vlax-vbString '(1 . 2) '(1 . 2) ))
#<safearray...>
Use vlax-safearray-put-element to populate the array:
_$ (vlax-safearray-put-element matrix 1 1 "a")
"a"
_$ (vlax-safearray-put-element matrix 1 2 "b")
"b"
_$ (vlax-safearray-put-element matrix 2 1 "c")
"c"
_$ (vlax-safearray-put-element matrix 2 2 "d")
"d"
Note that you can also populate arrays using the vlax-safearray-fill function. The following function call accomplishes the same task as three vlax-safearray-put-element calls:
(vlax-safearray-fill matrix '(("a" "b") ("c" "d")))
See Also
-
The vlax-safearray-get-element, vlax-safearray-fill, and vlax-safearray-type functions.