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画图任务失败!")
)
)
)
代码完。