是我的CAD问题还是我的程序用不了set_tile不能用了
如题:是我的CAD问题还是我的程序用不了set_tile不能用了lisp的程序如下:
(defun c:test()
(setq id (load_dialog "test"))
(if (< id 0)(exit))
(setq std 2)
(while (> std 1)
(if (not (new_dialog "test" id))(exit))
(action_tile "cc" "(done_dialog 2)")
(action_tile "accept" "(done_dialog 1)")
(setq std (start_dialog))
(if (= std 2)
(progn (setq ss (itoa (sslength (ssget '((0 . "circle"))))))
(setq txt (strcat "你选择了" ss "个圆。"))
(set_tile "txt" txt)))
);;;end while
(unload_dialog id)
(princ)
)
dcl的程序如下:
test:dialog{label="test";
:row{
:text{key="txt";
is_bold=true;
value="你还没选择到圆。";
fixed_width=true;
width=20;
}
:button{label="计算圆数量";
key="cc";
fixed_width=true;
}}
ok_only;}
大伙帮助看一下。
value="你还没选择到圆。";
当我选择了圆这个位置还是不变。
当你使用(set_tile "txt" txt)时,对话框已经结束!当然不能赋值啦! 但还是在while里没退出来呀 wang.bay 发表于 2011-11-6 17:09 static/image/common/back.gif
但还是在while里没退出来呀
(start_dialog)之后对话框就结束了!虽然while又重启了对话框,但(set_tile "txt" txt)始终是在对话框有效期之外!明白了吧!所以(set_tile "txt" txt)应该放在什么位置自己应该能想明白了吧! Lisper 发表于 2011-11-6 17:35 static/image/common/back.gif
(start_dialog)之后对话框就结束了!虽然while又重启了对话框,但(set_tile "txt" txt)始终是在对话框有效 ...
多谢 Lisper 我按你的意思做为改动如下就可以达到我想要的结果
(defun c:test()
(setq id (load_dialog "test"))
(if (< id 0)(exit))
(setq std 2 txt "你还没选择到圆。")
(while (> std 1)
(if (not (new_dialog "test" id))(exit))
(action_tile "cc" "(done_dialog 2)")
(action_tile "accept" "(done_dialog 1)")
(set_tile "txt" txt)
(setq std (start_dialog))
(if (= std 2)
(progn (setq ss (itoa (sslength (ssget '((0 . "circle"))))))
(setq txt (strcat "你选择了" ss "个圆。"))
))
);;;end while
(unload_dialog id)
(princ)
)
多谢指教
页:
[1]