明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1299|回复: 4

求高手帮忙解决一下问题

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

(defun c:two()
  (setvar "cmdecho" 0)
  (setq wei1_list '("白炽灯" "荧光灯(单管)" "荧光灯(双管)" "荧光灯(多管)" "高强气体放电灯" "卤钨灯"))
  (setq wei2_list '("清洁" "一般" "污染"))
  (setq li1_list '("0.5" "0.6" "0.7" "0.8" "0.9" "1.0" "1.1" "1.25" "1.5" "1.75" "2.0" "2.25" "2.5" "3.0" "3.5" "4.0" "5.0"))
  (setq li2_list '("30,10" "30,30" "50,10" "50,30" "50;50" "70,10" "70,30" "70,50" "70,70" "30,10,10" "30,30,10" "50,30,10" "50,30,30" "50,50,10" "50,50,30" "70,30,10" "70,30,30" "70,50,10" "70,50,30"))
  (dcl_1st)
  (prin1)
)
(defun dcl_1st()
   (setq dcl_id(load_dialog "two"))
   (new_dialog "two" dcl_id)
   (show_list "wei1" wei1_list)
   (show_list "wei2" wei2_list)
   (show_list "li1" li1_list)
   (show_list "li2" li2_list)
   (setq wei1 (get_tile "wei1")
         wei2 (get_tile "wei2")
         whxs (get_tile "whxs")
         li1 (get_tile "li1")
         li2 (get_tile "li2"))
   (action_tile "wei1" "(setq wei1 $value)(sub_wei)")
   (action_tile "wei2" "(setq wei2 $value)(sub_wei)")
   (action_tile "whxs" "(setq whxs $value)(sub_wei)")
   (action_tile "li1" "(setq li1 $value)(sub_wei)")
   (action_tile "li2" "(setq li2 $value)(sub_wei)")
   (action_tile "accept" "(ok_1st)(done_dialog)")
   (start_dialog)
)
(defun ok_1st()
  (setq lyxs(get_tile "lyxs"))
)
(defun show_list(key newlist)
       (start_list key)
       (mapcar 'add_list newlist)
       (end_list)
)
(defun sub_wei()
      (cond
      ((and (= wei1 "0") (= wei2 "0")) (set_tile "whxs" "0.75"))
      ((and (= wei1 "0") (= wei2 "1")) (set_tile "whxs" "0.70"))
      ((and (= wei1 "0") (= wei2 "2")) (set_tile "whxs" "0.65"))
      ((if(= wei1 "0") (setq  li1 '("0.6" "0.7" "0.8" "0.9" "1.0" "1.1" "1.25" "1.5" "1.75" "2.0" "2.25" "2.5" "3.0" "3.5" "4.0" "5.0")
                             li2 '("50,30,10" "50,30,30" "50,50,10" "50,50,30" "70,30,10" "70,30,30" "70,50,10" "70,50,30")))
                     ((and(= li1 "0") (= li2 "0")) (set_tile "lyxs" "0.13"))
                     ((and(= li1 "0") (= li2 "1")) (set_tile "lyxs" "0.14"))
                     ((and(= li1 "0") (= li2 "2")) (set_tile "lyxs" "0.16"))
                     ((and(= li1 "0") (= li2 "3")) (set_tile "lyxs" "0.17"))
                     ((and(= li1 "0") (= li2 "4")) (set_tile "lyxs" "0.14"))
                     ((and(= li1 "0") (= li2 "5")) (set_tile "lyxs" "0.15"))
                     ((and(= li1 "0") (= li2 "6")) (set_tile "lyxs" "0.18"))
                     ((and(= li1 "0") (= li2 "7")) (set_tile "lyxs" "0.19"))
                     ((and(= li1 "1") (= li2 "0")) (set_tile "lyxs" "0.16"))
                     ((and(= li1 "1") (= li2 "1")) (set_tile "lyxs" "0.17"))
                     ((and(= li1 "1") (= li2 "2")) (set_tile "lyxs" "0.20"))
                     ((and(= li1 "1") (= li2 "3")) (set_tile "lyxs" "0.20"))
                     ((and(= li1 "1") (= li2 "4")) (set_tile "lyxs" "0.18"))
                     ((and(= li1 "1") (= li2 "5")) (set_tile "lyxs" "0.19"))
                     ((and(= li1 "1") (= li2 "6")) (set_tile "lyxs" "0.22"))
                     ((and(= li1 "1") (= li2 "7")) (set_tile "lyxs" "0.23"))
                     ((and(= li1 "2") (= li2 "0")) (set_tile "lyxs" "0.18"))
                     ((and(= li1 "2") (= li2 "1")) (set_tile "lyxs" "0.19"))
                     ((and(= li1 "2") (= li2 "2")) (set_tile "lyxs" "0.22"))
                     ((and(= li1 "2") (= li2 "3")) (set_tile "lyxs" "0.22"))
                     ((and(= li1 "2") (= li2 "4")) (set_tile "lyxs" "0.21"))
                     ((and(= li1 "2") (= li2 "5")) (set_tile "lyxs" "0.22"))
                     ((and(= li1 "2") (= li2 "6")) (set_tile "lyxs" "0.24"))
                     ((and(= li1 "2") (= li2 "7")) (set_tile "lyxs" "0.25"))
                     ((and(= li1 "3") (= li2 "0")) (set_tile "lyxs" "0.20"))
                     ((and(= li1 "3") (= li2 "1")) (set_tile "lyxs" "0.21"))
                     ((and(= li1 "3") (= li2 "2")) (set_tile "lyxs" "0.24"))
                     ((and(= li1 "3") (= li2 "3")) (set_tile "lyxs" "0.24"))
                     ((and(= li1 "3") (= li2 "4")) (set_tile "lyxs" "0.22"))
                     ((and(= li1 "3") (= li2 "5")) (set_tile "lyxs" "0.23"))
                     ((and(= li1 "3") (= li2 "6")) (set_tile "lyxs" "0.26"))
                     ((and(= li1 "3") (= li2 "7")) (set_tile "lyxs" "0.28"))
               )
                        
      ((and (= wei1 "1") (= wei2 "0")) (set_tile "whxs" "0.75"))
      ((and (= wei1 "1") (= wei2 "1")) (set_tile "whxs" "0.70"))
      ((and (= wei1 "1") (= wei2 "2")) (set_tile "whxs" "0.65"))
      ((and (= wei1 "2") (= wei2 "0")) (set_tile "whxs" "0.75"))
      ((and (= wei1 "2") (= wei2 "1")) (set_tile "whxs" "0.70"))
      ((and (= wei1 "2") (= wei2 "2")) (set_tile "whxs" "0.65"))
      ((and (= wei1 "3") (= wei2 "0")) (set_tile "whxs" "0.75"))
      ((and (= wei1 "3") (= wei2 "1")) (set_tile "whxs" "0.70"))
      ((and (= wei1 "3") (= wei2 "2")) (set_tile "whxs" "0.65"))
      ((and (= wei1 "4") (= wei2 "0")) (set_tile "whxs" "0.75"))
      ((and (= wei1 "4") (= wei2 "1")) (set_tile "whxs" "0.70"))
      ((and (= wei1 "4") (= wei2 "2")) (set_tile "whxs" "0.65"))
      ((and (= wei1 "5") (= wei2 "0")) (set_tile "whxs" "0.85"))
      ((and (= wei1 "5") (= wei2 "1")) (set_tile "whxs" "0.75"))
      ((and (= wei1 "5") (= wei2 "2")) (set_tile "whxs" "0.70"))
    )
)

DCL程序

two:dialog{
            label="电气计算软件系列—照度计算";    
            :boxed_column{
                        label="维护系数:";
                        :row{
                        :popup_list{
                                 label="灯具类型:";
                 key="wei1";                
                                 width=24;
                                 height=10;
                         }
                        :popup_list{
                                 label="污染特性:";
                 key="wei2";
                                 width=24;
                                 height=10;
                         }
                        :edit_box{
                                 label="维护系数:";
                 key="whxs";
                                 width=24;
                         }
                    }
                 }      
                 :boxed_column{
                        label="利用系数:";
                        :row{
                        :popup_list{
                                 label="室内指数:";
                 key="li1";
                                 width=24;
                                 height=10;
                         }
                        :popup_list{
                                 label="反射系数:";
                 key="li2";
                                 width=24;
                                 height=10;
                         }
                        :edit_box{
                                 label="利用系数:";
                 key="lyxs";
                                 width=24;
                         }
                    }
                 }
               ok_cancel;
}

求高手帮忙看看LSP程序,主要是子函数sub_wei中的IF后面那段 怎么都实现不了 ,我想当wei1选择白炽灯时,li1显示除去0.5以外的所有li1_list,怎么去实现啊,貌似我写的那个实现不了。 求帮忙

 楼主| 发表于 2009-10-20 13:45:00 | 显示全部楼层

怎么样能让赋值过的下拉选单有筛选功能啊

发表于 2009-10-20 16:06:00 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
 楼主| 发表于 2009-10-20 17:04:00 | 显示全部楼层

能说明白点吗 不是很明白

 楼主| 发表于 2009-10-20 19:33:00 | 显示全部楼层

没有人帮忙解决吗

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

本版积分规则

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

GMT+8, 2024-10-1 17:23 , Processed in 0.183580 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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