我去,居然被我找到另一个更好的脚本- (defun c:sel (/ ss i layer lst)
- (if (setq ss (ssget))
- (progn
- (repeat (setq i (sslength ss))
- (if (not (member (setq layer (cdr (assoc 8 (entget (ssname ss (setq i (1- i))))))) lst))
- (setq lst (cons "," (cons layer lst)))
- )
- )
- (sssetfirst nil (ssget "_A" (list (cons 8 (apply 'strcat (cdr lst))))))
- )
- )
- (princ)
- )
|