向数组中添加元素 支持的平台:仅窗口 签名(vlax-safearray-put-element var index ... value)
返回值类型:整数、实数、字符串、VLA 对象、安全数组、变体、T 或 nil 分配给元素的值。 例子创建一个由双精度组成的一维数组: (setq point (vlax-make-safearray vlax-vbDouble '(0 . 2))) #<safearray...> 用于填充数组:vlax-safearray-put-element (vlax-safearray-put-element point 0 100) 100 (vlax-safearray-put-element point 1 100) 100 (vlax-safearray-put-element point 2 0) 0 创建一个由字符串组成的二维数组: (setq matrix (vlax-make-safearray vlax-vbString '(1 . 2) '(1 . 2) )) #<safearray...> 用于填充数组:vlax-safearray-put-element (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" 请注意,您还可以使用 thefunction 填充数组。以下函数调用完成与 threecall 相同的任务:vlax-safearray-fillvlax-safearray-put-element (vlax-safearray-fill matrix '(("a" "b") ("c" "d"))) #<safearray...> |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2024-12-15 15:01
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.