乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
楼主: woodman78

[编程交流] DCL单选按钮

[复制链接]

145

主题

590

帖子

446

银币

中流砥柱

Rank: 25

铜币
725
发表于 2022-7-6 11:58:56 | 显示全部楼层
谢谢你的秃鹰。我想做的是像你做的那样,但不是有一列使窗口变长,而是有两列,但与你的盒子一样?这可能吗??
回复

使用道具 举报

32

主题

1166

帖子

1146

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
159
发表于 2022-7-6 12:01:54 | 显示全部楼层
 
 
很多事情都是可能的,但试着去尝试。您需要取出第二组按钮上的(:row{)及其结束括号(})。尽量保持格式整洁。
 
我建议您尝试使用弹出列表来节省空间,而不是单选按钮。如果我有时间,我可以为你做个榜样。我现在只是有点忙。弹出列表将为您节省大量空间,但会涉及更少的dcl编码和更多的lsp编码。只是一些你需要学习的新东西。
 
祝你好运
回复

使用道具 举报

145

主题

590

帖子

446

银币

中流砥柱

Rank: 25

铜币
725
发表于 2022-7-6 12:07:05 | 显示全部楼层
我把那只秃鹰分类了,但遇到了另一个小问题。加载对话框后,我可以每行选择一项。我一直在看网上的例子,他们似乎只有一个或一个专栏,每个装箱_列。
 
  1. radio1 : dialog {                                 //*dialog name
  2.        label = "Existing Storm Sewers";         //*give it a label
  3.       
  4.       : row {                                  //*define row
  5.          : column {                             //*define column
  6.           : boxed_radio_column {               //*define radio column
  7.              label = "Choose a Type";           //*give it a label
  8.                    : row {                                  //*define row
  9.               : radio_button {                   //*define radion button
  10.                 key = "T1";                      //*give it a name
  11.                 label = "Type &1";               //*give it a label
  12.               //value = "1";                     //*switch it on
  13.               }                                  //*end definition
  14.               : radio_button {                   //*define radio button
  15.                 key = "T3";                      //*give it a name
  16.                 label = "Type &3";               //*give it a label
  17.               }                                  //*end definition
  18.                    }                                        //*end row
  19.                    : row {                                  //*define row
  20.               : radio_button {                   //*define radio button
  21.                 key = "T2";                      //*give it a name
  22.                 label = "Type &2";               //*give it a label
  23.               }                                  //*end definition
  24.               : radio_button {                   //*define radio button
  25.                 key = "T4" ;                     //*give it a name
  26.                 label = "Type &4";               //*give it a label
  27.               }                                  //*end definition
  28.                     }                                        //*end row
  29.           }                                    //*end boxed_radio_column
  30.          }                                      //*end column
  31.       }                                        //*end row
  32.       : row {                                  //*define row
  33.          : column {                             //*define column
  34.            : boxed_radio_column {               //*define radio column
  35.              label = "Choose a Size";           //*give it a label
  36.                    : row {                                  //*define row
  37. : radio_button {                   //*define radion button
  38.                 key = "S1" ;                     //*give it a name
  39.                 label = "1500mm";                //*give it a label
  40.               value = "1";                     //*switch it on
  41.               }                                  //*end definition
  42.               : radio_button {                   //*define radio button
  43.                 key = "S2";                      //*give it a name
  44.                 label = "1350mm";                //*give it a label
  45.               }                                  //*end definition
  46.                    }                                        //*end row
  47.                    : row {                                  //*define row
  48.               : radio_button {                   //*define radio button
  49.                 key = "S3";                      //*give it a name
  50.                 label = "1200mm";                //*give it a label
  51.               }                                  //*end definition
  52.               : radio_button {                   //*define radio button
  53.                 key = "S4";                      //*give it a name
  54.                 label = "1050mm";                //*give it a label
  55.               }                                  //*end definition
  56.                    }                                        //*end row
  57.                    : row {                                  //*define row
  58.               : radio_button {                   //*define radio button
  59.                 key = "S5";                      //*give it a name
  60.                 label = "900mm";                     //*give it a label
  61.               }                                  //*end definition
  62.               : radio_button {                   //*define radio button
  63.                 key = "S6";                      //*give it a name
  64.                 label = "750mm";                     //*give it a label
  65.               }                                  //*end definition
  66.                    }                                        //*end row
  67.                    : row {                                  //*define row
  68.               : radio_button {                   //*define radio button
  69.                 key = "S7";                      //*give it a name
  70.                 label = "675mm";                     //*give it a label
  71.               }                                  //*end definition
  72.               : radio_button {                   //*define radio button
  73.                 key = "S8";                      //*give it a name
  74.                 label = "600mm";                     //*give it a label
  75.               }                                  //*end definition
  76.                    }                                        //*end row
  77.                    : row {                                  //*define row
  78.               : radio_button {                   //*define radio button
  79.                 key = "S9";                      //*give it a name
  80.                 label = "525mm";                     //*give it a label
  81.               }                                  //*end definition
  82.               : radio_button {                   //*define radio button
  83.                 key = "S10";                     //*give it a name
  84.                 label = "450mm";                     //*give it a label
  85.               }                                  //*end definition
  86.                    }                                        //*end row
  87.                    : row {                                  //*define row
  88.               : radio_button {                   //*define radio button
  89.                 key = "S11";                     //*give it a name
  90.                 label = "375mm";                     //*give it a label
  91.               }                                  //*end definition
  92.               : radio_button {                   //*define radio button
  93.                 key = "S12";                     //*give it a name
  94.                 label = "300mm";                     //*give it a label
  95.               }                                  //*end definition
  96.                    }                                        //*end row
  97.                    : row {                                  //*define row
  98.               : radio_button {                   //*define radio button
  99.                 key = "S13";                     //*give it a name
  100.                 label = "225mm";                     //*give it a label
  101.               }                                  //*end definition
  102.               : radio_button {                   //*define radio button
  103.                 key = "S14";                     //*give it a name
  104.                 label = "150mm";                     //*give it a label
  105.               }                                  //*end definition
  106.                    }                                        //*end row
  107.            }                                    //*end boxed_radio_column
  108.          }                                      //*end column
  109.        }                                        //*end row
  110.        : row {                                    //*define row
  111.          : column {                               //*define column
  112.            ok_cancel ;                            //*predifined OK/Cancel
  113.            : paragraph {                          //*define paragraph
  114.              : text_part {                        //*define more text
  115.                label = "CCC NNRDO       v1.0.21.07.2009";           //*some more text
  116.              }                                    //*end text
  117.            }                                      //*end paragraph
  118.          }                                        //*end column
  119.        }                                          //*end row
  120.      }                                            //*end dialog

 
