请问一下这个循环怎么用右键退出
(defun C:t00 ()(while t
(command "dimdiameter")
(while (/= (getvar "CMDACTIVE") 0) (command PAUSE))
)
(princ)
)
当while后面为nil时就退出了,你写成T当然不退出了 本帖最后由 zkq1212 于 2014-7-8 15:44 编辑
自贡黄明儒 发表于 2014-7-8 15:11 static/image/common/back.gif
当while后面为nil时就退出了,你写成T当然不退出了
当while后面为nil时就直接退出了,一次都不执行了。我想可以重复标注圆,也就是下面程序的效果
(defun c:33 ()
(setq clay (getvar "clayer"))
(command "Layer" "s" "03-标注层" "")
(while (setq p(entsel "\n指定新的标注:"))
(command"dimdiameter")(getvar"cmdactive")(command p)
(while(/=(getvar"cmdactive")0)(command pause))
)
(command "Layer" "s" clay "")
(princ)
)
(defun C:t00 ()
(setq ent (entlast)
key t
)
(while key
(command "dimdiameter")
;(while (/= (getvar "CMDACTIVE") 0) (command PAUSE))
)
(princ)
)
那么变量如何判断鼠标右键? 为什么要用entlast?
如果使用
(while (setq ent(entsel))
(commmand……
)怎样? (defun c:tt ()
(setvar "CMDECHO" 0)
(while (and (setq s1 (entsel "\n选择圆: "))
(wcmatch (cdr(assoc 0 (entget(car s1)))) "ARC,CIRCLE"))
(command "_.DIMDIAMETER" s1)
(while (> (getvar "CMDACTIVE") 0) (command PAUSE))
)
(princ)
)
页:
[1]