-
- ;;; 解锁层
- (defun c:Lay_ul (/ ssa index n entity)
- (setvar "cmdecho" 0)
- (setq ssa (ssget))
- (setq n (sslength ssa))
- (setq index (- n 1))
- (repeat n
- (setq entity (ssname ssa index))
- (command "-layer" "u" (cdr (assoc 8 (entget entity))) "")
- (setq index (1- index))
- )
- (princ)
- )
- ;;; 锁定层
- (defun c:Lay_ll (/ ssa index n entity)
- (setvar "cmdecho" 0)
- (princ "\n请注意:被选中的对象所在层将被锁定")
- (setq ssa (ssget))
- (setq n (sslength ssa))
- (setq index (- n 1))
- (repeat n
- (setq entity (ssname ssa index))
- (command "-layer" "lo" (cdr (assoc 8 (entget entity))) "")
- (setq index (1- index))
- )
- (princ)
- )
- ;;; 解冻层
- (defun c:Lay_tl (/ ss)
- (setvar "cmdecho" 0)
- (command "-layer" "t" "*" "")
- (princ)
- )
- ;;; 锁住其他层
- (defun c:Lay_lo (/ ssa index n entity chklay)
- (prompt "锁定其他层")
- (setvar "cmdecho" 0)
- (command "-layer" "lo" "*" "")
- (setq ssa (ssget))
- (setq n (sslength ssa))
- (setq index (- n 1))
- (repeat n
- (setq entity (ssname ssa index))
- (command "-layer" "u" (cdr (assoc 8 (entget entity))) "")
- (command "-layer" "u" (strcat (cdr (assoc 8 (entget entity))) "*") "")
- (setq index (1- index))
- )
- (princ)
- )
- ;;; 解锁所有层
- (defun c:Lay_ua (/ ss)
- (setvar "cmdecho" 0)
- (command "-layer" "u" "*" "")
- (princ)
- )
- ;;; 打开指定层
- (defun c:Lay_olcc (/ cname)
- (setvar "cmdecho" 0)
- (command "-layer" "off" "*" "y" "")
- (setq cname (getstring "\n输入想打开的层: "))
- (command "-layer" "on" (strcat "*" cname "*") "")
- (princ)
- )
- ;;; 打开所有层
- (defun c:Lay_ol (/ ss)
- (setvar "cmdecho" 0)
- (command "-layer" "on" "*" "")
- (princ)
- )
- ;;; 设当前层为embed
- (defun c:Lay_ef (/)
- (setvar "cmdecho" 0)
- (setq chklay (tblsearch "layer" "EMBED"))
- (if (= chklay nil)
- (progn
- (command "-LAYER" "N" "EMBED" "C" "151" "EMBED" "")
- (command "-LAYER" "s" "EMBED" "")
- )
- (command "-LAYER" "s" "EMBED" "")
- )
- (princ)
- )
|