我来看看弹出列表。我认识我办公室里的人,如果他们必须滚动2个弹出列表才能找到他们正在查找的内容,他们会大吃一惊!!如果你正在做一个复杂的排水图,那么收音机要快得多。
 
谢谢你的推送!!!
122623e2r79kyb3kzz9bcp.png
回复

使用道具 举报

32

主题

1166

帖子

1146

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
159
发表于 2022-7-6 12:10:11 | 显示全部楼层
你能发代码吗?
我来看看。
回复

使用道具 举报

32

主题

1166

帖子

1146

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
159
发表于 2022-7-6 12:12:39 | 显示全部楼层
本规范已修订。
不再有错误的参数零错误。
DCL包含四个单选按钮,带有弹出列表。
按钮和列表将保存绘图任务的最后一个条目。
程序也有一个内置循环。
只要记住,弹出列表仍然比没有代码更快。
通过添加的功能,这是一种非常快速和紧凑的方法。
 
DCL
  1. popup : dialog {                                 //*dialog name
  2.        label = "Existing Storm Sewers";         //*give it a label
  3.        : row {                                  //*define row
  4.          : column {                             //*define column
  5.            : boxed_radio_column {               //*define radio column
  6.              label = "Choose a Type";           //*give it a label
  7.              : radio_button {                   //*define radion button
  8.                key = "T1";                      //*give it a name
  9.                label = "Type &1";               //*give it a label
  10.              //value = "1";                     //*switch it on
  11.              }                                  //*end definition
  12.              : radio_button {                   //*define radio button
  13.                key = "T2";                      //*give it a name
  14.                label = "Type &2";               //*give it a label
  15.              }                                  //*end definition
  16.              : radio_button {                   //*define radio button
  17.                key = "T3";                      //*give it a name
  18.                label = "Type &3";               //*give it a label
  19.              }                                  //*end definition
  20.              : radio_button {                   //*define radio button
  21.                key = "T4" ;                     //*give it a name
  22.                label = "Type &4";               //*give it a label
  23.              }                                  //*end definition
  24.            }                                    //*end boxed_radio_column
  25.          }                                      //*end column
  26.        }                                        //*end row
  27.        : row {                                  //*define row
  28.          : boxed_column {                       //*define boxex_column
  29.            : popup_list {
  30.              label = "Choose a Size";           //*give it a label
  31.              key = "S1";
  32.              edit_width = 8;
  33.            }
  34.            : spacer {
  35.              height = 0;
  36.            }
  37.          }                                      //*end boxed_column
  38.        }                                        //*end row
  39.        : row {                                    //*define row
  40.          : column {                               //*define column
  41.            ok_cancel ;                            //*predifined OK/Cancel
  42.            : paragraph {                          //*define paragraph
  43.              : text_part {                        //*define text
  44.                label = "Designed by Brian Deasy"; //*give it some text
  45.              }                                    //*end text
  46.              : text_part {                        //*define more text
  47.                label = "for CCC NNRDO";           //*some more text
  48.              }                                    //*end text
  49.            }                                      //*end paragraph
  50.          }                                        //*end column
  51.        }                                          //*end row
  52.      }                                            //*end dialog

 
