Archive for category LISP
テーブルの余白
in LISP on 2007/02/26
(setq OBJ (vlax-ename->vla-object (car (entsel))))
(vlax-put-property OBJ ‘VertCellMargin (getint))
(vlax-put-property OBJ ‘HorzCellMargin (getint))
テーブルの幅と高さ
in LISP on 2007/02/25
全てのセルの幅と高さを指定
(setq OBJ (vlax-ename->vla-object (car (entsel))))
(vlax-put-property OBJ ‘RowHeight (getint))
(vlax-put-property OBJ ‘ColumnWidth (getint))
ダイナミックブロックの値
in LISP on 2007/01/25
ダイナミックブロックの値の種類と値を取得 (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 "拝み")) こんな感じ。
画層の説明を取得
in LISP on 2006/12/06
;;画層の説明を取得 (defun y_layer_des( L_NAM ;画層名 / OBJ ) (setq OBJ (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)) ) ) (setq OBJ (vlax-invoke-method OBJ 'Item L_NAM)) (vlax-get-property OBJ 'Description) )
画層のリスト VLISP版
in LISP on 2006/12/05
;;画層のリスト VLISP版 (defun y_layerlist_v (/ LA LST) (vlax-for LA (vla-get-layers (vla-get-activedocument (vlax-get-acad-object) ) ) (setq LST (cons (vla-get-name LA) LST)) ) (acad_strlsort (mapcar 'strcase (reverse LST))) )