如何将下面程序改了删除同心圆的大圆 留住小圆
能力有限,实在读不懂了
望大师出手
国际惯例 原作者为YOYOHO- ;;;同心圆删除大圆保留最小的圆 O.K.
- (defun c:cd (/ ss nss en ent cnt st1 st2 )
- (setq ss1 (ssadd))
- (if (setq ss (ssget '((0 . "CIRCLE"))))
- (progn
- (repeat (setq nss (sslength ss))
- (setq en (ssname ss (setq nss (1- nss)))
- ent (entget en)
- cnt (cdr (assoc 10 ent))
- r (vl-catch-all-apply
- '(lambda ()
- (foreach p st1
- (if (equal cnt p 1e-6)
- (exit)
- )
- )
- )
- )
- )
- (if (not (vl-catch-all-error-p r))
- (setq st1 (cons cnt st1)
- st2 (cons (cdr (assoc 10 ent)) st2))
- (PROGN
- (ssadd en ss1)
- (vla-Delete (vlax-ename->vla-object en))
- )
- )
- )
-
- )
- )
- (alert (strcat "已删除" (rtos (- (sslength ss1) nss))"个同心圆"))
- (reverse st2)
- )
|