 - (defun c:bcnc ( / li et clst cenlist l2 EN ENT ENT1 I J NEWD R1 SS SS1 )
- (if (and(setq ss (ssget "x"(list '(0 . "CIRCLE")(cons 8 "1")))) )
- (progn
- (setq i 0 clst nil l2 nil)
- (repeat (sslength ss)
- (setq en (ssname ss i)
- ent (entget en)
- r1 (assoc 40 ent)
- cenlist (cons(cdr r1) cenlist)
- i (1+ i))
- (setq cenlist (vl-sort cenlist '< ))
- )
- (setq l2 (cons (car cenlist)l2))
- (while(setq cenlist (vl-remove(car cenlist)(cdr cenlist)))(setq l2 (cons(car cenlist) l2)))
- (foreach e (reverse l2)
- (if (not (member e clst))
- (progn
- (setq ss1 (ssget "x"(list(cons 8 "1") '(0 . "CIRCLE")(cons 40 e))))
- (setq newd (getdist (strcat "\n直径-->" (rtos (* e 2) 2 4) "<--:")))
- (if newd (progn
- (setq j 0)
- (setq e (/ newd 2))
- (setq clst (cons e clst))
- (repeat (sslength ss1)
- (setq ent1 (entget(ssname ss1 j))
- ent1 (subst (cons 40 e) (assoc 40 ent1) ent1)
- j (1+ j))
- (entmod ent1)
- )
- )
- )
- )
- )
- )
- )
- )
- (princ)
- )
|