Author Topic: Hmm  (Read 6429 times)

0 Members and 1 Guest are viewing this topic.

rude dog

  • Guest
Hmm
« on: September 14, 2005, 07:30:30 PM »
When the hide command is initiated (on a 3d model) how does that little cursor spin 360 degrees (@ the command prompt) until the model is "hidden".....Can we right code to mimic that same thing? :|

Bob Wahr

  • Guest
Re: Hmm
« Reply #1 on: September 14, 2005, 07:48:57 PM »
Not sure if it can be done in lisp.

Where in AZ are you?

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Re: Hmm
« Reply #2 on: September 14, 2005, 08:18:03 PM »
If I'm not mistaken what you're seeing is coded in lisp. I don't have any code right now but I'm sure one of the big guns will be along in a few to provide. You use a cond statement to repeat the strings "\"  "|"  "/"  "-" so it looks like it's spinning.
TheSwamp.org  (serving the CAD community since 2003)

Bob Wahr

  • Guest
Re: Hmm
« Reply #3 on: September 14, 2005, 08:35:00 PM »
Doh!  missed the at command prompt.  I was thinking mouse cursor.  I think I have something somewhere that does this.  Am looking.

Bob Wahr

  • Guest
Re: Hmm
« Reply #4 on: September 14, 2005, 08:39:50 PM »
Found this
Code: [Select]
(defun c:spin (wh)
(prompt (strcat "\r "
wh
(cond ((= sp "|") (setq sp "/"))
((= sp "/") (setq sp "-"))
((= sp "-") (setq sp "\\"))
(T (setq sp "|"))
)
)
)
(princ)
)
here

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Re: Hmm
« Reply #5 on: September 14, 2005, 08:50:55 PM »
There it is!! Way to go Bob.  :kewl:
TheSwamp.org  (serving the CAD community since 2003)

rude dog

  • Guest
Re: Hmm
« Reply #6 on: September 14, 2005, 08:59:17 PM »
Jeez that was quick..........
Thank you Mark and Bob
Location mostly <Mesa>
P.S
The forum looks fantastic

SPDCad

  • Bull Frog
  • Posts: 453
Re: Hmm
« Reply #7 on: September 15, 2005, 10:57:30 AM »
Code: [Select]
(defun c:spin (wh)
(prompt (strcat "\r "
wh
(cond ((= sp "|") (setq sp "/"))
((= sp "/") (setq sp "-"))
((= sp "-") (setq sp "\\"))
(T (setq sp "|"))
)
)
)
(princ)
)

Damn, someone beat me to it agian! :(
AutoCAD 2010, w/ OpenDCL

visit: http://reachme.at/spd_designs

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Hmm
« Reply #8 on: September 15, 2005, 11:54:46 AM »
Another variant:

Code: [Select]
(defun busy ( )
    (princ
        (strcat "\r"
            (if
                (setq *busy* ;; oh my, a global
                    (cdr
                        (assoc *busy*
                           '(   ("|" . "/")
                                ("/" . "-")
                                ("-" . "\\")
                                ("\\" . "|")
                            )
                        )
                    )   
                )
                *busy*
                (setq *busy* "\\")
            )           
        )
    )
    (princ)
)

Test drive:

Code: [Select]
(defun nop ( )
    (repeat 50000
        (princ)
    )
)

(repeat 100
    (nop)
    (busy)
)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Hmm
« Reply #9 on: September 15, 2005, 08:40:54 PM »
Bob...

I got an error when tryin your routine...


Command: spin
; error: too few arguments
Keep smile...

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Hmm
« Reply #10 on: September 15, 2005, 08:55:38 PM »
(c:spin "The world is coming to an END")
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Hmm
« Reply #11 on: September 16, 2005, 08:44:04 AM »
(c:spin "The world is coming to an END")


 :? oops....
