;;將塊中帶屬性的文字的顏色進行修改
(defun C:TTT (/ SS N)
(setq SS (ssget '((0 . "INSERT") (66 . 1)))
N 0
)
(if SS
(repeat (sslength SS)
(RIB (ssname SS N) 5)
(setq N (1+ N))
)
)
(command "_.regen")
(princ)
)
;;;我在菜鳥時期e2002版主提供給我的(有關讀取塊中"attrib"物件)
;;;----------------------------------------------------------------
(defun RIB (EN COL / ATTRIB-OBJECT-ARRAY ATTRIB-OHJECT-LIST N OB)
(setq OB (vlax-ename->vla-object EN))
(if (and (= (vla-get-objectname OB) "AcDbBlockReference")
(= (vla-get-hasattributes OB) :vlax-true)
)
(progn
(setq ATTRIB-OBJECT-ARRAY
(vlax-variant-value
(vla-getattributes OB)
)
ATTRIB-OBJECT-LIST
(vlax-safearray->list
ATTRIB-OBJECT-ARRAY
)
)
(setq N 0)
(repeat (length ATTRIB-OBJECT-LIST)
(vla-put-color (nth N ATTRIB-OBJECT-LIST) COL)
(setq N (1+ N))
)
)
)
)
;;;----------------------------------------------------------------|;
|