本帖最后由 紫苏炒黄瓜 于 2022-5-4 23:19 编辑

  演示1,自定义图片
  演示2,自定义窗口大小
  演示3,支持网络图片、GIF


演示4(静图),支持无图片(感谢taoyi0727 的建议)

演示貌似不能重复播放,下载看吧

自由设置开启时机,自由控制进度快慢、进退。
进度条为外部进程,独立运行不干扰CAD
可自定义标题、图片、说明、窗口尺寸等。


2022.4.26晚更新,1、新增支持gif、网络图片等;2、支持无图模式。
2022.4.27更新,1、解决编码问题;2、增加完成提示;3、增加窗口位置设置。注意改变了原有设置顺序。
***********************************************
2022.5.2更新2个附件已更新,需重新下载)。1、解决进度编辑不了的bug;2、解决进度同步状态不佳的bug;3、完善函数,直接使用。(感谢aoyi0727写的函数

本次更新稳定性和可控性得到了极大提升,详见函数及用法示例.lsp

函数及用法示例.lsp 回复可见

***********************************************
顺手也支持一下批打吧 http://bbs.mjtd.com/thread-183063-1-1.html









网友答: 应该不会卡死。
收了几个钢镚,够我逛逛了。不再收啦。


网友答:

文字说明在没有图片的情况下要大于220才能正确显示,有图片要比这个数字更大才行
想写个函数来生成xxjdsz.txt文件,生成出来的txt为ANSI格式,然后出来的进度条就乱码了
楼主能再更新下吗?



;;说明:设置进度条
;;参数:title:窗口标题 [str]
;;参数:picture:图片名称 [str]
;;参数:picture-url:图片连接/应用名称 [str]
;;参数:explain:说明 [str]
;;参数:width:窗口宽度 [int/str]
;;参数:height:窗口高度 [int/str]
;;返回:t or nil
;;用法T-set-progress "请稍等..." "" "excel" "测试" 200 0)
;;     (T-set-progress "请稍等..." "1.jpg" "https://www.baidu.com/" "测试" 200 0)
(defun T-set-progress (title picture picture-url explain width height)
        (if (and
                                (or (null title) (= (type title) 'str))
                                (or (null picture) (= (type picture) 'str))
                                (or (null picture-url) (= (type picture-url) 'str))
                                (or (null explain) (= (type explain) 'str))
                                (or (= (type width) 'int) (= (type width) 'str))
                                (or (= (type height) 'int) (= (type height) 'str))
                                (setq path "D:\\桌面\\xxjdsz.txt");固定文件名(要和exe同目录)
                                (setq file (open path "w"))
                        )
                (progn
                        (if title       (write-line title file)         (write-line file ""));窗口标题
                        (if picture     (write-line picture file)       (write-line file ""));图片名称
                        (if explain     (write-line explain file)       (write-line file ""));说明
                        (if picture-url (write-line picture-url file)   (write-line file ""));图片连接/应用名称
                        (if width
                                (cond
                                        ((= (type width) 'int)
                                                (write-line (itoa width) file)
                                        )
                                        ((= (type width) 'str)
                                                (write-line width file)
                                        )
                                )
                        );窗口宽度
                        (if height
                                (cond
                                        ((= (type height) 'int)
                                                (write-line (itoa height) file)
                                        )
                                        ((= (type height) 'str)
                                                (write-line height file)
                                        )
                                )
                        );窗口高度
                        (close file)
                        t
                )
        )
)



网友答: 本帖最后由 hf423 于 2022-4-26 20:58 编辑
紫苏炒黄瓜 发表于 2022-4-26 14:25
相信你可以想到办法的。

(defun HH:rtosr1 (RealNum n / DIMZIN1 SHORTREAL1)
  (setq DimZin1 (getvar "DIMZIN"))
  (setvar "DIMZIN" 0)
  (setq ShortReal1 (rtos RealNum 2 n))
  (setvar "DIMZIN" DimZin1)
  ShortReal1
)

(setq jdtexe (findfile "通用进度条.exe"))
(setq xxjdtxt (findfile "xxjd.txt"))
(setq xxjdsztxt (findfile "xxjdsz.txt"))
(startapp jdtexe);调用exe
(setq n 1)
(setq n1 1)
(setq jdz (/ (length file_list) 100.0))

;The following may be a repeat, a foreach or a while loop

(if (> n jdz);每完成1%时
    (progn
             (setq f (open xxjdtxt "w"))
             (princ (itoa (setq n1 (+ n1 (cond((< jdz 1)(read(HH:rtosr1 (/ 1.0 jdz) 0)))(t 1))))) f)
             (close f)
             (setq n 1)
     )
)

这回20次OK了。
另外想问一问,我是放到批量插图功能里,20张图处理完后,进度条跑完了,但程序接着处理删除图中大量的块,还要卡一会儿,有没有办法最后处理大量块卡着时间也进入进度条?

网友答: 厉害了!
点赞!

网友答: 请问在lisp应用这个进度条的时候,会假死吗

网友答: 学习学习  楼主的批量打印在用

网友答: 看看好不好用  

网友答: try it try it!

网友答:


在不要图片情况下  还是有网址链接
改窗口大小 进度条显示位置不对


网友答: 想不要链接就改链接那一行
窗口尺寸不要乱设置。

网友答: 我的意是 不要图片 窗口高度设置到180才能正确显示
  • 上一篇:黑色背景的Notepad++ v5.8.7(Unicode版)
  • 下一篇:没有了