-
【快速选择】的方法,选择同一个图层的对象,在属性里面修改图层。
-
另外一个方法就是使用插件,代码如下:
-
- (defun C:TES ( / &k1 &kw1 &ob1 &tc1)
(setvar "cmdecho" 0)
(setvar "blipmode" 0)
(if (null vlax-dump-object) (vl-load-com) )
(if (setq &tc1 (entsel "n请选择参考图层或默认为当前图层"))
(setq &tc1 (cdr (assoc 8 (entget (car &tc1)))))
(setq &tc1 (getvar "clayer"))
)
(if (setq &kw1 (ssget))
(progn
(while (setq &k1 (ssname &kw1 0))
(setq &kw1 (ssdel &k1 &kw1))
(setq &ob1 (vlax-ename->vla-object &k1))
(vla-put-layer &ob1 &tc1);修改图层为指定图层
(vla-put-color &ob1 256);改变颜色为图层颜色
);while
)
)
(princ)
);复制到记事本,以【.lsp】为后缀命名,打开CAD,autolisp加载了,命令【TES】
- (defun C:TES ( / &k1 &kw1 &ob1 &tc1)