天气与日历 切换到窄版

 找回密码
 立即注册
中国膜结构网
十大进口膜材评选 十大国产膜材评选 十大膜结构设计评选 十大膜结构公司评选
查看: 53|回复: 1

通用按键二维 dcl 通用面板

[复制链接]
  • TA的每日心情
    开心
    4 天前
  • 签到天数: 49 天

    [LV.5]常住居民I

    185

    主题

    150

    回帖

    1695

    积分

    管理员

    积分
    1695
    发表于 2024-4-8 21:49:43 | 显示全部楼层 |阅读模式
    1. ;通用按键二维面板
    2. ;
    3. ;
    4. (defun BT-UI-BT(tit s / #BT-KS bt-dcl bt-format)
    5.   (vl-load-com)
    6.         (defun BT-FORMAT (tit s / i str);格式化               
    7.                 (setq i 1)
    8.                 (append
    9.                         (list "btbt:button{horizontal_margin = none ;vertical_margin = none ;}";格式化按钮fixed_width = true ;width = 20;
    10.                                 (strcat "BTUI:dialog{label = " (vl-prin1-to-string tit)";");标题
    11.                                 (if(= 'str(type(setq str(car s))))
    12.                                         (progn (setq s(cdr s))(strcat ":boxed_row{label=""str"";"))
    13.                                         ":row{");如果是字符串
    14.                         )
    15.                         (apply 'append
    16.                                 (mapcar
    17.                                         '(lambda(a)
    18.                                                  (append
    19.                                                          (list
    20.                                                                  (if (= 'str(type(setq str(car a))))
    21.                                                                          (progn(setq a(cdr a))(strcat":boxed_column{label=""str"";"))
    22.                                                                          ":column{")
    23.                                                                  ;"children_fixed_height="true";"
    24.                                                          ;"children_alignment="top";"
    25.                                                          );如果是字符串
    26.                                                          (mapcar
    27.                                                                  '(lambda(b / c d)
    28.                                                                                 (setq c (strcat ":btbt{label = " (if(=""(car b))""""(vl-prin1-to-string(car b))) " ; key = "(vl-prin1-to-string (strcat "bt" (setq d (itoa (setq i (1+ i))))))";}"))
    29.                                                                                 (setq #BT-KS (append #BT-KS (list(cons d (cadr b)))))
    30.                                                                                 c
    31.                                                                         )
    32.                                                                  a
    33.                                                          )                                                 
    34.                                                          (list "}")
    35.                                                  )
    36.                                          )
    37.                                         s
    38.                                 )                                       
    39.                         )
    40.                         (list "}"
    41.                                 ":image{color=2;height=0.2;}"
    42.                                 "ok_only;"
    43.                                 "}"
    44.                         )
    45.                 )
    46.         )       
    47.         ;;-------------------------------------------------
    48.         (defun BT-DCL (tit s / cmd f ff id ui)
    49.                 (setq f (strcat (getenv "temp") "\\BTBT.DCL"))
    50.                 (if (findfile f) (vl-file-delete f))
    51.                 (setq ff (open f "W"))
    52.                 (foreach x (BT-FORMAT tit s)
    53.                         (princ (strcat x "\n") ff)
    54.                 )
    55.                 (close ff)
    56.                 (setq ui (load_dialog f))
    57.                 (if(not(new_dialog "BTUI" ui))(exit))
    58.                 (foreach x #BT-KS
    59.                         (action_tile (strcat "bt" (car x))
    60.                                 (strcat "(done_dialog  " (car x)")")
    61.                         )                       
    62.                 )
    63.                 (setq id (start_dialog))
    64.                 (unload_dialog ui)
    65.                 (vl-file-delete f)
    66.                 (if (and (< 1 id)
    67.                                         (setq cmd (assoc (itoa id) #BT-KS))
    68.                                         (setq cmd (cdr cmd))
    69.                                         (= 'str (type cmd))
    70.                                         (read cmd)
    71.                                 )
    72.                         (vla-SendCommand (vla-get-ActiveDocument(vlax-get-acad-object)) (strcat cmd " "))
    73.                         ;(print(strcat"你调用的命令为:" (if(= ""cmd)"空" cmd)))
    74.                 )
    75.         )
    76.         (BT-DCL tit s)
    77. )
    78. ;;-------------------------------------------------
    复制代码

     

     

     

     

    通用按键二维 dcl 通用面板
    哎...膜结构车棚,签到来了1...
  • TA的每日心情
    开心
    4 天前
  • 签到天数: 49 天

    [LV.5]常住居民I

    185

    主题

    150

    回帖

    1695

    积分

    管理员

    积分
    1695
     楼主| 发表于 2024-4-8 21:50:11 | 显示全部楼层



    1.         (defun c:tt()
    2.                 (bt-ui-bt "标题" '(
    3.                                                                                         ("工具1"("圆""c")("线""l"))
    4.                                                                                         (("标注""dli")("工具4"""))
    5.                                                                                 )
    6.                
    7.         ))

    8. ;通用按键二维面板,小波简化版2023.1.8
    9. (defun BT-UI-BT(tit s / #BT-KS bt-dcl bt-format)
    10.         (defun BT-FORMAT (tit s / i str);格式化               
    11.                 (setq i 1)
    12.                 (append
    13.                         (list "btbt:button{horizontal_margin = none ;vertical_margin = none ;}";格式化按钮fixed_width = true ;width = 20;
    14.                                 (strcat "BTUI:dialog{label = " (vl-prin1-to-string tit)";");标题
    15.                                 (if(= 'str(type(setq str(car s))))
    16.                                         (progn (setq s(cdr s))(strcat ":boxed_row{label=""str"";"))
    17.                                         ":row{");如果是字符串
    18.                         )
    19.                         (apply 'append
    20.                                 (mapcar
    21.                                         '(lambda(a)
    22.                                                  (append
    23.                                                          (list
    24.                                                                  (if (= 'str(type(setq str(car a))))
    25.                                                                          (progn(setq a(cdr a))(strcat":boxed_column{label=""str"";"))
    26.                                                                          ":column{")
    27.                                                                  ;"children_fixed_height="true";"
    28.                                                          ;"children_alignment="top";"
    29.                                                          );如果是字符串
    30.                                                          (mapcar
    31.                                                                  '(lambda(b / c d)
    32.                                                                                 (setq c (strcat ":btbt{label = " (if(=""(car b))""""(vl-prin1-to-string(car b))) " ; key = "(vl-prin1-to-string (strcat "bt" (setq d (itoa (setq i (1+ i))))))";}"))
    33.                                                                                 (setq #BT-KS (append #BT-KS (list(cons d (cadr b)))))
    34.                                                                                 c
    35.                                                                         )
    36.                                                                  a
    37.                                                          )                                                 
    38.                                                          (list "}")
    39.                                                  )
    40.                                          )
    41.                                         s
    42.                                 )                                       
    43.                         )
    44.                         (list "}"
    45.                                 ":image{color=2;height=0.2;}"
    46.                                 "ok_only;"
    47.                                 "}"
    48.                         )
    49.                 )
    50.         )       
    51.         ;;-------------------------------------------------
    52.         (defun BT-DCL (tit s / cmd f ff id ui)
    53.                 (setq f (strcat (getenv "temp") "\\BTBT.DCL"))
    54.                 (if (findfile f) (vl-file-delete f))
    55.                 (setq ff (open f "W"))
    56.                 (foreach x (BT-FORMAT tit s)
    57.                         (princ (strcat x "\n") ff)
    58.                 )
    59.                 (close ff)
    60.                 (setq ui (load_dialog f))
    61.                 (if(not(new_dialog "BTUI" ui))(exit))
    62.                 (foreach x #BT-KS
    63.                         (action_tile (strcat "bt" (car x))
    64.                                 (strcat "(done_dialog  " (car x)")")
    65.                         )                       
    66.                 )
    67.                 (setq id (start_dialog))
    68.                 (unload_dialog ui)
    69.                 (vl-file-delete f)
    70.                 (if (and (< 1 id)
    71.                                         (setq cmd (assoc (itoa id) #BT-KS))
    72.                                         (setq cmd (cdr cmd))
    73.                                         (= 'str (type cmd))
    74.                                         (read cmd)
    75.                                 )
    76.                         (vla-SendCommand (vla-get-ActiveDocument(vlax-get-acad-object)) (strcat cmd " "))
    77.                         ;(print(strcat"你调用的命令为:" (if(= ""cmd)"空" cmd)))
    78.                 )
    79.         )
    80.         (BT-DCL tit s)
    81. )
    82. ;;-------------------------------------------------
    复制代码

     

     

     

     

    通用按键二维 dcl 通用面板
    哎...膜结构车棚,签到来了1...
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|Archiver|手机版|中国膜结构网_中国空间膜结构协会

    GMT+8, 2024-5-15 14:28 , Processed in 0.058412 second(s), 21 queries .

    Powered by Discuz! X3.5

    © 2001-2024 Discuz! Team.

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