Author Topic: Spinners  (Read 2291 times)

0 Members and 1 Guest are viewing this topic.

whdjr

  • Guest
Spinners
« 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?

M-dub

  • Guest
Spinners
« Reply #1 on: October 13, 2004, 09:22:28 AM »
: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)...

whdjr

  • Guest
Spinners
« Reply #2 on: October 13, 2004, 09:35:12 AM »
Quote from: M-dub
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

Columbia

  • Guest
Spinners
« Reply #3 on: October 13, 2004, 09:56:05 AM »
There's actually a couple of cool ways to do what you want.  Here is one way...

Place this snippet within your looping function...
Code: [Select]

(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.

whdjr

  • Guest
Spinners
« Reply #4 on: October 13, 2004, 01:47:11 PM »
Anyone got one that shows a percent complete?

V-Man

  • Bull Frog
  • Posts: 343
  • I exist therefore I am! Finally Retired!
Spinners
« Reply #5 on: October 13, 2004, 02:57:04 PM »
Here is quick and dirty snip..

Code: [Select]

(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) "%"))
)
AutoCAD 9 - 2023, AutoCADMap 2008 - 2010, Revit 2012 - 2022, Autocad Civil 3D 2023