AutoCAD LISP修改已存在圆半径
2011-03-26 20:06 精诚所至 金石为开 阅读(459) 评论(0) 编辑 收藏 举报AutoCAD LISP修改已存在圆半径,代码如下
(defun c:chgrad()
(setvar "cmdecho" 0)
(setq en (entsel "选取已知圆:"))
(setq en_data (entget (car en)))
(setq old_rad_list (assoc 40 en_data))
(setq old_rr (cdr rad_list))
(princ "\n旧半径=") (princ old_rr)
(setq cenpt (cdr (assoc 10 en_data)))
(setq new_rr (getdist cenpt "New Radius:"))
(setq new_rad_list (cons 40 new_rr))
(setq en_data (subst new_rad_list old_rad_list en_data))
(entmod en_data)
(prin1)
)
代码完。
![](https://img2024.cnblogs.com/blog/35695/202408/35695-20240826070647288-243310440.jpg)