乐筑天下

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

[编程交流] 按钮错误

[复制链接]

41

主题

301

帖子

265

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
209
发表于 2022-7-6 14:42:44 | 显示全部楼层 |阅读模式
格戴。
我有个问题,在dcl里。我按下勾选框,然后选项被启用,然后当我按下下面的按钮时,它会做它需要做的事情,如果我按下它下面的任何一个按钮(2),你需要按几次才能工作,如果我先按这些按钮,我需要按几次顶部的按钮才能工作,还需要按几次接受和取消按钮才能工作。
 
这是代码按钮是“odget”“idget”“thkget”
 
 
任何帮助都会很棒
 
干杯

  1. (defun pf ()
  2. (setq pipematerialpreset '("MILD" "SS"))
  3. ;protection, if tiles are nil
  4. (if (= pipesize nil)
  5. (setq pipesize "2")
  6. )
  7. (cond
  8. ((= masstype "316 S.S.")
  9. (setq material "1"))
  10. ((= masstype "MILD STEEL")
  11. (setq material "0"))
  12. )
  13. (if (= flgod nil)
  14. (setq flgod " ")
  15. )
  16. (if (= flgid nil)
  17. (setq flgid " ")
  18. )
  19. (if (= flgthk nil)
  20. (setq flgthk " ")
  21. )
  22. (setq flgthktype 0)
  23.   (setq toggle 0)
  24. (defun flgio ()
  25. (setq dialo (load_dialog "MainDCL"))
  26. (if (not (new_dialog "Flangebox" dialo)) (exit))
  27. ;set up for data
  28. ;for pipe size
  29. (start_list "pipeSize")   
  30. (mapcar 'add_list Pipesizes)   
  31. (end_list)
  32. ;for pipe material
  33. (start_list "material")   
  34. (mapcar 'add_list pipematerialpreset)   
  35. (end_list)
  36. ;Pre-set tiles
  37. (set_tile "pipeSize" pipesize )
  38. (set_tile "material" material)
  39. (set_tile "flgod" flgod)
  40. (set_tile "flgid" flgid )
  41. (set_tile "flgthk" flgthk )
  42. (if (or (= flgtype "TABLED")(= flgtype nil))
  43. (set_tile "tabled" "1")
  44. )
  45. (if (= flgtype "TABLEE")
  46. (set_tile "tablee" "1")
  47. )
  48. (if (= flgtype "ANSI150")
  49. (set_tile "ansi150" "1")
  50. )
  51. (if (= flgtype "ANSI300")
  52. (set_tile "ansi300" "1")
  53. )
  54. ;what to do settings
  55. (if (= toggle 1)
  56. (progn
  57. (mode_tile "customflgdtls" 0)
  58. (mode_tile "flgtype" 1)
  59. (mode_tile "flgthktype" 1)
  60. )
  61. (progn
  62. (mode_tile "customflgdtls" 1)
  63. (mode_tile "flgtype" 0)
  64. (mode_tile "flgthktype" 0)
  65. )
  66.   )
  67. (action_tile "stdthk" "(setq flgthktype 0)")
  68. (action_tile "outtk" "(setq flgthktype 1)")
  69. (action_tile "customflg" "(progn
  70.   (if (= toggle 1)
  71.      (progn (mode_tile "flgtype" 0) (mode_tile "flgthktype" 0) (mode_tile "customflgdtls" 1) (setq toggle 0)
  72.     )
  73.    (progn (mode_tile "flgtype" 1) (mode_tile "flgthktype" 1) (mode_tile "customflgdtls" 0) (setq toggle 1)
  74.         )
  75.      ) )"
  76. )
  77. (action_tile "cancel" "(setq ok 0)
  78.      (done_dialog)"
  79. )
  80. (action_tile "accept" "(setq ok 1)
  81.      (setq pipesize (strcase(get_tile "pipeSize")))
  82.      (setq material (strcase(get_tile "material")))
  83.      (setq flgod (strcase(get_tile "flgod")))
  84.      (setq flgid (strcase(get_tile "flgid")))
  85.      (setq flgthk (strcase(get_tile "flgthk")))
  86.      (setq flgtype (strcase(get_tile "flgtype")))
  87.      (done_dialog)")
  88. (action_tile "odget" "(setq ok 2)
  89.       (setq pipesize (strcase(get_tile "pipeSize")))
  90.       (setq material (strcase(get_tile "material")))
  91.       (setq flgod (strcase(get_tile "flgod")))
  92.       (setq flgid (strcase(get_tile "flgid")))
  93.       (setq flgthk (strcase(get_tile "flgthk")))
  94.       (setq flgtype (strcase(get_tile "flgtype")))
  95.       (done_dialog)")
  96. (action_tile "idget" "(setq ok 3)
  97.       (setq pipesize (strcase(get_tile "pipeSize")))
  98.       (setq material (strcase(get_tile "material")))
  99.       (setq flgod (strcase(get_tile "flgod")))
  100.       (setq flgid (strcase(get_tile "flgid")))
  101.       (setq flgthk (strcase(get_tile "flgthk")))
  102.       (setq flgtype (strcase(get_tile "flgtype")))
  103.       (done_dialog)")
  104. (action_tile "thkget" "(setq ok 4)
  105.       (setq pipesize (strcase(get_tile "pipeSize")))
  106.       (setq material (strcase(get_tile "material")))
  107.       (setq flgod (strcase(get_tile "flgod")))
  108.       (setq flgid (strcase(get_tile "flgid")))
  109.       (setq flgthk (strcase(get_tile "flgthk")))
  110.       (setq flgtype (strcase(get_tile "flgtype")))
  111.       (done_dialog)")
  112.   (start_dialog)
  113. (unload_dialog dialo)
  114. )
  115. (flgio)
  116. (while (not (or (= ok 1) (= ok 0)))
  117. (if (= ok 2)
  118.   (setq flgod (rtos (getdist "\nWhat is the Flanges O.D")2 0))
  119.   (flgio)
  120.   )
  121.   (if (= ok 3)
  122.    (setq flgid (rtos (getdist "\nWhat is the Flanges I.D")2 0))
  123. (flgio)
  124.   )
  125.   (if (= ok 4)
  126.    (setq flgthk (rtos (getdist "\nWhat is the Flanges Thickness")2 0))
  127. (flgio)
  128.   )
  129.   )
  130. )
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-5 00:14 , Processed in 0.347358 second(s), 54 queries .

© 2020-2025 乐筑天下

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