- (Defun Clr2Lyr_B (x y / ss)
- (if (setq ss (ssget "X" (list (cons 8 x) (cons 62 (car y)))))
- (command "Chprop" ss "" "LA" (last y) "")
- )
- )
- ;;; cLst ==>'("A" (1 "C") (2 "D") (3 "E"))
- (Defun Clr2Lyr_A (cLst)
- (setq lyr (car cLst))
- (foreach ele (cdr cLst)
- (Clr2Lyr_B Lyr ele)
- )
- )
- (Defun Clr2Lyr ()
- ;;; 第一步:新建图层CDEFGH(如图中有就不用建了,这步可有可无)
- ;;; 可直接安插 设定好图层的Dwg
-
- (mapcar 'Clr2Lyr_A
- (list
- (list
- "A"
- (list 1 "C")
- (list 2 "D")
- (list 3 "E")
- ) ; '("A" (1 "C") (2 "D") (3 "E"))
-
- (list
- "B"
- (list 1 "F")
- (list 2 "G")
- (list 3 "H")
- )
- ;; 续加....
- )
- )
- )
|