乐筑天下

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

[编程交流] dcl函数imag中的命令

[复制链接]

55

主题

118

帖子

65

银币

后起之秀

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

铜币
273
发表于 2022-7-6 09:33:35 | 显示全部楼层 |阅读模式
我想知道是否可以在dcl文件中调用命令,如果可以的话。。。它必须通过lisp文件调用吗?
再次感谢
塞尔吉奥
回复

使用道具 举报

4

主题

327

帖子

324

银币

初来乍到

Rank: 1

铜币
19
发表于 2022-7-6 09:57:55 | 显示全部楼层
是的,如果您将dcl设置为循环以供用户输入,则可以
你能把你的dcl文件寄出去吗
回复

使用道具 举报

55

主题

118

帖子

65

银币

后起之秀

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

铜币
273
发表于 2022-7-6 10:22:23 | 显示全部楼层
给你,谢谢
 
  1. UNO : dialog {
  2. label = "Primera ventana";//Titulo de la ventana
  3. spacer;//espacio entre renglones
  4.    : row {
  5.    alignment = centered;
  6.    fixed_width = true;
  7.    : image_button {
  8.      key = "LINE";
  9.      width = 20;
  10.      height = 10;
  11.      color = -2;
  12.    }
  13.    : image_button {
  14.      key = "";
  15.      width = 20;
  16.      height = 10;
  17.      color = -2;
  18.    }
  19.    : image_button {
  20.      key = "";
  21.      width = 20;
  22.      height = 10;
  23.      color = -2;
  24.    }
  25.    : image_button {
  26.      key = "";
  27.      width = 20;
  28.      height = 10;
  29.      color = -2;
  30.    }
  31.    : image_button {
  32.      key = "";
  33.      width = 20;
  34.      height = 10;
  35.      color = -2;
  36.    }
  37. }
  38.    : row {
  39.    fixed_width = true;
  40.    alignment = left;
  41.    : ok_button {
  42.    width = 11;
  43.    }
  44.    : cancel_button {
  45.      width = 11;
  46.    }
  47. }
  48. }
回复

使用道具 举报

4

主题

327

帖子

324

银币

初来乍到

Rank: 1

铜币
19
发表于 2022-7-6 10:45:59 | 显示全部楼层
循环是在调用dcl对话框的lisp中创建的
下面的示例中是我的一个调用Lisp
查看lisp的结构
查看并遵循what_next循环
在这种情况下,当用户单击对话框上的按钮时,将调用以下动作互动程序(action\u tile“qdx\u wld”“(done\u dialog 4)”)
done\u对话框4然后调用底部代码的cond部分,然后调用my命令。
(条件
(=what_next 4)
(命令“ucs”“world”))
 
  1. (defun qdx:DialogInput (/ dcl_id       dialogloaded dialogshow
  2.                          dr_file      dr_set       qdx_depth
  3.                          qdx_hwos     qdx_matt     qdx_sing
  4.                          result       userclick    what_next
  5.                        )
  6. (setq dialogLoaded T
  7. dialogShow T)
  8. (if (= -1 (setq dcl_id (load_dialog "qdx.DCL")))
  9. (progn
  10. (princ "\nERROR: Cannot load qdx.dcl")
  11. (setq dialogLoaded nil)
  12. ) ;_ end of progn
  13. ) ;_ end of if
  14. (setq what_next 2)
  15. (while (>= what_next 2)
  16. (if (and (not (new_dialog "qdx_maindlg" dcl_id))
  17. dialogLoaded
  18. ) ;_ end of and
  19. (progn
  20. (princ "\nERROR: Cannot show dialog qdxdlg")
  21. (setq dialogShow nil)
  22. ) ;_ end of progn
  23. ) ;_ end of if
  24. (if (and dialogLoaded dialogShow)
  25. (progn
  26.        (setq qdxff (findfile "c:/program files/quick draw/qdxlu.jdb"))
  27.        (if qdxff
  28.        (progn
  29. (setq dr_file (open qdxff "r"))
  30. (setq retval (read(read-line dr_file)))
  31. (close dr_file)
  32.        (set_tile "qdx_hwo" (cdr(assoc 2 retval)));_hardware offset
  33. (set_tile "qdx_mtk" (cdr(assoc 1 retval)));_material thick
  34.        (if (= (cdr(assoc 3 retval)) "1")
  35.        (progn
  36. (set_tile "qdx_sin" "1");_single
  37.        (set_tile "qdx_dbl" "0");_double
  38.        );_progn
  39.        (progn
  40. (set_tile "qdx_sin" "0");_single
  41.        (set_tile "qdx_dbl" "1");_double
  42.        );_progn
  43.        );_if
  44. (set_tile "qdx_dpt" (cdr(assoc 4 retval)));_depth
  45. (mode_tile "qdx_dpt" 2)
  46.        );_progn
  47.        (progn
  48. (set_tile "qdx_hwo" "0.5313");_hardware offset
  49. (set_tile "qdx_mtk" "0.75");_material thick
  50. (set_tile "qdx_sin" "1");_single
  51.        (set_tile "qdx_dbl" "0");_double
  52. (set_tile "qdx_dpt" "20.00");_depth
  53.        (mode_tile "qdx_dpt" 2)
  54.        );_progn
  55.        );_if
  56.        (action_tile "qdx_sin" "(set_tile "qdx_dbl" "0")")
  57. (action_tile "qdx_dbl" "(set_tile "qdx_sin" "0")")
  58. (action_tile "qdx_wld" "(done_dialog 4)")
  59. (action_tile "qdx_obj" "(done_dialog 5)")
  60. (action_tile "qdxhlp"  "(help "QD50.HLP" "Topic13")")
  61. (action_tile "cancel" "(done_dialog)(setq UserClick nil) ")
  62. (action_tile
  63. "accept"
  64. (strcat
  65. "(progn"
  66. "(setq qdx_sing (get_tile "qdx_sin"))"
  67. "(setq qdx_depth (get_tile "qdx_dpt"))"
  68. "(setq qdx_matt (get_tile "qdx_mtk"))"
  69. "(setq qdx_hwos (get_tile "qdx_hwo"))"
  70. "(if (> (atof(get_tile "qdx_dpt")) 0.00)(progn (done_dialog)(setq UserClick T))"
  71. "(alert " Enter a box depth.")))"
  72. ) ;_end strcat
  73. ) ;_ end of action_tile
  74. (setq what_next (start_dialog))
  75. (if UserClick   ; User clicked Ok
  76. ;; Build the resulting data
  77. (progn
  78. (setq result
  79.        (list
  80. (cons 3 qdx_sing);single or double
  81. (cons 4 qdx_depth);_depth
  82. (cons 1 qdx_matt);_material thickness
  83. (cons 2 qdx_hwos);_hardware offset
  84. ) ;_ end of list
  85. );_setq
  86.        (qdx_wt_fl (vl-prin1-to-string result));_write last used to file
  87. );_progn
  88. ) ;_ end of if
  89. ) ;_ end of progn
  90. ) ;_ end of if
  91. (cond
  92. ((= what_next 4)
  93. (command "ucs" "world"))
  94. ((= what_next 5)
  95. (qdx_obsel))      
  96. );_end cond
  97. );_end while
  98. (unload_dialog dcl_id)
  99. result
  100. ) ;_ end of defun
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-7 01:48 , Processed in 0.385873 second(s), 71 queries .

© 2020-2025 乐筑天下

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