首先声明俺也是菜鸟,不是高手!简单回答一下你的问题,其实不用这么多语句的程序,另写一个也不麻烦!下面是我按你的要求写的程序,希望能帮到你!- (defun c:cr()
- (setq oldobj (entsel "\n请选择要改变半径的对象:"))
- (setq newrad (getreal"\n请输入新的半径值:"))
- (setq oldobjlst (entget (car oldobj)))
- (setq oldrad (cdr (assoc '40 oldobjlst)))
- (setq oldradlst (assoc '40 (entget (car oldobj))))
- (setq ss (ssget (list '(0 . "circle") oldradlst)))
- (setq n 0)
- (repeat (sslength ss)
- (setq ss_n (ssname ss n))
- (setq ss_n_lst (entget ss_n))
- (setq newradlst (cons 40 newrad))
- (setq ss_n_lst (subst newradlst oldradlst ss_n_lst))
- (entmod ss_n_lst)
- (setq n (1+ n))
- )
- (princ)
- )
|