- ;; 同心圆留小
- ;; 需要e派工具箱(XCAD)的支持:[url]http://yunpan.cn/QXQKsW9gAPmpF[/url](defun c:tt ()
- (xyp-CMDLA0)
- (setq i -1
- lst-del '()
- lst-save '()
- )
- (if (setq ss (ssget '((0 . "CIRCLE"))))
- (while (setq s1 (ssname ss (setq i (1+ i))))
- (if (and (not (member s1 lst-del)) (not (member s1 lst-save)))
- (if (setq ss1 (ssget "X" (list '(0 . "CIRCLE") (cons 10 (xyp-DXF 10 s1)))))
- (setq lst1 (xyp-ss2list ss1)
- lst1 (mapcar '(lambda (x) (list (xyp-DXF 40 x) x)) lst1)
- lst1 (vl-sort lst1 '(lambda (x y) (< (car x) (car y))))
- lst1 (mapcar 'cadr lst1)
- lst-save (cons (car lst1) lst-save)
- lst-del (append (cdr lst1) lst-del)
- )
- )
- )
- )
- )
- (if lst-del
- (progn
- (setq ss (xyp-list2ss lst-del))
- (sssetfirst ss ss)
- )
- )
- (xyp-CMDLA1)
- )
|