附源码* O) ~2 a! A: L+ B3 D
(defun c:1 ()
$ [4 v B6 s" y3 `1 R" g5 ?4 J3 f (command "layer" "on" "*" "")
! m6 d1 H2 t" Y" W2 w(princ))
% {: ~8 \' x* S D5 V8 w
3 k' `. d5 x4 H4 l& a0 A(defun C:2(/ ES EN EL A)
+ }5 ?0 T5 W8 d$ H$ v9 v& {7 [& ] (princ "Selected Entity(s) Layers Isolated.")
. U/ L! X. i1 x0 |9 V, ~ (setq ES (ssget) A 0 EN "" EL nil FL nil)- Q0 T; \; V1 B0 |) Z
(while (/= EN nil)
: |% k; q$ z y- A6 E (setq EN (ssname ES A) EL (cons EN EL) A (1+ A)))
3 j/ }5 ?0 i8 x- v2 o (setq EL (cdr EL) FL (cdr (assoc ' 8 (entget (car EL)))) EL (cdr EL))
% H Y+ T% B8 B/ r, H0 V8 W (repeat (- A 2)
! O, r" N. e/ Z/ U (setq EN (cdr (assoc ' 8 (entget (car EL))))% K& x* \9 V5 `0 w: D. M5 m
FL (strcat EN "," FL) EL (cdr EL)) )
0 }. d2 Q4 Q. b! d, y& C1 r I (command "LAYER" "off" "*" "y" "on" (eval FL) "")+ M/ T S% b2 m/ p
(princ)) |