本帖最后由 dina215 于 2014-4-14 14:38 编辑 ;单开图层 (defun C:cv (/ ES EN EL A) (setvar "cmdecho" 0) ;指令执行过程不响应 (PRINC "\n ") (setq m:err *error* *error* *merr* ) (setvar "cmdecho" 0)
;单开图层
(defun C:cv (/ ES EN EL A)
(setvar "cmdecho" 0) ;指令执行过程不响应
(PRINC "\n ")
(setq m:err *error*
*error* *merr*
)
(setvar "cmdecho" 0)
(princ "\n-->请选取要单开的层对象:")
(setq ES (ssget ":S")
A 0
EN ""
EL nil
FL nil
)
(while (/= EN nil)
(setq EN (ssname ES A)
EL (cons EN EL)
A (1+ A)
)
)
(setq EL (cdr EL)
FL (cdr (assoc '8 (entget (car EL))))
EL (cdr EL)
)
(repeat (- A 2)
(setq EN (cdr (assoc '8 (entget (car EL))))
FL (strcat EN "," FL)
EL (cdr EL)
)
)
(command "LAYER" "off" "*" "y" "on" (eval FL) "")
(setvar "cmdecho" 1)
(setq *error* m:err
m:err nil
)
(PRINC "\n 单开图层完成!")
(PRINC)
)
程序下载:http://www.zwcad.com/community/thread-13889-1-1.html