明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1348|回复: 1

[基础] 高手帮忙看看这个程序的问题在哪,怎样在原有基础上修改

[复制链接]
发表于 2009-10-17 23:10:00 | 显示全部楼层 |阅读模式
本帖最后由 作者 于 2009-10-19 9:59:04 编辑

LSP程序:

(defun c:first()
  (setvar "cmdecho" 0)
  (setq wei1_list '("白炽灯" "荧光灯(单管)" "荧光灯(双管)" "荧光灯(多管)" "高强气体放电灯" "卤钨灯"))
  (setq wei2_list '("清洁" "一般" "污染"))
 (dcl_first)
 (prin1)
)
(defun dcl_first()
   (setq dcl_id(load_dialog "first"))
   (new_dialog "first" dcl_id)
   (show_list "wei1" wei1_list)
   (show_list "wei2" wei2_list)
  (set_tile "wei1" "0")
  (set_tile "wei2" "0")
   (action_tile "wei1" "(sub_wei1 $value)")
  (action_tile "wei2" "(sub_wei2 $value)")
  (action_tile "accept" "(ok_first)(done_dialog)")
  (start_dialog)
)
(defun ok_first()
   (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"))
      ((and (= wei1 "1") (= wei2 "0")) (set_tile "whxs" "0.75"))
      ((and (= wei1 "1") (= wei2 "1")) (set_tile "whxs" "0.7"))
      ((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"))
    )
)
(defun show_list(key newlist)
       (start_list key)
       (mapcar 'add_list newlist)
       (end_list)
)
(defun sub_wei1(vvs)
   (set_tile "wei1"(nth(atoi vvs) wei1_list))
)
(defun sub_wei1(vvs)
   (set_tile "wei2"(nth(atoi vvs) wei2_list))

 

DCL程序:

first: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;
                         }
                    }
                 }
               ok_cancel;
}

希望帮忙看看,问题出在哪里,怎么修改才能实现 谢谢了。DCL程序应该没问题

发表于 2009-10-19 20:50:00 | 显示全部楼层
游客,本帖隐藏的内容需要发帖数高于 5 才可浏览,你当前发帖数只有 0
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-6 09:37 , Processed in 0.182134 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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