TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: whdjr on October 13, 2004, 09:13:39 AM
-
I have seen a few references made to spinners(progress indicators / percentage complete) around here, but I can't find any code. Is there a good one someone could post or are there no good spinners? Are spinners a good thing or a bad thing? When you have a program that looks like it is hung up the user gets finger-happy on the escape key. What is the best way to give them a progress indicator?
-
:lol: :obsessed:
The spinners I know of are a really good thing, but I don't think Mark would like it if I talked about them here! :razz: ;)
Of course, there's also the spinners in my fishin' tackle box, but I don't know of any spinners in the coding world...Over my head (among many other things)...
-
Of course, there's also the spinners in my fishin' tackle box
Just because we're in the swamp you always gotta bring up that fishin thing eh? :D
-
There's actually a couple of cool ways to do what you want. Here is one way...
Place this snippet within your looping function...
(defun SPIN ()
(setq a_s (if a_s a_s 4))
(princ
(strcat
"\r"
(cadr
(member
(rem (setq a_s (1+ a_s)) 4)
'(0 "|" 1 "/" 2 "-"3 "\\")
)
)
)
)
)
But the way I prefer is to use DOSLib (from McNeel) and the (Dos_Progress) function located within that library.
-
Anyone got one that shows a percent complete?
-
Here is quick and dirty snip..
(setq filterlist '(
(-4 . "<OR")
(-4 . "<AND")
(0 . "LWPOLYLINE")
(8 . "ROADS")
(-4 . "AND>")
(-4 . "OR>")
)
)
(setq allpoly (ssget "x" filterlist))
(setq plinect 0)
(repeat (sslength allpoly)
(command "regen")
(setq plinect (+ plinect 1))
(princ (strcat "\nPercent complete: " (rtos (* (/ (float plinect) (float (sslength allpoly))) 100) 2 1) "%"))
)