(defun c:ad() ;;;;程序选择可以求几个圆的面积,并在圆框内写出面积大小。
(defun *error* (msg)
(print msg)
(setq ccxx (strcat "求面积失败!!!第" i0 "个面积求取不成功。")); ccxx:出错信息
(alert ccxx)
(princ)
)
(setvar "osmode" 0)
(setvar "cmdecho" 0)
(while (/= 0 (getvar "cmdactive")) (command ""))
(setq yorn "" i 1 i0 "1")
(while (eq yorn "")
(setq pt (getpoint "选取点: \n"))
;;;;以下在点圆中取一个点,并获取面积
(command "bpoly" pt "")
(setq en (entlast))
(command "area" "o" en)
(setq mj (getvar "area"))
(setq mj (rtos mj))
(command "text" "j" "mc" pt "0" mj "")
;;;;获取面积成功并写出
(setq i (1+ i) i0 (itoa i))
(setq yorn (getstring (strcat "添加第" i0 "个点?回车确认或输入n后回车中止选点:")))
)
)
屏幕上有20个圆,我在圆内点1个点,就会在点的位置显示圆的面积,然后继续点下一个点。
问题是,如果我有一个点点在圆外,程序的(command "bpoly" pt "") 语句就会出错,然后就跳出来了,我想的是如果能够不跳出来继续执行下一个圆就好了,请问怎么办
烙印99