(defun c:dc (/ st n len a1 a2 a3 color ss)
(setq st (ssget '((0 . "DIMENSION")))
ss (ssadd))
(if (/= st nil)
(progn
(setq n 0)
(setq len (sslength st))
(repeat len
(setq a1 (ssname st n)
a2 (entget a1)
a3 (cdr (assoc 1 a2)) )
(if (/= a3 "")
(ssadd a1 ss) )
(setq n (1+ n)))
(setq len (sslength ss))
(if (/= len 0)
(progn
(setq len (itoa len))
(princ (strcat "\n*** " len " 尺寸需改变颜色 ***"))
(setq color(getstring "\n-->请选取改变颜色类别:
1红色、2黄色、3绿色、4蓝绿色、5蓝色、6红紫色、
7白色或其它颜色:"))
(if (= color "") (setq color "bylayer"))
(command "change" ss "" "p" "c" color ""))