foer123 发表于 2020-5-30 10:14:30

如何创建临时DCL

各位大神求一个LISP和DCL的和在一起的源码   然后如何创建临时DCL源码谢谢

cqu20104225 发表于 2020-5-30 15:36:38

本帖最后由 cqu20104225 于 2020-5-30 15:44 编辑

(defun c:ttdcl ()
;临时dcl
(setq tempname (vl-filename-mktemp "temp.dcl") filen (open tempname "w"))
(foreach stream
    '(
      "dcl:dialog{";定义DCL
      "\nlabel=\"总标题\";";总标题
      "\n:button{label=\"按钮1\"; key=\"bb1\";}";按钮
      "\n:button{label=\"按钮2\"; key=\"bb2\";}"
      "\nok_cancel;}"
   )
    (princ stream filen)
)
(close filen)
(setq dclname tempname)
(setq dcl_id (load_dialog dclname));加载临时DCL
(if (not (new_dialog "dcl" dcl_id)) (exit))
(action_tile "bb1" "(done_dialog 1)");定义按钮1动作
(action_tile "bb2" "(done_dialog 2)");定义按钮2动作
(action_tile "accept" "(exit)");确认退出
(setq dd (start_dialog))
(unload_dialog dcl_id)
(vl-file-delete dclname);删除临时文件
(cond
      ((= dd 1) (tt1));tt1---命令1
      ((= dd 2) (tt2));tt1---命令2
      (t (exit))
)
)

(defun tt1 ()
(alert "\n测试DCL")
)

(defun tt2 ()
(alert "\n测试DCL")
)

foer123 发表于 2020-6-1 14:01:33

cqu20104225 发表于 2020-5-30 15:36
(defun c:ttdcl ()
;临时dcl
(setq tempname (vl-filename-mktemp "temp.dcl") filen (open tempname ...

谢谢   {:1_1:}

zj20190405 发表于 2020-8-26 13:40:28

cqu20104225 发表于 2020-5-30 15:36
(defun c:ttdcl ()
;临时dcl
(setq tempname (vl-filename-mktemp "temp.dcl") filen (open tempname ...

多谢大佬热心指导

zj20190405 发表于 2020-8-26 13:41:32

cqu20104225 发表于 2020-5-30 15:36
(defun c:ttdcl ()
;临时dcl
(setq tempname (vl-filename-mktemp "temp.dcl") filen (open tempname ...

大佬,请问下,如何在你的这个里面加入日期显示

zmzk 发表于 2022-12-26 10:41:51

有点用,收藏了

注册 发表于 2022-12-28 05:38:36

谢谢分享!!!!
页: [1]
查看完整版本: 如何创建临时DCL