图层数量不能超过256
- (defun c:tt(/ ss i col aobj b e )
- (vl-load-com)
- (tblnext "layer" t )
- (setq laycol 1 ent (ssget))
- (command "change" ent "" "p" "c" "bylayer" "")
- (while
- (setq enda (tblnext "layer" ))
- (setq layer (cdadr ENDA))
- (N5-changelayercolor layer laycol )
- (setq laycol (+ 1 laycol))
- (princ )
- )
- )
- (DEFUN N5-changelayercolor(layer co)
- (vla-put-color (vla-Item (vla-get-Layers (vla-get-ActiveDocument (vlax-get-acad-object))) layer) co)
- )
|