Features of this progress bar:
1. Non-mode,OPENDCL
2. Flexibly customize the position, size, whether to display the title box, and whether to display the text prompt string of the current operation
3. The most important thing is not to be unresponsive to ACAD’s “suspended death”.
(xd::odcl:progress-begin "" info 1 392 24 pos minLen maxLen))
;|
The above variables are in order:
"" ----- If empty, do not display the title box
info --- If empty, no text prompt information will be displayed.
1 --- a progress bar
392 --- Dialog width
24 --- Progress bar height
pos --- dialog box position, 0-upper left of the drawing area 1-upper right of the drawing area 2-lower right of the drawing area 3 lower left of the drawing area 4 middle upper third of the drawing area
minLen ---- Minimum progress value
maxLen ---- maximum progress value
|;
2.(xd::odcl:progress-setpos1 pos sep)
3.(xd::odcl:progress-settext title)
4. (xd::odcl:progress-end)
(defun c:tt ()
(if (and (setq fns (xdrx_system_selectfolder
(xdrx-string-multilanguage
"选择目录"
"Select Directory"
)
""
)
)
(setq files (vl-directory-files fns "*.*" 1))
(xdrx_initget "0 1 2 3 4 Y N")
(setq ye (xdrx_yesorno
(xdrx-string-multilanguage
"\n是否显示文本"
"\nWhether to display text"
)
1
)
)
(setq
pos (getint
(xdrx-string-multilanguage
"\n对话框位置[左上(0)/右上(1)/右下(2)/左下(3)/中间(4)]:"
"\nDialog position [UL(0)/UR(1)/BR(2)/BL(3)/Mid(4)]:"
)
)
)
(xdrx_initget)
)
(progn
(setq
info (if (= ye 1)
(xdrx-string-multilanguage "正在处理" "Processing...")
""
)
len (length files)
)
(xd::odcl:progress-begin "" info 1 392 24 pos 0 len)
(setq i 0)
(foreach n files
(xd::odcl:progress-setpos1 (1+ i) 1)
(xd::odcl:progress-settext
(strcat (xdrx-string-multilanguage "正在处理" "Processing...")
n
)
)
(setq i (1+ i))
(xdrx_sleep 10)
)
(xd::odcl:progress-end)
)
)
(princ)
)