明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
楼主: 纵横八方

[提问] 怎么在面板标题头上 加入 <日期+星期+当前时间>

[复制链接]
发表于 2018-11-3 20:14 | 显示全部楼层

dear sir ,

thanks its working
发表于 2018-11-3 20:16 | 显示全部楼层
yaokui25 发表于 2018-11-3 18:36
(action_tile "accept"
    "(done_dialog)"
);action_tile

dear sir,
till not working
please explain with full code
发表于 2019-2-10 19:58 | 显示全部楼层
这是DCL不是OpenDCL吧
发表于 2019-11-20 09:44 | 显示全部楼层
你好,我试了一下,怎么没用呀?
发表于 2020-8-24 23:12 | 显示全部楼层

多谢大佬啊
发表于 2020-9-29 21:04 | 显示全部楼层
你好,请教一下,怎么在这个面板下边的帮助按钮旁边增加一个按钮,点击这个按钮就打开指定位置的其它vlx文件?
我加入下边这句之后,可以用快捷命令启动指定的程序,但是点击按钮没反应,按钮那个地方应该怎么写?
(defun c:***() (if (null c:***) (load "D:/***.VLX"))(c:***));打开其它程序

这个地方应该怎么写,才能让点击按钮也能够启动指定的程序?
   ":button{key = \"c:***\";label = \"批量打印\";}\n"

另一个问题,我加载了一个外部程序之后,加载第二个的话,
提示说“出现硬错误 ***
已达内部堆栈限制 (模拟)”

最后我想在左下角增加时间,应该怎么写,能说一下吗。我试了帖子里说的那些,都不出现时间,应该是我写的不对。

谢谢了

下边是源码
(defun Dcl-ButtonM (titl buttons flag / a b c)
   (defun strsplist (str / i)
     (if (setq i (vl-string-search " " str))
       (list (substr str 1 i)
                                 (vl-string-trim " " (substr str (+ 2 i)))
       )
                 )
   )
   (defun makedcl (str_lst / fileID dclHandle)
     (setq
                         dclfile (vl-filename-mktemp nil nil ".dcl")
                         fileID  (open dclfile "w")
     )
     (cond
                         ((= (type str_lst) 'str)
                                 (write-line str_lst fileID)
                         )
                         ((= (type str_lst) 'list)
                                 (foreach n str_lst (write-line n fileID))
                         )
                 )
                 (close fileID)
                 (setq dclHandle (load_dialog dclfile))
         )
         (setq
                 b (if flag
                                 ":column{label = \""
                                 (strcat
                                 ":spacer{ wide=1; fixed_width=true;} \n"
                                 ":spacer{ wide=1; fixed_width=true;} \n"
                                 ":row{label = \""
                                 )
                    )
                 c (if flag
                                 ":row{label = \""
                                 ":column{label = \""
                         )
                 d '("ESC")
                 a (strcat (vl-string-translate
                                                                 "$~"
                                                                 "AB"
                                                                 (vl-filename-base (vl-filename-mktemp))
                                                         )
                                 ":dialog{label=\""
                                 titl
                                 "\";\n"
                                 b
                                 "\";\n"
                         )
   )
   (foreach x buttons
     (if (listp x)
       (progn
         (setq a (strcat a c (car x) "\";\n"))
         (foreach y (last x)
           (setq
                                                 b (strsplist y)
                                                 a (if b
                                                                 (strcat a
                                                                         ":button {key =\""
                                                                         (car b)
                                                                         "\";label=\""
                                                                         (last b)
                                                                         "\";}\n"
                                                                 )
                                                                 (strcat a "spacer_0;\n")
                                                         )
                                                 d (if (/= (car b) nil)
                                                                 (cons (car b) d)
                                                                 d
                                                         )
           )
         )
         (setq a (strcat a "}\n"))
       )
       (setq a (strcat a "spacer_0;\n"))
     )
   )
         (setq
                 d    (cdr (REVERSE d))
                 a    (strcat a
                                          "}"
                                          ":text{key=\"str\";label=\"文字\";}"
                                          ":row{"
                                          ":spacer { width = 60; } "
                                          ":button{key = \"c:***\";label = \"批量打印\";}\n"
                                          ":button{key = \"HLP\";label = \"帮助\";}\n"
                                          ":button{key=\"ESC\";label=\"取消\";is_cancel = true;}}}"
                                  )
                 dcl  (makedcl a)
                 lst1 '()
                 i    1
   )
   (foreach key d
     (setq
                         tx   (strcat "(action_tile \""
                                                  key
                                                  "\"\"(done_dialog "
                                                  (itoa i)
                                                  ")\")"
                                          )
                         lst1 (cons tx lst1)
                         i    (1+ i)
     )
   )
   (new_dialog (substr a 1 8) dcl)
   (action_tile "ESC" "(done_dialog 0)")
   (action_tile "HLP" "(alert\"帮助\")")
   (eval (read (strcat "(progn" (apply 'strcat lst1) ")")))
   (setq ctl (start_dialog))
   (UNLOAD_DIALOG dcl)
   (vl-file-delete dclfile)
         (if (/= ctl 0)
     (eval (read (strcat "(c:" (nth (- ctl 1) d) ")")))
   )
)
(defun c:tt (/ lst)
   (setq        lst '(
                         ("命令"
                                 ("0 改为0层  "
                         )
                         ("视口"
                                 ("ZZ 视口比例 "
                         )

                )
   )        
  (Dcl-ButtonM "xx工具箱 " lst nil)
         (princ)
)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-4-25 19:13 , Processed in 0.244802 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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