对于非块,您可以使用下面的
- (defun C:chCL(/ whc sset ent sellist color layer)
- (defun FiltLayer(sset pst)
- (setq whc 0 newSet(ssadd))
- (while(< whc (sslength sset))
- (setq ent(ssname sset whc))
- (setq sellist(entget ent))
- (if(= pst (cdr(assoc 8 sellist)))
- (ssadd ent newSet)
- )
- (setq whc(+ whc 1))
- )
- newSet
- )
- (setvar "cmdecho" 0)
- (setq color(acad_colordlg 1 nil))
- (setq layer(getstring "\n Layer: "))
- (setq sset
- (ssget[color=purple] [color=black]"X"[/color] [/color]
- (list
- (cons -4 "<OR")
- (cons 0 "ARC")
- (cons 0 "CIRCLE")
- (cons 0 "ELLIPSE")
- (cons 0 "LINE")
- (cons 0 "LWPOLYLINE")
- (cons 0 "POLYLINE")
- (cons 0 "INSERT")
- (cons -4 "OR>")
- )
- )
- )
- (if(and sset(> (sslength sset) 0))(setq sset(FiltLayer sset "[color=purple]LAYER NAME OF xploded BLOCKs[/color]")))
- (if (and sset (> (sslength sset) 0))
- (progn
- (command "change" sset "" "Properties" "Color" color "")
- (command "change" sset "" "Properties" "LAyer" layer "")
- (command "setbylayer" "P" "")
- )
- )
- (setvar "cmdecho" 1)
- (princ)
- )
对于块,编辑每个块>保存它们>在工具选项板中拖动它们>并使用工具选项板中的重定义命令更新块。
也可以使用VVA lisp进行块。
在这里:http://www.cadtutor.net/forum/showthread.php?533-所有层和块的Lisp颜色变化/第2页 |