明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2581|回复: 9

如何用radio_button控制edit_box的值实时更新

[复制链接]
发表于 2011-4-1 16:07 | 显示全部楼层 |阅读模式
本帖最后由 zhongys 于 2011-4-1 16:25 编辑

请教各位,如何用radio_button控制edit_box的值实时更新,如图

(defun c:www()
   (setvar "cmdecho" 0)
   (setq dcl_id (load_dialog "tt"))
   (new_dialog "tt" dcl_id)
   (setq defkey1 "rb11" defkey2 "rb21")
   (set_tile defkey1 "1")
   (set_tile defkey2 "1")
   (setq name(get_attr defkey1 "label"))
   (setq ssca(get_attr defkey2 "label"))
   (action_tile "rb11" "(setq name(get_attr $key \"label\"))")
   (action_tile "rb12" "(setq name(get_attr $key \"label\"))")
   (action_tile "rb13" "(setq name(get_attr $key \"label\"))")
   (action_tile "rb14" "(setq name(get_attr $key \"label\"))")
   (action_tile "rb21" "(setq ssca(get_attr $key \"label\"))")
   (action_tile "rb22" "(setq ssca(get_attr $key \"label\"))")
   (action_tile "rb23" "(setq ssca(get_attr $key \"label\"))")
   (action_tile "rb24" "(setq ssca(get_attr $key \"label\"))")
   (action_tile "rb25" "(setq ssca(get_attr $key \"label\"))")
   (action_tile "ins_ok" "(done_dialog 1)")
   (set_tile "dwgnum" (strcat name ssca))
   ;(setq txt (get_tile "dwgnum"))
   (setq dd(start_dialog))
   (if (= dd 1)
       (progn
(setq p1 (getpoint  "\n 第一点:"))
(setvar "osmode" 0)
(command "ortho" "off")
(setq p2 (getpoint p1 "\n 第二点:"))
(command "ortho" "on")
(setq p3 (getpoint p2 "\n 第三点:"))
(if (= (tblsearch "layer" "尺寸线层") nil)(new_lay "尺寸线层"   4    "CONTINUOUS"))
(setvar "clayer" "尺寸线层")
(if (= p3 nil)
     ;(command  "leader"   p1 p2  "" txt "")
     ;(command  "leader"   p1 p2 p3 ""  txt "")   
     (command  "leader"   p1 p2  "" (strcat name ssca) "")
     (command  "leader"   p1 p2 p3 ""  (strcat name ssca) "")

)
       )
   )
   (princ)
)


   (set_tile "dwgnum" (strcat name ssca))
   两个radio_button的选择改变时set_tile "dwgnum" 的值同时实时更新,最后将值传回给txt
   (setq txt (get_tile "dwgnum"))
不知道要如何控制它才能实现实时更新



本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
发表于 2011-4-1 20:35 | 显示全部楼层
1、在对话框中定义key
如:
:radio_column{
key="type";
value="a0";
:radio_button{label="1/8";key="a0";}
:radio_button{label="1/4";key="a1";}
:radio_button{label="3/8";key="a2";}
:radio_button{label="1/2";key="a3";}
:radio_button{label="3/4";key="a4";}
……
在程序中
……
(action_tile "type" "(chedit &value)")
……
(defun chedit (a)
(setq b
  (cond
   ((= a "a0") "PT1/8")
   ((= a "a1") "PT1.4")
   ……
)
(settile "gyxh" b)
)
发表于 2011-12-26 00:35 | 显示全部楼层
我这是图层的控制,墙体是新建图层,然后旁边那个是控制他的显示和隐藏 冻结属性,请问应该怎么去做

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
发表于 2011-12-26 20:10 | 显示全部楼层
(action_tile "rb11" "(setq name(get_attr $key \"label\"))")
   (action_tile "rb12" "(setq name(get_attr $key \"label\"))")
   (action_tile "rb13" "(setq name(get_attr $key \"label\"))")
   (action_tile "rb14" "(setq name(get_attr $key \"label\"))")
   (action_tile "rb21" "(setq ssca(get_attr $key \"label\"))")
   (action_tile "rb22" "(setq ssca(get_attr $key \"label\"))")
   (action_tile "rb23" "(setq ssca(get_attr $key \"label\"))")
   (action_tile "rb24" "(setq ssca(get_attr $key \"label\"))")
   (action_tile "rb25" "(setq ssca(get_attr $key \"label\"))")
每行后面都加上"(set_tile \"dwgnum\" (strcat name ssca))"
发表于 2011-12-27 21:53 | 显示全部楼层
nzl1116 发表于 2011-12-26 20:10
(action_tile "rb11" "(setq name(get_attr $key \"label\"))")
   (action_tile "rb12" "(setq name(get_ ...

QQ:342670425,求加友请教LISP&DCL
发表于 2012-3-6 09:13 | 显示全部楼层
zzxxqq,请写出此贴的完整LISP代码,我只能实现单个单选按钮框的实时变化,无法将其两者联系出来,两个一起的话就不能实时了
发表于 2012-5-29 12:54 | 显示全部楼层
zzxxqq,请写出此贴的完整LISP代码,我只能实现单个单选按钮框的实时变化,无法将其两者联系出来,两个一起的话就不能实时了
发表于 2012-6-2 20:35 | 显示全部楼层
看得我都不好意思说了
发表于 2013-3-11 11:17 | 显示全部楼层
楼主 你的这功能实现了没?能否给参照学习一下qq:328302216  邮箱328302216@qq.com
发表于 2013-3-12 01:13 | 显示全部楼层
类似如下效果吧

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

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

本版积分规则

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

GMT+8, 2024-4-26 18:44 , Processed in 0.425325 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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