(defun C:LED (/ ss ssn i obj liste col)
(vl-load-com)
(setq i -1 n 0 d 0 m 0 col (fix (getreal "\nNew color? ")))
(if (setq ss (ssget))
(repeat (sslength ss)
(setq ssn (ssname ss (setq i (1+ i)))
obj (vlax-ename->vla-object ssn)
liste (cons (cons obj i) liste)
)
)
)
(foreach lt liste
(cond ((eq "AcDbLeader" (vla-get-objectname (setq obj (car lt))))
(setq n (1+ n))
(vla-put-DimensionLineColor obj col)
)
; ((eq "AcDbMText" (vla-get-objectname (setq obj (car lt))))
; (vla-put-color obj col)
; )
; ((eq "AcDbLine" (vla-get-objectname (setq obj (car lt))))
; (vla-put-color obj col)
; )
((eq "AcDbRotatedDimension" (vla-get-objectname (setq obj (car lt))))
(setq d (1+ d))
(vla-put-ExtensionLineColor obj col)
(vla-put-DimensionLineColor obj col)
(vla-put-TextColor obj col)
)
((eq "AcDbMLeader" (vla-get-objectname (setq obj (car lt))))
(setq m (1+ m))
(command "_change" (vlax-vla-object->ename obj) "" "_p" "_c" col "")
)
)
)
(princ (strcat "\nProcessed: \n" (itoa m) " mleaders\n"
(itoa n) " leaders\n"
(itoa d) " dimensions\n"
)
)
(princ)
)

(c:LED)

Advertisements