尘缘一生 发表于 2019-12-28 18:48:59

浩辰:对话框不兼容CAD吗?

如题:

浩辰的DCL和CAD不兼容?


;;;system.slb 幻灯库放在CAD支持路径下
;;-----------------填充【开始】----------------------------------------------------------------
(defun C:TT ( / dcl_id dlg)
;;说明:填充名列表
(if (or (not dcl_id) (< (setq dcl_id (load_dialog (SL_TC))) 0))
    (setq dcl_id (load_dialog (SL_TC))) ;加载对话框
)
(if (not (new_dialog "填充" dcl_id)) (exit))
(SL-Lib-ImageFill "img1-1" "system(solid)" 0) ;;;;;;显示幻灯库中solid幻灯片
(SL-Lib-ImageFill "img1-2" "system(ansi31)" 0)
(SL-Lib-ImageFill "img1-3" "system(ansi37)" 0)
(SL-Lib-ImageFill "img1-4" "system(钢筋混凝土)" 0)

(SL-Lib-ImageFill "img2-1" "system(混凝土)" 0)
(SL-Lib-ImageFill "img2-2" "system(加气混凝土)" 0)
(SL-Lib-ImageFill "img2-3" "system(金属)" 0)
(SL-Lib-ImageFill "img2-4" "system(木材)" 0)

(SL-Lib-ImageFill "img3-1" "system(夯实土壤)" 0)
(SL-Lib-ImageFill "img3-2" "system(平行线)" 0)
(SL-Lib-ImageFill "img3-3" "system(弯瓦屋面)" 0)
(SL-Lib-ImageFill "img3-4" "system(隔热材料01)" 0)

(SL-Lib-ImageFill "img4-1" "system(砂灰土)" 0)
(SL-Lib-ImageFill "img4-2" "system(AR-B88)" 0)
(SL-Lib-ImageFill "img4-3" "system(天然石材)" 0)
(SL-Lib-ImageFill "img4-4" "system(玻璃1)" 0)

(action_tile "img1-1" "(done_dialog 1)")
(action_tile "img1-2" "(done_dialog 2)")
(action_tile "img1-3" "(done_dialog 3)")
(action_tile "img1-4" "(done_dialog 4)")

(action_tile "img2-1" "(done_dialog 5)")
(action_tile "img2-2" "(done_dialog 6)")
(action_tile "img2-3" "(done_dialog 7)")
(action_tile "img2-4" "(done_dialog 8)")

(action_tile "img3-1" "(done_dialog 9)")
(action_tile "img3-2" "(done_dialog 10)")
(action_tile "img3-3" "(done_dialog 11)")
(action_tile "img3-4" "(done_dialog 12)")

(action_tile "img4-1" "(done_dialog 13)")
(action_tile "img4-2" "(done_dialog 14)")
(action_tile "img4-3" "(done_dialog 15)")
(action_tile "img4-4" "(done_dialog 16)")

(action_tile "dtbi" "(done_dialog 17)")
(action_tile "tcmj" "(done_dialog 21)")
(action_tile "cgtc" "(done_dialog 18)")
(action_tile "jctco" "(done_dialog 19)")
(action_tile "cjbj" "(done_dialog 20)")
(setq dlg (start_dialog))
(cond
    ((= dlg 0)
      (princ "\n取消")
    )
    ((= dlg 1)
      (mdtc "SOLID") ;填充 SOLID
    )
    ((= dlg 2)
      (mdtc "ANSI31")
    )
    ((= dlg 3)
      (mdtc "ANSI37")
    )
    ((= dlg 4)
      (mdtc "钢筋混凝土")
    )
    ((= dlg 5)
      (mdtc "混凝土")
    )
    ((= dlg 6)
      (mdtc "加气混凝土")
    )
    ((= dlg 7)
      (mdtc "金属")
    )
    ((= dlg 8)
      (mdtc "木材")
    )
    ((= dlg 9)
      (mdtc "夯实土壤")
    )
    ((= dlg 10)
      (mdtc "平行线")
    )
    ((= dlg 11)
      (mdtc "弯瓦屋面")
    )
    ((= dlg 12)
      (mdtc "隔热材料01")
    )
    ((= dlg 13)
      (mdtc "砂灰土")
    )
    ((= dlg 14)
      (mdtc "AR-B88")
    )
    ((= dlg 15)
      (mdtc "天然石材")
    )
    ((= dlg 16)
      (mdtc "玻璃1")
    )
    ((= dlg 17)
      (c:dttcbi)
    )
    ((= dlg 18)
      (command "bhatch")
    )
    ((= dlg 19)
      (c:jctc)
    )
    ((= dlg 20)
      (CJTCHL)
    )
    ((= dlg 21)
      (btmj)
    )
)
)

