明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1253|回复: 1

[基础] 求助button的问题

[复制链接]
发表于 2009-10-23 09:22:00 | 显示全部楼层 |阅读模式

(defun c:kjb()
  (setvar "cmdecho" 0)
  (dcl_1st)
  (prin1)
)
(defun dcl_1st()
   (setq dcl_id(load_dialog "kjb"))
   (new_dialog "kjb" dcl_id)
  (action_tile "bb1" "(get_bb1)(done_dialog 1)")
   (setq dd(start_dialog))
  (if(= dd 1)(action_tile "kjbz" "(setq kjbz $value)(sub_bb1)") 
 )
)
(defun get_bb1()
  (setq sl(atof(get_tile "scl")))
 (setq sw(atof(get_tile "skw")))
 (setq sh(atof(get_tile "sgh")))
)
(defun sub_bb1()
 (set_tile "kjbz" "(/ (* 5 sh (+ sl sw)) (* sl sw))")
)

 

 

 

kjb:dialog{
            label="空间比计算";          
            :boxed_column{
                        label="数据输入:";
                        :row{
                        :edit_box{
                                 label="室长L(m):";
                                 key="scl";
                                 width=22;
                         }
                        :edit_box{
                                 label="室宽W(m):";
                                 key="skw";
                                 width=22;
                         }
                        :edit_box{
                                 fixed_width=true;
                                 alignment=centered;
                                 key="kjbz";
                                 width=16;
                         }
                       
                        }
                        :row{
                        :edit_box{
                                 label="灯具数量:";
                                 key="djsl";
                                 width=22;
                         }
                        :edit_box{
                                 label="室高H(m):";
                                 key="sgh";
                                 width=22;
                         }
                        :button{
                               label="计算空间比";
                               fixed_width=true;
                               alignment=centered;
                               key="bb1";
                               width=12;
                         }
 
                      }
                 }
          
               spacer_1;
               ok_cancel;
}       

 

请问如何能点击"计算空间比"button能在"kjbz"edit_box显示计算结果啊。

发表于 2009-10-23 17:05:00 | 显示全部楼层

你應重新把DCL看一遍吧!

(defun C:KJB ()
  (setvar "cmdecho" 0)
  (DCL_1ST)
  (prin1)
)
(defun DCL_1ST ()
  (setq DCL_ID (load_dialog "kjb"))
  (new_dialog "kjb" DCL_ID)
  (action_tile "bb1" "(get_bb1)")
  (start_dialog)
)
(defun GET_BB1 ()
  (setq SL (atof (get_tile "scl")))
  (setq SW (atof (get_tile "skw")))
  (setq SH (atof (get_tile "sgh")))
  (set_tile "kjbz" (rtos (/ (* 5 SH (+ SL SW)) (* SL SW))))
)

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-6 09:50 , Processed in 0.173908 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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