明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2016|回复: 12

2008.11.10 *****列表对话框问题*****JXLSP再帮我看一下

  [复制链接]
发表于 2008-11-9 14:46:00 | 显示全部楼层 |阅读模式
本帖最后由 作者 于 2008-11-10 9:04:40 编辑

如果是这种情况怎么处理

dcl_settings : default_dcl_settings { audit_level = 3; }

gj : dialog {
    label = "管件连接尺寸汇编";
    : boxed_column {
        label = "公制";  
        : column {
            : popup_list {
                label = "90° 弯头(L)        DN";
                key = "00";
                mnemonic = "9";
                list = "15\n20\n25\n40\n50\n65\n80\n100\n125\n150\n200\n250\n300\n350\n400\n450\n500\n600\n700\n800\n900\n1000\n1100\n1200";
            }
            : popup_list {
                label = "异径管(同心)        DN";
                key = "11";            
                list = "20*15";
            }
        }
    }
    ok_cancel;
}

如果仅仅只有“90°弯头”的情况下,下面的LSP是可以实现我要的功能的,但现在添加了“异径管”这一项,我 又该如何修改以下lSP来实现我想要选择DN20*15来插入事先做好的块呢?

;;管件连接尺寸汇编
(DEFUN c:gj ()  
 (setq dcl_id (load_dialog "gj"))
 (new_dialog "gj" dcl_id)

(action_tile "accept" "(setq gj_done_id (get_tile\"00\"))(done_dialog 1)")

(setq gj_done(start_dialog))
(unload_dialog dcl_id)

(if (> gj_done 0)
  (progn  
   (setvar "osmode" 15359)
   (cond ((= "0" gj_done_id)
          (dim_gj_1)
         )
         ((= "1" gj_done_id)
           (dim_gj_2)
         )
         ((= "2" gj_done_id)
           (dim_gj_3)
         )
         ((= "3" gj_done_id)
           (dim_gj_4)
         )
         ((= "4" gj_done_id)
           (dim_gj_5)
         )
         ((= "5" gj_done_id)
           (dim_gj_6)
         )
         ((= "6" gj_done_id)
           (dim_gj_7)
         )
         ((= "7" gj_done_id)
           (dim_gj_8)
         )
         ((= "8" gj_done_id)
           (dim_gj_9)
         )
         ((= "9" gj_done_id)
           (dim_gj_10)
         )
         ((= "10" gj_done_id)
           (dim_gj_11)
         )
         ((= "11" gj_done_id)
           (dim_gj_12)
         )
         ((= "12" gj_done_id)
           (dim_gj_13)
         )
         ((= "13" gj_done_id)
           (dim_gj_14)
         )
          ((= "14" gj_done_id)
           (dim_gj_15)
         )
          ((= "15" gj_done_id)
           (dim_gj_16)
         )
          ((= "16" gj_done_id)
           (dim_gj_17)
         )
          ((= "17" gj_done_id)
           (dim_gj_18)
         )
         ((= "18" gj_done_id)
           (dim_gj_19)
         )
         ((= "19" gj_done_id)
           (dim_gj_20)
         )
         ((= "20" gj_done_id)
           (dim_gj_21)
         )
         ((= "21" gj_done_id)
           (dim_gj_22)
         )
         ((= "22" gj_done_id)
           (dim_gj_23)
         )
          ((= "23" gj_done_id)
           (dim_gj_24)
         )
  

  )
   ;(mold_res)
  )
 )
 (princ)
)

  
 
  


