- (defun c:tt (/ pp s x xx)
- ;;本例是特例,矩形不相交
- (if (and (setq s (ssget '((0 . "*PO*"))))
- (setq s (vl-remove-if 'listp (mapcar 'cadr (ssnamex s))))
- (setq s (mapcar '(lambda(x)(list x (vla-get-Area (vlax-ename->vla-object x))))s))
- (setq s (vl-sort s '(lambda(a b)(>= (cadr a) (cadr b)))))
- (setq s (mapcar 'car s))
- )
- (foreach x s
- (if (and (setq pp (mapcar 'cdr (vl-remove-if-not '(lambda(a)(= 10 (car a)))(entget x))))
- (< 2 (length pp))
- (setq xx (ssget "CP" pp))
- (setq xx (ssdel x xx))
- )
- (command "ERASE" xx "")
- )
- )
- )
- )
|