ダイナミックブロックの値の種類と値を取得
(defun y_dyblklst(
E_NAME
/
V_OBJ
VARPRO
I
V_OBJ_BL
N_LST
DAT
D_LST
)
(setq V_OBJ (vlax-ename->vla-object E_NAME))
(setq VARPRO (vlax-variant-value (vla-GetDynamicBlockProperties V_OBJ)))
(setq I (vlax-safearray-get-l-bound VARPRO 1))
(while I
(setq V_OBJ_BL (vlax-safearray-get-element VARPRO I))
(setq N_LST (append N_LST (list (vla-get-PropertyName V_OBJ_BL))))
(setq DAT (vla-get-value V_OBJ_BL))
(cond
((= 2 (vlax-variant-type DAT))
(setq DAT (vlax-variant-value DAT))
)
((= 5 (vlax-variant-type DAT))
(setq DAT (vlax-variant-value DAT))
)
((= 8 (vlax-variant-type DAT))
(setq DAT (vlax-variant-value DAT))
)
(T
(setq DAT (vlax-safearray->list (vlax-variant-value DAT)))
)
)
(setq D_LST (append D_LST (list DAT)))
(setq I (1+ I))
(if (> I (vlax-safearray-get-u-bound VARPRO 1))
(setq I nil)
)
)
(list N_LST D_LST)
)
(("X 距離" "Y 距離" "Origin" "反転状態" "側溝反転" "ルックアップ")
(77.9525 24.6063 (0.0 0.0 0.0) 1 1 "拝み"))
こんな感じ。
This entry was posted on 木曜日, 1月 25th, 2007, 10:20 PM and is filed under LISP.
You can follow any responses to this entry through RSS 2.0. You can leave a response, or trackback from your own site.