(defun dim_gj_1 () (command "jmj" "e15" pause "" "" "" ""))
(defun dim_gj_2 () (command "jmj" "e20" pause "" "" "" ""))
(defun dim_gj_3 () (command "jmj" "e25" pause "" "" "" ""))
(defun dim_gj_4 () (command "jmj" "e40" pause "" "" "" ""))
(defun dim_gj_5 () (command "jmj" "e50" pause "" "" "" ""))
(defun dim_gj_6 () (command "jmj" "e65" pause "" "" "" ""))
(defun dim_gj_7 () (command "jmj" "e80" pause "" "" "" ""))
(defun dim_gj_8 () (command "jmj" "e100" pause "" "" "" ""))
(defun dim_gj_9 () (command "jmj" "e125" pause "" "" "" ""))
(defun dim_gj_10 () (command "jmj" "e150" pause "" "" "" ""))
(defun dim_gj_11 () (command "jmj" "e200" pause "" "" "" ""))
(defun dim_gj_12 () (command "jmj" "e250" pause "" "" "" ""))
(defun dim_gj_13 () (command "jmj" "e300" pause "" "" "" ""))
(defun dim_gj_14 () (command "jmj" "e350" pause "" "" "" ""))
(defun dim_gj_15 () (command "jmj" "e400" pause "" "" "" ""))
(defun dim_gj_16 () (command "jmj" "e450" pause "" "" "" ""))
(defun dim_gj_17 () (command "jmj" "e500" pause "" "" "" ""))
(defun dim_gj_18 () (command "jmj" "e600" pause "" "" "" ""))
(defun dim_gj_19 () (command "jmj" "e700" pause "" "" "" ""))
(defun dim_gj_20 () (command "jmj" "e800" pause "" "" "" ""))
(defun dim_gj_21 () (command "jmj" "e900" pause "" "" "" ""))
(defun dim_gj_22 () (command "jmj" "e1000" pause "" "" "" ""))
(defun dim_gj_23 () (command "jmj" "e1100" pause "" "" "" ""))
(defun dim_gj_24 () (command "jmj" "e1200" pause "" "" "" ""))


(princ)

本帖子中包含更多资源

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

x
发表于 2008-11-9 16:33:00 | 显示全部楼层

修改成这样即可

(defun dim_crk_1 () (command "-insert" "1.dwg" pause "" "" "" ""))
(defun dim_crk_2 () (command "-insert" "2.dwg" pause "" "" "" ""))


 楼主| 发表于 2008-11-9 16:39:00 | 显示全部楼层
120120发表于2008-11-9 16:33:00修改成这样即可(defun dim_crk_1 () (command \"-insert\" \"1.dwg\" pause \"\" \"\" \"\" \"\"))(defun dim_crk_2 () (command \"-insert\" \"2.dwg\" pause \"\" \"\" \"\" \"\"))

我晕,服你了,不要瞎搞

发表于 2008-11-9 16:55:00 | 显示全部楼层

试下:

(DEFUN c:crk ()  
 (setq dcl_id (load_dialog "crk"))
 (new_dialog "crk" dcl_id)

(action_tile "accept" "(setq crk_done_id (get_tile\"crk_1\"))(done_dialog 1)")

(if (> crk_done_id 0)
  (progn  
   (setvar "osmode" 0)
   (cond ((= "0" crk_done_id)
   (dim_crk_1)
         )
         ((= "1" crk_done_id)
   (dim_crk_2)
         )
 
   )
   ;(mold_res)
  )
 )
 (princ)
)

 楼主| 发表于 2008-11-9 17:17:00 | 显示全部楼层
jxlsp发表于2008-11-9 16:55:00试下DEFUN c:crk ()    (setq dcl_id (load_dialog \"crk\")) (new_dialog \"crk\" dcl_id)(action_tile \"accept\" \"(setq crk_done_id (get_tile\\"crk_1\\"))(done_

按了确定就没有反应了!再帮我看看吧!

发表于 2008-11-9 18:02:00 | 显示全部楼层

(DEFUN c:crk ()  
 (setq dcl_id (load_dialog "crk"))
 (new_dialog "crk" dcl_id)

(action_tile "accept" "(setq crk_done_id (get_tile\"crk_1\"))(done_dialog 1)")

(setq crk_done(start_dialog))
(unload_dialog dcl_id)

(if (> crk_done 0)
  (progn  
   (setvar "osmode" 0)
   (cond ((= "0" crk_done_id)
   (dim_crk_1)
         )
         ((= "1" crk_done_id)
   (dim_crk_2)
         )
 
   )
   ;(mold_res)
  )
 )
 (princ)
)

 楼主| 发表于 2008-11-9 18:16:00 | 显示全部楼层

非常感谢!

 楼主| 发表于 2008-11-9 20:52:00 | 显示全部楼层
问题又来了,帮我看一下!
 楼主| 发表于 2008-11-10 13:55:00 | 显示全部楼层
ding
发表于 2008-11-10 17:19:00 | 显示全部楼层

提个小意见!

你这一排排的 cond看的有点晕~写出来更晕~

   (cond ((= "0" gj_done_id)
          (dim_gj_1)
         )
         ((= "1" gj_done_id)
           (dim_gj_2)
         )

 .....................

不如这样: (eval (read (strcat "(dim_gj_" gj_done_id ")")))

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

本版积分规则

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

GMT+8, 2025-9-21 14:36 , Processed in 0.261670 second(s), 27 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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