明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 522|回复: 2

[提问] 浩辰:对话框不兼容CAD吗?

[复制链接]
发表于 2019-12-28 18:48 | 显示全部楼层 |阅读模式
如题:

浩辰的DCL和CAD不兼容?

  1. ;;;system.slb 幻灯库放在CAD支持路径下
  2. ;;-----------------填充【开始】----------------------------------------------------------------
  3. (defun C:TT ( / dcl_id dlg)
  4.   ;;说明:填充名列表
  5.   (if (or (not dcl_id) (< (setq dcl_id (load_dialog (SL_TC))) 0))
  6.     (setq dcl_id (load_dialog (SL_TC))) ;加载对话框
  7.   )
  8.   (if (not (new_dialog "填充" dcl_id)) (exit))
  9.   (SL-Lib-ImageFill "img1-1" "system(solid)" 0) ;;;;;;显示幻灯库中solid幻灯片
  10.   (SL-Lib-ImageFill "img1-2" "system(ansi31)" 0)
  11.   (SL-Lib-ImageFill "img1-3" "system(ansi37)" 0)
  12.   (SL-Lib-ImageFill "img1-4" "system(钢筋混凝土)" 0)
  13.   
  14.   (SL-Lib-ImageFill "img2-1" "system(混凝土)" 0)
  15.   (SL-Lib-ImageFill "img2-2" "system(加气混凝土)" 0)
  16.   (SL-Lib-ImageFill "img2-3" "system(金属)" 0)
  17.   (SL-Lib-ImageFill "img2-4" "system(木材)" 0)
  18.   
  19.   (SL-Lib-ImageFill "img3-1" "system(夯实土壤)" 0)
  20.   (SL-Lib-ImageFill "img3-2" "system(平行线)" 0)
  21.   (SL-Lib-ImageFill "img3-3" "system(弯瓦屋面)" 0)
  22.   (SL-Lib-ImageFill "img3-4" "system(隔热材料01)" 0)
  23.   
  24.   (SL-Lib-ImageFill "img4-1" "system(砂灰土)" 0)
  25.   (SL-Lib-ImageFill "img4-2" "system(AR-B88)" 0)
  26.   (SL-Lib-ImageFill "img4-3" "system(天然石材)" 0)
  27.   (SL-Lib-ImageFill "img4-4" "system(玻璃1)" 0)
  28.   
  29.   (action_tile "img1-1" "(done_dialog 1)")
  30.   (action_tile "img1-2" "(done_dialog 2)")
  31.   (action_tile "img1-3" "(done_dialog 3)")
  32.   (action_tile "img1-4" "(done_dialog 4)")
  33.   
  34.   (action_tile "img2-1" "(done_dialog 5)")
  35.   (action_tile "img2-2" "(done_dialog 6)")
  36.   (action_tile "img2-3" "(done_dialog 7)")
  37.   (action_tile "img2-4" "(done_dialog 8)")
  38.   
  39.   (action_tile "img3-1" "(done_dialog 9)")
  40.   (action_tile "img3-2" "(done_dialog 10)")
  41.   (action_tile "img3-3" "(done_dialog 11)")
  42.   (action_tile "img3-4" "(done_dialog 12)")
  43.   
  44.   (action_tile "img4-1" "(done_dialog 13)")
  45.   (action_tile "img4-2" "(done_dialog 14)")
  46.   (action_tile "img4-3" "(done_dialog 15)")
  47.   (action_tile "img4-4" "(done_dialog 16)")
  48.   
  49.   (action_tile "dtbi" "(done_dialog 17)")
  50.   (action_tile "tcmj" "(done_dialog 21)")
  51.   (action_tile "cgtc" "(done_dialog 18)")
  52.   (action_tile "jctco" "(done_dialog 19)")
  53.   (action_tile "cjbj" "(done_dialog 20)")
  54.   (setq dlg (start_dialog))
  55.   (cond
  56.     ((= dlg 0)
  57.       (princ "\n取消")
  58.     )
  59.     ((= dlg 1)
  60.       (mdtc "SOLID") ;填充 SOLID
  61.     )
  62.     ((= dlg 2)
  63.       (mdtc "ANSI31")
  64.     )
  65.     ((= dlg 3)
  66.       (mdtc "ANSI37")
  67.     )
  68.     ((= dlg 4)
  69.       (mdtc "钢筋混凝土")
  70.     )
  71.     ((= dlg 5)
  72.       (mdtc "混凝土")
  73.     )
  74.     ((= dlg 6)
  75.       (mdtc "加气混凝土")
  76.     )
  77.     ((= dlg 7)
  78.       (mdtc "金属")
  79.     )
  80.     ((= dlg 8)
  81.       (mdtc "木材")
  82.     )
  83.     ((= dlg 9)
  84.       (mdtc "夯实土壤")
  85.     )
  86.     ((= dlg 10)
  87.       (mdtc "平行线")
  88.     )
  89.     ((= dlg 11)
  90.       (mdtc "弯瓦屋面")
  91.     )
  92.     ((= dlg 12)
  93.       (mdtc "隔热材料01")
  94.     )
  95.     ((= dlg 13)
  96.       (mdtc "砂灰土")
  97.     )
  98.     ((= dlg 14)
  99.       (mdtc "AR-B88")
  100.     )
  101.     ((= dlg 15)
  102.       (mdtc "天然石材")
  103.     )
  104.     ((= dlg 16)
  105.       (mdtc "玻璃1")
  106.     )
  107.     ((= dlg 17)
  108.       (c:dttcbi)
  109.     )
  110.     ((= dlg 18)
  111.       (command "bhatch")
  112.     )
  113.     ((= dlg 19)
  114.       (c:jctc)
  115.     )
  116.     ((= dlg 20)
  117.       (CJTCHL)
  118.     )
  119.     ((= dlg 21)
  120.       (btmj)
  121.     )
  122.   )
  123. )

  124. ;;-----------------三领填充 DCL-----------------------------------------------------------------
  125. (defun SL_TC (/ lst_str str file f)
  126.   (setq lst_str
  127.     (list
  128.       "填充:dialog {"
  129.       "label = \"三领外挂V7.3         三领填充V1.0 开发 陈传建 QQ:15290049\" ;"
  130.       ":row {"
  131.       ":image_button {"
  132.       " aspect_ratio = 0.5;"
  133.       " key = \"img1-1\" ;"
  134.       " width = 25 ;"
  135.       " }"
  136.       ":image_button {"
  137.       " aspect_ratio = 0.5;"
  138.       " key = \"img1-2\" ;"
  139.       " width = 25 ;"
  140.       " }"
  141.       ":image_button {"
  142.       " aspect_ratio = 0.5;"
  143.       " key = \"img1-3\" ;"
  144.       " width = 25 ;"
  145.       " }"
  146.       ":image_button {"
  147.       " aspect_ratio = 0.5;"
  148.       " key = \"img1-4\" ;"
  149.       " width = 25 ;"
  150.       " }"
  151.       " }"
  152.       ":row {"
  153.       ":image_button {"
  154.       " aspect_ratio = 0.5;"
  155.       " key = \"img2-1\" ;"
  156.       " width = 25 ;"
  157.       " }"
  158.       ":image_button {"
  159.       " aspect_ratio = 0.5;"
  160.       " key = \"img2-2\" ;"
  161.       " width = 25 ;"
  162.       " }"
  163.       ":image_button {"
  164.       " aspect_ratio = 0.5;"
  165.       " key = \"img2-3\" ;"
  166.       " width = 25 ;"
  167.       " }"
  168.       ":image_button {"
  169.       " aspect_ratio = 0.5;"
  170.       " key = \"img2-4\" ;"
  171.       " width = 25 ;"
  172.       " }"
  173.       " }"
  174.       ":row {"
  175.       ":image_button {"
  176.       " aspect_ratio = 0.5;"
  177.       " key = \"img3-1\" ;"
  178.       " width = 25 ;"
  179.       " }"
  180.       ":image_button {"
  181.       " aspect_ratio = 0.5;"
  182.       " key = \"img3-2\" ;"
  183.       " width = 25 ;"
  184.       " }"
  185.       ":image_button {"
  186.       " aspect_ratio = 0.5;"
  187.       " key = \"img3-3\" ;"
  188.       " width = 25 ;"
  189.       " }"
  190.       ":image_button {"
  191.       " aspect_ratio = 0.5;"
  192.       " key = \"img3-4\" ;"
  193.       " width = 25 ;"
  194.       " }"
  195.       " }"
  196.       ":row {"
  197.       ":image_button {"
  198.       " aspect_ratio = 0.5;"
  199.       " key = \"img4-1\" ;"
  200.       " width = 25 ;"
  201.       " }"
  202.       ":image_button {"
  203.       " aspect_ratio = 0.5;"
  204.       " key = \"img4-2\" ;"
  205.       " width = 25 ;"
  206.       " }"
  207.       ":image_button {"
  208.       " aspect_ratio = 0.5;"
  209.       " key = \"img4-3\" ;"
  210.       " width = 25 ;"
  211.       " }"
  212.       ":image_button {"
  213.       " aspect_ratio = 0.5;"
  214.       " key = \"img4-4\" ;"
  215.       " width = 25 ;"
  216.       " }"
  217.       " }"
  218.       ":row {"
  219.       ":button {"
  220.       "key = \"cjbj\" ;"
  221.       "label = \"重建填充边界\" ;"
  222.       " }"
  223.       ":button {"
  224.       "key = \"tcmj\" ;"
  225.       "label = \"批量填充面积\" ;"
  226.       " }"
  227.       ":button {"
  228.       "key = \"dtbi\" ;"
  229.       "label = \"动态填充比例\" ;"
  230.       " }"
  231.       ":button {"
  232.       "key = \"jctco\" ;"
  233.       "label = \"继承填充\" ;"
  234.       " }"
  235.       ":button {"
  236.       "key = \"cgtc\" ;"
  237.       "label = \"常规填充\" ;"
  238.       " }"
  239.       ":button {"
  240.       "action = \"(done_dialog 0)\" ;"
  241.       "is_cancel = true ;"
  242.       "key = \"btn_Cancel\" ;"
  243.       " label = \"取消\" ;"
  244.       " }"
  245.       " }"
  246.       " }"  
  247.     )
  248.   )
  249.   (setq file (vl-filename-mktemp "DclTemp.dcl"))
  250.   (setq f (open file "w"))
  251.   (foreach str lst_str
  252.     (princ "\n" f)
  253.     (princ str f)
  254.   )
  255.   (close f)
  256.   ;;返回
  257.   file
  258. )
  259. ;;-----------------填充【结束】----------------------------------------------------------------
  260. ;图形预览对话框处理;==DCL控件写幻灯===================(一级)======================================
  261. ;;语法 (SL-Lib-ImageFill img_key slide cobak)
  262. ;;img_key 图像控件关键字
  263. ;;slide 幻灯片名字
  264. ;;cobak 图像控件底色
  265. ;;功能:对话框图像初始化
  266. (defun SL-Lib-ImageFill (imgkey slide cobak / x1 y1)
  267.   (setq x1 (dimx_tile imgkey))
  268.   (setq y1 (dimy_tile imgkey))
  269.   (start_image imgkey)
  270.   (fill_image 0 0 x1 y1 cobak)
  271.   (slide_image 0 -2 x1 y1 slide)
  272.   (end_image)
  273. )

"觉得好,就打赏"
还没有人打赏,支持一下
发表于 2019-12-29 10:03 | 显示全部楼层
gcad对DCL的支持还算可以的,没有问题。

 楼主| 发表于 2019-12-29 11:25 | 显示全部楼层
e2002 发表于 2019-12-29 10:03
gcad对DCL的支持还算可以的,没有问题。

找到原因了
(if (not (new_dialog "填充" dcl_id)) (exit))   填充,不能用汉字,改成字符即可了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-4-25 05:31 , Processed in 0.205861 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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