LSP
  1. (defun C:POPUP ()
  2. (POPUP_MF)
  3. (princ)
  4. )
  5. (defun POPUP_MF (/ SIZE$ SIZE# HOLE SIZE)
  6. (or H:OLE (setq H:OLE "T1"))
  7. (setq SIZE 1500)
  8. (setq S1_list
  9.   '("1500mm" "1350mm"
  10.     "1250mm" "1050mm"
  11.      "900mm"  "750mm"
  12.      "675mm"  "600mm"
  13.      "525mm"  "450mm"
  14.      "375mm"  "300mm"
  15.      "225mm"  "150mm"))
  16. (setq dcl_id (load_dialog "popup.dcl"))
  17. (if (not (new_dialog "popup" dcl_id))
  18.    (progn
  19.      (alert "Can not find your dcl file")
  20.      (exit)))
  21. (start_list "S1")
  22. (mapcar 'add_list S1_list)
  23. (end_list)
  24. (set_tile H:OLE "1")
  25. (action_tile "T1"
  26.   "(setq H:OLE "T1")")
  27. (action_tile "T2"
  28.   "(setq H:OLE "T2")")
  29. (action_tile "T3"
  30.   "(setq H:OLE "T3")")
  31. (action_tile "T4"
  32.   "(setq H:OLE "T4")")
  33. (if SIZE:DEF
  34.    (set_tile "S1" (itoa SIZE:DEF)))
  35. (action_tile "cancel"
  36.   "(done_dialog)(setq userclick nil)")
  37. (action_tile "accept"
  38.    (strcat
  39.     "(progn
  40.      (setq S:IZE (atoi (get_tile "S1")) SIZE:DEF S:IZE)"
  41.     "(done_dialog)(setq userclick T))"))
  42. (start_dialog)
  43. (unload_dialog dcl_id)
  44. (if userclick
  45.    (VARIABLE)
  46. )
  47. (princ)
  48. )
  49. (defun VARIABLE ()
  50. (progn
  51.    (cond
  52.      ((= H:OLE "T1"))
  53.      ((= H:OLE "T2"))
  54.      ((= H:OLE "T3"))
  55.      ((= H:OLE "T4"))
  56.    )
  57. )
  58. (setq HOLE H:OLE)
  59. (progn
  60.    (setq SIZE$ (fix S:IZE))
  61.    (setq SIZE$ (nth S:IZE S1_list))
  62.    (cond
  63.      ((= SIZE$ "1500mm")(setq SIZE# 1500))
  64.      ((= SIZE$ "1350mm")(setq SIZE# 1350))
  65.      ((= SIZE$ "1250mm")(setq SIZE# 1250))
  66.      ((= SIZE$ "1050mm")(setq SIZE# 1050))
  67.      ((= SIZE$  "900mm")(setq SIZE#  900))
  68.      ((= SIZE$  "750mm")(setq SIZE#  750))
  69.      ((= SIZE$  "675mm")(setq SIZE#  675))
  70.      ((= SIZE$  "600mm")(setq SIZE#  600))
  71.      ((= SIZE$  "525mm")(setq SIZE#  525))
  72.      ((= SIZE$  "450mm")(setq SIZE#  450))
  73.      ((= SIZE$  "375mm")(setq SIZE#  375))
  74.      ((= SIZE$  "300mm")(setq SIZE#  300))
  75.      ((= SIZE$  "225mm")(setq SIZE#  225))
  76.      ((= SIZE$  "150mm")(setq SIZE#  150))
  77.    )
  78. )
  79. (setq SIZE (RTOS SIZE# 2 0))
  80. (ANSWER)
  81. (princ)
  82. )
  83. (defun ANSWER ()
  84. (progn
  85.    (ALERT (strcat "Hole selected is: "HOLE""))
  86.    (ALERT (strcat "Size selected is: "SIZE"mm"))
  87. )
  88. (POPUP_MF)
  89. (princ)
  90. )

122624pq4pxpsrnxaprzzp.jpg
回复

使用道具 举报

32

主题

1166

帖子

1146

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
159
发表于 2022-7-6 12:14:25 | 显示全部楼层
现在有两个弹出列表,它们以相同的方式工作。
你没有让程序报告你选择的内容,而是
可以使用变量执行或在函数中使用。
请注意,变量大小#用于实数,以防需要使用实数。
我不知道你是否需要这个,但我还是包括了它。
我希望这些例子能给你提供一个可以做什么的想法
通过编程。
 
DCL
  1. popup2 : dialog {                                   //*dialog name
  2.         label = "Existing Storm Sewers";           //*give it a label
  3.         : row {                                    //*define row
  4.           : boxed_column {                         //*define boxex_column
  5.             : popup_list {
  6.               label = "Choose a Hole Type";        //*give it a label
  7.               key = "T1";
  8.               edit_width = 8;
  9.             }
  10.             : spacer {
  11.               height = 0;
  12.             }
  13.           }                                        //*end column
  14.         }                                          //*end row
  15.         : row {                                    //*define row
  16.           : boxed_column {                         //*define boxex_column
  17.             : popup_list {
  18.               label = "Choose a Size";             //*give it a label
  19.               key = "S1";
  20.               edit_width = 8;
  21.             }
  22.             : spacer {
  23.               height = 0;
  24.             }
  25.           }                                        //*end boxed_column
  26.         }                                          //*end row
  27.         : row {                                    //*define row
  28.           : column {                               //*define column
  29.             ok_cancel ;                            //*predifined OK/Cancel
  30.             : paragraph {                          //*define paragraph
  31.               : text_part {                        //*define text
  32.                 label = "Designed by Brian Deasy"; //*give it some text
  33.               }                                    //*end text
  34.               : text_part {                        //*define more text
  35.                 label = "for CCC NNRDO";           //*some more text
  36.               }                                    //*end text
  37.             }                                      //*end paragraph
  38.           }                                        //*end column
  39.         }                                          //*end row
  40.       }                                            //*end dialog

LSP
  1. (defun C:POPUP2 ()
  2. (POPUP_MF)
  3. (princ)
  4. )
  5. (defun POPUP_MF (/ HOLE$ SIZE$ SIZE# HOLE SIZE)
  6. (setq SIZE# 1500)
  7. (setq T1_list
  8.   '("Type 1" "Type 2"
  9.     "Type 3" "Type 4"))
  10. (setq S1_list
  11.   '("1500mm" "1350mm"
  12.     "1200mm" "1050mm"
  13.      "900mm"  "750mm"
  14.      "675mm"  "600mm"
  15.      "525mm"  "450mm"
  16.      "375mm"  "300mm"
  17.      "225mm"  "150mm"))
  18. (setq dcl_id (load_dialog "popup2.dcl"))
  19. (if (not (new_dialog "popup2" dcl_id))
  20.    (progn
  21.      (alert "Can not find your dcl file")
  22.      (exit)))
  23. (start_list "T1")
  24. (mapcar 'add_list T1_list)
  25. (end_list)
  26. (start_list "S1")
  27. (mapcar 'add_list S1_list)
  28. (end_list)
  29. (if HOLE2:DEF
  30.    (set_tile "T1" (itoa HOLE2:DEF)))
  31. (if SIZE2:DEF
  32.    (set_tile "S1" (itoa SIZE2:DEF)))
  33. (action_tile "cancel"
  34.   "(done_dialog)(setq userclick nil)")
  35. (action_tile "accept"
  36.    (strcat
  37.     "(progn
  38.      (setq H:OLE2 (atoi (get_tile "T1")) HOLE2:DEF H:OLE2)"
  39.     "(setq S:IZE2 (atoi (get_tile "S1")) SIZE2:DEF S:IZE2)"
  40.     "(done_dialog)(setq userclick T))"))
  41. (start_dialog)
  42. (unload_dialog dcl_id)
  43. (if userclick
  44.    (VARIABLE)
  45. )
  46. (princ)
  47. )
  48. (defun VARIABLE ()
  49. (progn
  50.    (setq HOLE$ (fix H:OLE2))
  51.    (setq HOLE$ (nth H:OLE2 T1_list))
  52.    (cond
  53.      ((= HOLE$ "TYPE 1"))
  54.      ((= HOLE$ "TYPE 2"))
  55.      ((= HOLE$ "TYPE 3"))
  56.      ((= HOLE$ "TYPE 4"))
  57.    )
  58. )
  59. (setq HOLE HOLE$)
  60. (progn
  61.    (setq SIZE$ (fix S:IZE2))
  62.    (setq SIZE$ (nth S:IZE2 S1_list))
  63.    (cond
  64.      ((= SIZE$ "1500mm")(setq SIZE# 1500))
  65.      ((= SIZE$ "1350mm")(setq SIZE# 1350))
  66.      ((= SIZE$ "1200mm")(setq SIZE# 1200))
  67.      ((= SIZE$ "1050mm")(setq SIZE# 1050))
  68.      ((= SIZE$  "900mm")(setq SIZE#  900))
  69.      ((= SIZE$  "750mm")(setq SIZE#  750))
  70.      ((= SIZE$  "675mm")(setq SIZE#  675))
  71.      ((= SIZE$  "600mm")(setq SIZE#  600))
  72.      ((= SIZE$  "525mm")(setq SIZE#  525))
  73.      ((= SIZE$  "450mm")(setq SIZE#  450))
  74.      ((= SIZE$  "375mm")(setq SIZE#  375))
  75.      ((= SIZE$  "300mm")(setq SIZE#  300))
  76.      ((= SIZE$  "225mm")(setq SIZE#  225))
  77.      ((= SIZE$  "150mm")(setq SIZE#  150))
  78.    )
  79. )
  80. (setq SIZE (RTOS SIZE# 2 0))
  81. (ANSWER)
  82. (princ)
  83. )
  84. (defun ANSWER ()
  85. (progn
  86.    (ALERT (strcat "Hole selected is: "HOLE" "))
  87.    (ALERT (strcat "Size selected is: "SIZE"mm "))
  88. )
  89. (POPUP_MF)
  90. (princ)
  91. )

122626ic3hbuktztich0hd.jpg
回复

使用道具 举报

145

主题

590

帖子

446

银币

中流砥柱

Rank: 25

铜币
725
发表于 2022-7-6 12:19:22 | 显示全部楼层
谢谢你的秃鹰。我不得不说,这是一个非常巧妙的解决方案,我运行得越多,我就越倾向于使用弹出框。我保持了dcl不变,并尝试在应答例程中修改lsp,如下所示,使用孔和尺寸创建线型名称和图层名称,然后像以前一样通过多段线运行。我得到了坏的功能错误。我想我说的对,在回答孔和大小已经转换为字符串,所以我不需要再转换了。对吗???
 
 
 
  1. (defun C:POPUP3 ()
  2. (POPUP_MF)
  3. (princ)
  4. )
  5. (defun POPUP_MF (/ HOLE$ SIZE$ SIZE# HOLE SIZE a b)
  6. (setq SIZE# 1500)
  7. (setq T1_list
  8.   '("Type 1" "Type 2"
  9.     "Type 3" "Type 4"))
  10. (setq S1_list
  11.   '("1500mm" "1350mm"
  12.     "1200mm" "1050mm"
  13.      "900mm"  "750mm"
  14.      "675mm"  "600mm"
  15.      "525mm"  "450mm"
  16.      "375mm"  "300mm"
  17.      "225mm"  "150mm"))
  18. (setq dcl_id (load_dialog "popup2.dcl"))
  19. (if (not (new_dialog "popup2" dcl_id))
  20.    (progn
  21.      (alert "Can not find your dcl file")
  22.      (exit)))
  23. (start_list "T1")
  24. (mapcar 'add_list T1_list)
  25. (end_list)
  26. (start_list "S1")
  27. (mapcar 'add_list S1_list)
  28. (end_list)
  29. (if HOLE2:DEF
  30.    (set_tile "T1" (itoa HOLE2:DEF)))
  31. (if SIZE2:DEF
  32.    (set_tile "S1" (itoa SIZE2:DEF)))
  33. (action_tile "cancel"
  34.   "(done_dialog)(setq userclick nil)")
  35. (action_tile "accept"
  36.    (strcat
  37.     "(progn
  38.      (setq H:OLE2 (atoi (get_tile "T1")) HOLE2:DEF H:OLE2)"
  39.     "(setq S:IZE2 (atoi (get_tile "S1")) SIZE2:DEF S:IZE2)"
  40.     "(done_dialog)(setq userclick T))"))
  41. (start_dialog)
  42. (unload_dialog dcl_id)
  43. (if userclick
  44.    (VARIABLE)
  45. )
  46. (princ)
  47. )
  48. (defun VARIABLE ()
  49. (progn
  50.    (setq HOLE$ (fix H:OLE2))
  51.    (setq HOLE$ (nth H:OLE2 T1_list))
  52.    (cond
  53.      ((= HOLE$ "TYPE 1"))
  54.      ((= HOLE$ "TYPE 2"))
  55.      ((= HOLE$ "TYPE 3"))
  56.      ((= HOLE$ "TYPE 4"))
  57.    )
  58. )
  59. (setq HOLE HOLE$)
  60. (progn
  61.    (setq SIZE$ (fix S:IZE2))
  62.    (setq SIZE$ (nth S:IZE2 S1_list))
  63.    (cond
  64.      ((= SIZE$ "1500mm")(setq SIZE# 1500))
  65.      ((= SIZE$ "1350mm")(setq SIZE# 1350))
  66.      ((= SIZE$ "1200mm")(setq SIZE# 1200))
  67.      ((= SIZE$ "1050mm")(setq SIZE# 1050))
  68.      ((= SIZE$  "900mm")(setq SIZE#  900))
  69.      ((= SIZE$  "750mm")(setq SIZE#  750))
  70.      ((= SIZE$  "675mm")(setq SIZE#  675))
  71.      ((= SIZE$  "600mm")(setq SIZE#  600))
  72.      ((= SIZE$  "525mm")(setq SIZE#  525))
  73.      ((= SIZE$  "450mm")(setq SIZE#  450))
  74.      ((= SIZE$  "375mm")(setq SIZE#  375))
  75.      ((= SIZE$  "300mm")(setq SIZE#  300))
  76.      ((= SIZE$  "225mm")(setq SIZE#  225))
  77.      ((= SIZE$  "150mm")(setq SIZE#  150))
  78.    )
  79. )
  80. (setq SIZE (RTOS SIZE# 2 0))
  81. (ANSWER)
  82. (princ)
  83. )
  84. (defun ANSWER ()
  85. (progn
  86.    ;(ALERT (strcat "Hole selected is: "HOLE" "))
  87.    ;(ALERT (strcat "Size selected is: "SIZE"mm "))
  88.         (setq a (strcat "CCC_DR_" (SIZE)(HOLE))
  89.               b (strcat "CCC_SERVICES_EXISTING_Drainage_Storm_Sewer_" (SIZE)))
  90.         (if (not (tblsearch "LTYPE" a))
  91.              (command "_.-linetype" "_l" a "acadiso.lin" ""))
  92.              (command "._-layer"   "_N"   b   "_M"   b   "_L"   a  b   "_C"   "84"   b   "_LW"   "0.3"   b    "" )
  93. (command "pline" pause "width" "0.0" "0.0" pause "width" "0.0" "0.0")
  94. )
  95. (POPUP_MF)
  96. (princ)
  97. )
回复

使用道具 举报

32

主题

1166

帖子

1146

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
159
发表于 2022-7-6 12:21:28 | 显示全部楼层
 
我很高兴你看到了光明,是的,在这一点上,他们是弦。如果你卡住了,就告诉我。
我会看一下新增内容,稍后再给你回复。
回复

使用道具 举报

32

主题

1166

帖子

1146

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
159
发表于 2022-7-6 12:23:39 | 显示全部楼层
 
 
伍德曼78,
 
同样,我没有你的线型,所以我在这里蒙着眼睛工作。
使用以下dcl和lsp。我不得不从你身上去掉一些帕伦。
程序现在停止查找线型,正如我前面提到的,我没有。
这应该适合你。
 
键入POPUP3开始。
只需确保您只使用以下两个代码。
 
DCL
  1. popup3 : dialog {                                   //*dialog name
  2.         label = "Existing Storm Sewers";           //*give it a label
  3.         : row {                                    //*define row
  4.           : boxed_column {                         //*define boxex_column
  5.             label = "Choose a Type";               //*give it a label
  6.             : popup_list {
  7.               key = "T1";
  8.               label = "Type";                      //*give it a label
  9.               edit_width=8;
  10.               alignment = centered;
  11.             }
  12.             : spacer {
  13.               height = 0;
  14.             }
  15.           }                                        //*end column
  16.         }                                          //*end row
  17.         : row {                                    //*define row
  18.           : boxed_column {                         //*define boxex_column
  19.             label = "Choose a Size";               //*give it a label
  20.             : popup_list {
  21.               key = "S1";
  22.               label = "Size";                      //*give it a label
  23.               edit_width=8;
  24.               alignment = centered;
  25.             }
  26.             : spacer {
  27.               height = 0;
  28.             }
  29.           }                                        //*end boxed_column
  30.         }                                          //*end row
  31.         : row {                                    //*define row
  32.           : column {                               //*define column
  33.             ok_cancel ;                            //*predifined OK/Cancel
  34.             : paragraph {                          //*define paragraph
  35.               : text_part {                        //*define text
  36.                 label = "Designed by Brian Deasy"; //*give it some text
  37.               }                                    //*end text
  38.               : text_part {                        //*define more text
  39.                 label = "for CCC NNRDO";           //*some more text
  40.               }                                    //*end text
  41.             }                                      //*end paragraph
  42.           }                                        //*end column
  43.         }                                          //*end row
  44.       }                                            //*end dialog

 
LSP
  1. (defun C:POPUP3 ()
  2. (POPUP_MF)
  3. (princ)
  4. )
  5. (defun POPUP_MF (/ HOLE$ SIZE$ SIZE# HOLE SIZE a b)
  6. (setq SIZE# 1500)
  7. (setq T1_list
  8.   '("Type 1" "Type 2"
  9.     "Type 3" "Type 4"))
  10. (setq S1_list
  11.   '("1500mm" "1350mm"
  12.     "1200mm" "1050mm"
  13.      "900mm"  "750mm"
  14.      "675mm"  "600mm"
  15.      "525mm"  "450mm"
  16.      "375mm"  "300mm"
  17.      "225mm"  "150mm"))
  18. (setq dcl_id (load_dialog "popup3.dcl"))
  19. (if (not (new_dialog "popup3" dcl_id))
  20.    (progn
  21.      (alert "Can not find your dcl file")
  22.      (exit)))
  23. (start_list "T1")
  24. (mapcar 'add_list T1_list)
  25. (end_list)
  26. (start_list "S1")
  27. (mapcar 'add_list S1_list)
  28. (end_list)
  29. (if HOLE2:DEF
  30.    (set_tile "T1" (itoa HOLE2:DEF)))
  31. (if SIZE2:DEF
  32.    (set_tile "S1" (itoa SIZE2:DEF)))
  33. (action_tile "cancel"
  34.   "(done_dialog)(setq userclick nil)")
  35. (action_tile "accept"
  36.    (strcat
  37.     "(progn
  38.      (setq H:OLE2 (atoi (get_tile "T1")) HOLE2:DEF H:OLE2)"
  39.     "(setq S:IZE2 (atoi (get_tile "S1")) SIZE2:DEF S:IZE2)"
  40.     "(done_dialog)(setq userclick T))"))
  41. (start_dialog)
  42. (unload_dialog dcl_id)
  43. (if userclick
  44.    (VARIABLE)
  45. )
  46. (princ)
  47. )
  48. (defun VARIABLE ()
  49. (progn
  50.    (setq HOLE$ (fix H:OLE2))
  51.    (setq HOLE$ (nth H:OLE2 T1_list))
  52.    (cond
  53.      ((= HOLE$ "TYPE 1"))
  54.      ((= HOLE$ "TYPE 2"))
  55.      ((= HOLE$ "TYPE 3"))
  56.      ((= HOLE$ "TYPE 4"))
  57.    )
  58. )
  59. (setq HOLE HOLE$)
  60. (progn
  61.    (setq SIZE$ (fix S:IZE2))
  62.    (setq SIZE$ (nth S:IZE2 S1_list))
  63.    (cond
  64.      ((= SIZE$ "1500mm")(setq SIZE# 1500))
  65.      ((= SIZE$ "1350mm")(setq SIZE# 1350))
  66.      ((= SIZE$ "1200mm")(setq SIZE# 1200))
  67.      ((= SIZE$ "1050mm")(setq SIZE# 1050))
  68.      ((= SIZE$  "900mm")(setq SIZE#  900))
  69.      ((= SIZE$  "750mm")(setq SIZE#  750))
  70.      ((= SIZE$  "675mm")(setq SIZE#  675))
  71.      ((= SIZE$  "600mm")(setq SIZE#  600))
  72.      ((= SIZE$  "525mm")(setq SIZE#  525))
  73.      ((= SIZE$  "450mm")(setq SIZE#  450))
  74.      ((= SIZE$  "375mm")(setq SIZE#  375))
  75.      ((= SIZE$  "300mm")(setq SIZE#  300))
  76.      ((= SIZE$  "225mm")(setq SIZE#  225))
  77.      ((= SIZE$  "150mm")(setq SIZE#  150))
  78.    )
  79. )
  80. (setq SIZE (RTOS SIZE# 2 0))
  81. (ANSWER)
  82. (princ)
  83. )
  84. (defun ANSWER ()
  85. (progn
  86.    (setq a (strcat "CCC_DR_" "SIZE" "HOLE"))
  87.    (setq b (strcat "CCC_SERVICES_EXISTING_Drainage_Storm_Sewer_" "SIZE"))
  88.    (if
  89.      (not
  90.        (tblsearch "LTYPE" a)
  91.      )
  92.      (command "_.-linetype" "_l" a "acadiso.lin" "")
  93.    )
  94.    (command "._-layer"   "_N"   b   "_M"   b   "_L"   a  b   "_C"   "84"   b   "_LW"   "0.3"   b    "" )
  95.    (command "pline" pause "width" "0.0" "0.0" pause "width" "0.0" "0.0")
  96. )
  97. (POPUP_MF)
  98. (princ)
  99. )
回复

使用道具 举报

145

主题

590

帖子

446

银币

中流砥柱

Rank: 25

铜币
725
发表于 2022-7-6 12:29:28 | 显示全部楼层
这似乎做得很好。不过只有一件事。当我运行lsp时,它会加载对话框,当我选择我的选项并按OK时,它会消失。我开始绘制pline,在第二个点,方框再次出现,我必须再次按OK。然后,Pline命令再次启动。该框是否需要隐藏在userclick上??
 
这是我做了一些小修改的代码,以获取要加载的线型和线型文件。
 
  1. (defun C:POPUP3 ()
  2. (POPUP_MF)
  3. (princ)
  4. )
  5. (defun POPUP_MF (/ HOLE$ SIZE$ SIZE# HOLE SIZE a b)
  6. (setq SIZE# 1500)
  7. (setq T1_list
  8.   '("Type 1" "Type 2"
  9.     "Type 3" "Type 4"))
  10. (setq S1_list
  11.   '("1500mm" "1350mm"
  12.     "1200mm" "1050mm"
  13.      "900mm"  "750mm"
  14.      "675mm"  "600mm"
  15.      "525mm"  "450mm"
  16.      "375mm"  "300mm"
  17.      "225mm"  "150mm"))
  18. (setq dcl_id (load_dialog "popup3.dcl"))
  19. (if (not (new_dialog "popup3" dcl_id))
  20.    (progn
  21.      (alert "Can not find your dcl file")
  22.      (exit)))
  23. (start_list "T1")
  24. (mapcar 'add_list T1_list)
  25. (end_list)
  26. (start_list "S1")
  27. (mapcar 'add_list S1_list)
  28. (end_list)
  29. (if HOLE2:DEF
  30.    (set_tile "T1" (itoa HOLE2:DEF)))
  31. (if SIZE2:DEF
  32.    (set_tile "S1" (itoa SIZE2:DEF)))
  33. (action_tile "cancel"
  34.   "(done_dialog)(setq userclick nil)")
  35. (action_tile "accept"
  36.    (strcat
  37.     "(progn
  38.      (setq H:OLE2 (atoi (get_tile "T1")) HOLE2:DEF H:OLE2)"
  39.     "(setq S:IZE2 (atoi (get_tile "S1")) SIZE2:DEF S:IZE2)"
  40.     "(done_dialog)(setq userclick T))"))
  41. (start_dialog)
  42. ;(unload_dialog dcl_id)
  43. (if userclick
  44.      (VARIABLE)
  45. (unload_dialog dcl_id)
  46. )
  47. (princ)
  48. )
  49. (defun VARIABLE ()
  50. (progn
  51.    (setq HOLE$ (fix H:OLE2))
  52.    (setq HOLE$ (nth H:OLE2 T1_list))
  53.    (cond
  54.      ((= HOLE$ "TYPE 1"))
  55.      ((= HOLE$ "TYPE 2"))
  56.      ((= HOLE$ "TYPE 3"))
  57.      ((= HOLE$ "TYPE 4"))
  58.    )
  59. )
  60. (setq HOLE HOLE$)
  61. (progn
  62.    (setq SIZE$ (fix S:IZE2))
  63.    (setq SIZE$ (nth S:IZE2 S1_list))
  64.    (cond
  65.      ((= SIZE$ "1500mm")(setq SIZE# 1500))
  66.      ((= SIZE$ "1350mm")(setq SIZE# 1350))
  67.      ((= SIZE$ "1200mm")(setq SIZE# 1200))
  68.      ((= SIZE$ "1050mm")(setq SIZE# 1050))
  69.      ((= SIZE$  "900mm")(setq SIZE#  900))
  70.      ((= SIZE$  "750mm")(setq SIZE#  750))
  71.      ((= SIZE$  "675mm")(setq SIZE#  675))
  72.      ((= SIZE$  "600mm")(setq SIZE#  600))
  73.      ((= SIZE$  "525mm")(setq SIZE#  525))
  74.      ((= SIZE$  "450mm")(setq SIZE#  450))
  75.      ((= SIZE$  "375mm")(setq SIZE#  375))
  76.      ((= SIZE$  "300mm")(setq SIZE#  300))
  77.      ((= SIZE$  "225mm")(setq SIZE#  225))
  78.      ((= SIZE$  "150mm")(setq SIZE#  150))
  79.    )
  80. )
  81. (setq SIZE (RTOS SIZE# 2 0))
  82. (ANSWER)
  83. (princ)
  84. )
  85. (defun ANSWER ()
  86. (progn
  87.    (setq a (strcat "CCC_DR_" SIZE "_" HOLE)
  88.          b (strcat "CCC_SERVICES_EXISTING_Drainage_Storm_Sewer_" SIZE "_" HOLE)
  89.    )
  90.    (if
  91.      (not
  92.        (tblsearch "LTYPE" a)
  93.      )
  94.      (command "_.-linetype" "_l" a "acadiso.lin" "")
  95.    )
  96.    (command "._-layer"   "_N"   b   "_M"   b   "_L"   a  b   "_C"   "84"   b   "_LW"   "0.3"   b    "" )
  97.    (command "pline" pause "width" "0.0" "0.0" pause "width" "0.0" "0.0" "")
  98.    (command "pline")
  99. )
  100. (POPUP_MF)
  101. (princ)
  102. )

阿卡迪索。txt文件
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-6 02:18 , Processed in 0.689745 second(s), 72 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表