只需一步,快速开始
请教:(command "._move" (entlast) "" '(0 0 0) pause )
如何取得这个command的返回值,比如当回车或空格,或右键的时候 返回nil如果取得了点,就返回T
使用道具 举报
(command "._move" ...)(setq a (getvar "lastpoint"))(command pause)
(if (equal a (getvar "lastpoint") 0.00001) (princ "未拾取点") (princ "拾取点"))
caoyin发表于2008-7-4 9:07:00(command \"._move\" ...)(setq a (getvar \"lastpoint\"))(command pause)(if (equal a (getvar \"lastpoint\") 0.00001) (princ \"未拾取点\") (princ \"拾取点\"))
(getvar "lastpoint") 不能监测有没有点取点
运行(command "._move" (entlast) "" '(0 0 0) pause)后如点取右键(getvar "lastpoint")返回 '(0 0 0)
我的意思不是监测有没有点取点
而是 pause 时,用户如拾取新的点,则返回新点坐标
caoyin发表于2008-7-4 10:34:00我的意思不是监测有没有点取点而是 pause 时,用户如拾取新的点,则返回新点坐标
当你不点取新点(右键)时,lastpoint变量值也在变.
你先测测你上述程序,点右键是返回
"未拾取点" 还是 "拾取点"
(defun c:tt (/ a) (command "._move" (entlast) "" '(0 0 0)) (setq a (getvar "lastpoint")) (command pause) (if (equal a (getvar "lastpoint") 0.00001) (princ "未拾取点") (princ "拾取点") ) (princ))
不知道我测试为什么没问题
谢谢caoyin
OK了。。。
这句原来放在这里。。。学习啦
caoyin 发表于 2008-7-4 09:07 本帖最后由 作者 于 2008-7-4 9:08:21 编辑 (command "._move" ...)(setq a (getvar "lastpoint"))(comma ...
本版积分规则 发表回复 回帖后跳转到最后一页
小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 ) ©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途
GMT+8, 2025-5-9 21:03 , Processed in 0.163385 second(s), 26 queries , Gzip On.
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.