Keep smile...

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Hmm
« Reply #12 on: September 17, 2005, 08:25:33 AM »
Had this in my library, Don't know the author
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 "\\")
        )
      )
    )
  )
)

Edit: Looking a little closer the a_s is a runaway variable!
« Last Edit: September 17, 2005, 08:42:40 AM by CAB »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Hmm
« Reply #13 on: September 17, 2005, 08:51:17 AM »
I tried to come up with one of my own.
Code: [Select]
(defun SPIN ()
  (or *spin* (setq *spin* 4))
  (princ
    (strcat
      "\r"
      (substr "|\\-/"
        (setq *spin*
               (if (zerop (1- *spin*))
                 4 (1- *spin*)))
      1)
    )
  )
)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Hmm
« Reply #14 on: September 17, 2005, 09:16:53 AM »
How about something different?
Code: [Select]
(defun SPIN ()
  (or *spin* (setq *spin* (list '1+ 1)))
  (princ
    (strcat "\r"
            (substr "**********" 1 (cadr *spin*))
            (substr "           " (1+ (cadr *spin*)))
    )
  )

  (cond
    ((= (cadr *spin*) 0)
     (setq *spin* (list '1+ 2))
    )
    ((= (cadr *spin*) 10)
     (setq *spin* (list '1- 9))
    )
    (t
     (setq *spin*
            (list (car *spin*)
                  (apply (car *spin*) (cdr *spin*))
            )
     )
    )
  )
  (princ)
)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Hmm
« Reply #15 on: September 17, 2005, 09:25:45 AM »
Different is good ...

Workin':

Code: [Select]
(defun Working ( )
    (if (not (eq 'str (type *modemacro*)))
        (setq *modemacro* (getvar "modemacro"))
    )
    (setvar "modemacro"
        (setq *working*
            (cond
            ((eq *working* "!....") "!!...")
            ((eq *working* "!!...") "!!!..")
            ((eq *working* "!!!..") "!!!!.")
            ((eq *working* "!!!!.") "!!!!!")
            ("!....")
            )
        )
    )
    (princ)
)

Cleanup:

Code: [Select]
(defun Done ( )
    (if (eq 'str (type *modemacro*))
        (setvar "modemacro" *modemacro*)
    )
    (setq *modemacro* nil)
    (princ)
)

Test drive:

Code: [Select]
(progn

    ;;  fake a process

    (defun NOP ( )
        (repeat 50000
            (princ)
        )
    )
   
    ;;  pretend we're workin'

    (repeat 100
        (NOP)
        (Working)
    )
   
    ;;  cleanup
   
    (Done)
   
)

:laugh:
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Hmm
« Reply #16 on: September 17, 2005, 10:19:59 AM »
Neat idea, but it is misbehaving in ACAD 2000
I only see the first change to modemacro :-(
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Hmm
« Reply #17 on: September 17, 2005, 10:48:10 AM »
Neat idea, but it is misbehaving in ACAD 2000
I only see the first change to modemacro :-(

Bummer, looks like this in AutoCAD 2006:

Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Hmm
« Reply #18 on: September 17, 2005, 11:02:54 AM »
Cooool, that,s what i had imagined.. 8-)

BTW- Whats Bugs do?
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Hmm
« Reply #19 on: September 17, 2005, 11:07:19 AM »
Bugs, bugs and more bugs.

:kewl:
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Hmm
« Reply #20 on: September 17, 2005, 11:13:12 AM »
Is that (spell) Buggs Bunny or something else?
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Hmm
« Reply #21 on: September 17, 2005, 11:17:08 AM »
I'm thinking it's a doog myself.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Hmm
« Reply #22 on: September 17, 2005, 11:21:16 AM »
 :kewl:
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Hmm
« Reply #23 on: September 17, 2005, 11:22:28 AM »
Woof!
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Hmm
« Reply #24 on: September 17, 2005, 11:32:18 AM »
 :-o
Looked like Bugs to these old eyes until you doctored er ugh enlarged it. :-D
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.