LIULISHENG
发表于 2022-4-26 18:30:09
学习学习,感谢分享
ajunseo
发表于 2022-4-26 20:13:25
厉害了!
点赞!
ljfzx
发表于 2022-4-26 20:29:01
其实我一直觉得楼主的品味不错!呵呵!
hf423
发表于 2022-4-26 20:56:33
本帖最后由 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张图处理完后,进度条跑完了,但程序接着处理删除图中大量的块,还要卡一会儿,有没有办法最后处理大量块卡着时间也进入进度条?
紫苏炒黄瓜
发表于 2022-4-26 21:04:11
hf423 发表于 2022-4-26 20:56
(defun HH:rtosr1 (RealNum n / DIMZIN1 SHORTREAL1)
(setq DimZin1 (getvar "DIMZIN"))
(setvar " ...
你可以随心所欲的控制xxjd.txt内容,大于等于100才会退出进度条。
sachindkini
发表于 2022-4-26 21:29:26
学习学习
guosheyang
发表于 2022-4-26 21:39:47
感谢共享!学习下
jxy308
发表于 2022-4-26 22:43:33
不耻下问,好好学习
taoyi0727
发表于 2022-4-26 22:50:34
文字说明在没有图片的情况下要大于220才能正确显示,有图片要比这个数字更大才行
想写个函数来生成xxjdsz.txt文件,生成出来的txt为ANSI格式,然后出来的进度条就乱码了
楼主能再更新下吗?
;;说明:设置进度条
;;参数:title:窗口标题
;;参数:picture:图片名称
;;参数:picture-url:图片连接/应用名称
;;参数:explain:说明
;;参数:width:窗口宽度
;;参数:height:窗口高度
;;返回: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
)
)
)
ynpxqjlb
发表于 2022-4-26 23:15:48
学习一下!!