AutoCAD LISP简单IF判断语句
2011-03-26 21:48 精诚所至 金石为开 阅读(3417) 评论(0) 编辑 收藏 举报AutoCAD LISP简单判断语句,代码如下。
(defun c:test()
(setq cenpt (getpoint "输入圆心:"))
(setq rad (getdist cenpt "\n输入圆半径:"))
(if (> rad 0)
(progn
(command "circle" cenpt rad)
(command "chprop" (entlast) "" "c" 3 "")
(princ "\n画图任务完成")
)
(progn
(alert "半径有问题!")
(princ "\n画图任务失败!")
)
)
)
代码完。
![](https://img2024.cnblogs.com/blog/35695/202408/35695-20240826070647288-243310440.jpg)