;;-----------------三领填充 DCL-----------------------------------------------------------------
(defun SL_TC (/ lst_str str file f)
(setq lst_str
    (list
      "填充:dialog {"
      "label = \"三领外挂V7.3         三领填充V1.0 开发 陈传建 QQ:15290049\" ;"
      ":row {"
      ":image_button {"
      " aspect_ratio = 0.5;"
      " key = \"img1-1\" ;"
      " width = 25 ;"
      " }"
      ":image_button {"
      " aspect_ratio = 0.5;"
      " key = \"img1-2\" ;"
      " width = 25 ;"
      " }"
      ":image_button {"
      " aspect_ratio = 0.5;"
      " key = \"img1-3\" ;"
      " width = 25 ;"
      " }"
      ":image_button {"
      " aspect_ratio = 0.5;"
      " key = \"img1-4\" ;"
      " width = 25 ;"
      " }"
      " }"
      ":row {"
      ":image_button {"
      " aspect_ratio = 0.5;"
      " key = \"img2-1\" ;"
      " width = 25 ;"
      " }"
      ":image_button {"
      " aspect_ratio = 0.5;"
      " key = \"img2-2\" ;"
      " width = 25 ;"
      " }"
      ":image_button {"
      " aspect_ratio = 0.5;"
      " key = \"img2-3\" ;"
      " width = 25 ;"
      " }"
      ":image_button {"
      " aspect_ratio = 0.5;"
      " key = \"img2-4\" ;"
      " width = 25 ;"
      " }"
      " }"
      ":row {"
      ":image_button {"
      " aspect_ratio = 0.5;"
      " key = \"img3-1\" ;"
      " width = 25 ;"
      " }"
      ":image_button {"
      " aspect_ratio = 0.5;"
      " key = \"img3-2\" ;"
      " width = 25 ;"
      " }"
      ":image_button {"
      " aspect_ratio = 0.5;"
      " key = \"img3-3\" ;"
      " width = 25 ;"
      " }"
      ":image_button {"
      " aspect_ratio = 0.5;"
      " key = \"img3-4\" ;"
      " width = 25 ;"
      " }"
      " }"
      ":row {"
      ":image_button {"
      " aspect_ratio = 0.5;"
      " key = \"img4-1\" ;"
      " width = 25 ;"
      " }"
      ":image_button {"
      " aspect_ratio = 0.5;"
      " key = \"img4-2\" ;"
      " width = 25 ;"
      " }"
      ":image_button {"
      " aspect_ratio = 0.5;"
      " key = \"img4-3\" ;"
      " width = 25 ;"
      " }"
      ":image_button {"
      " aspect_ratio = 0.5;"
      " key = \"img4-4\" ;"
      " width = 25 ;"
      " }"
      " }"
      ":row {"
      ":button {"
      "key = \"cjbj\" ;"
      "label = \"重建填充边界\" ;"
      " }"
      ":button {"
      "key = \"tcmj\" ;"
      "label = \"批量填充面积\" ;"
      " }"
      ":button {"
      "key = \"dtbi\" ;"
      "label = \"动态填充比例\" ;"
      " }"
      ":button {"
      "key = \"jctco\" ;"
      "label = \"继承填充\" ;"
      " }"
      ":button {"
      "key = \"cgtc\" ;"
      "label = \"常规填充\" ;"
      " }"
      ":button {"
      "action = \"(done_dialog 0)\" ;"
      "is_cancel = true ;"
      "key = \"btn_Cancel\" ;"
      " label = \"取消\" ;"
      " }"
      " }"
      " }"
    )
)
(setq file (vl-filename-mktemp "DclTemp.dcl"))
(setq f (open file "w"))
(foreach str lst_str
    (princ "\n" f)
    (princ str f)
)
(close f)
;;返回
file
)
;;-----------------填充【结束】----------------------------------------------------------------
;图形预览对话框处理;==DCL控件写幻灯===================(一级)======================================
;;语法 (SL-Lib-ImageFill img_key slide cobak)
;;img_key 图像控件关键字
;;slide 幻灯片名字
;;cobak 图像控件底色
;;功能:对话框图像初始化
(defun SL-Lib-ImageFill (imgkey slide cobak / x1 y1)
(setq x1 (dimx_tile imgkey))
(setq y1 (dimy_tile imgkey))
(start_image imgkey)
(fill_image 0 0 x1 y1 cobak)
(slide_image 0 -2 x1 y1 slide)
(end_image)
)

e2002 发表于 2019-12-29 10:03:53

gcad对DCL的支持还算可以的,没有问题。

尘缘一生 发表于 2019-12-29 11:25:30

e2002 发表于 2019-12-29 10:03
gcad对DCL的支持还算可以的,没有问题。

找到原因了
(if (not (new_dialog "填充" dcl_id)) (exit))   填充,不能用汉字,改成字符即可了。
页: [1]
查看完整版本: 浩辰:对话框不兼容CAD吗?