(if (and(setq ss (ssget "x"(list '(0 . "CIRCLE")(cons 8 "1")))) )
(progn
(setq i 0 clst nill2 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)
)
只能修改两个,循环不了,谢谢 比如有1.0和1.1和1.2,修改加大0.1,试试看,有错误,谢谢 可以了,谢谢,设置好了就可以了 院长的代码值得学习 jun353835273 发表于 2017-11-19 20:17
院长的代码值得学习
嗯,但要加载一个工具,其实用不到太多,所以
不过还是谢谢院长的帮助
页:
1
[2]