明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1907|回复: 4

是我的CAD问题还是我的程序用不了set_tile不能用了

[复制链接]
发表于 2011-11-6 13:47 | 显示全部楼层 |阅读模式
如题:是我的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="你还没选择到圆。";
当我选择了圆这个位置还是不变。
发表于 2011-11-6 16:39 | 显示全部楼层
当你使用(set_tile "txt" txt)时,对话框已经结束!当然不能赋值啦!
 楼主| 发表于 2011-11-6 17:09 | 显示全部楼层
但还是在while里没退出来呀
发表于 2011-11-6 17:35 | 显示全部楼层
wang.bay 发表于 2011-11-6 17:09
但还是在while里没退出来呀

(start_dialog)之后对话框就结束了!虽然while又重启了对话框,但(set_tile "txt" txt)始终是在对话框有效期之外!明白了吧!所以(set_tile "txt" txt)应该放在什么位置自己应该能想明白了吧!
 楼主| 发表于 2011-11-6 17:49 | 显示全部楼层
Lisper 发表于 2011-11-6 17:35
(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)
  )
多谢指教
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-4-28 09:56 , Processed in 1.471375 second(s), 29 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表