 - (defun c:tt1 (/ center center-lst dxf lst name radius ss temp n)
- (if (setq ss (ssget '((0 . "CIRCLE"))))
- (progn
- (while (setq name (ssname ss 0))
- (setq dxf (entget name))
- (setq Center (cdr (assoc 10 dxf)))
- (setq radius (cdr (assoc 40 dxf)))
- (setq lst (append lst (list (list Center radius name))))
- (ssdel name ss)
- )
- (foreach x lst
- (if (not (member (car x) Center-lst))
- (setq Center-lst (append Center-lst (list (car x))))
- )
- )
- (setq n 0 )
- (foreach x Center-lst
- (setq temp nil)
- (foreach xx lst
- (if (equal (car xx) x)
- (setq temp (append temp (list (list (cadr xx) (caddr xx)))))
- )
- )
- (setq temp (cdr (vl-sort temp '(lambda (a b)
- (< (car a) (car b))
- ))))
- (foreach x temp
- (entdel (cadr x))(setq n (1+ n))
- )
- )
- (princ "删了")
- (princ n )
- )
- )
- (princ)
- )
|