Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Active Contributor
safcadd08
Posts: 49
Registered: ‎10-06-2008
Message 1 of 7 (233 Views)

Timed Pause

233 Views, 6 Replies
06-09-2012 01:09 PM

Hello,

How do I pause for a certain length of time 5 seconds or 10 seconds.

 

Thanks,

Steve

Valued Mentor
Ian_Bryant
Posts: 362
Registered: ‎06-02-2005
Message 2 of 7 (220 Views)

Re: Timed Pause

06-09-2012 05:43 PM in reply to: safcadd08

Hi, try

(defun wait (secs / target)
  (setq target (+ (/ secs 24.0 60.0 60.0) (getvar "date")))
  (while (< (getvar "date") target))
  T
)

 

e.g.

(wait 10) pauses for 10 secs

Ian

Mentor
devitg
Posts: 1,697
Registered: ‎03-14-2004
Message 3 of 7 (211 Views)

Re: Timed Pause

06-09-2012 07:25 PM in reply to: Ian_Bryant
As clear as water. Thanks
*Expert Elite*
Kent1Cooper
Posts: 5,368
Registered: ‎09-13-2004
Message 4 of 7 (205 Views)

Re: Timed Pause

06-09-2012 07:38 PM in reply to: safcadd08

safcadd08 wrote:

....

How do I pause for a certain length of time 5 seconds or 10 seconds.

....


(command "_.delay" 5000)

or

(command "_.delay" 10000)

Kent Cooper
Active Contributor
safcadd08
Posts: 49
Registered: ‎10-06-2008
Message 5 of 7 (204 Views)

Re: Timed Pause

06-09-2012 07:48 PM in reply to: Kent1Cooper
Hi Kent, Forgot to tell you the commands have to lisp and not vlisp... Thanks, Steve
Mentor
devitg
Posts: 1,697
Registered: ‎03-14-2004
Message 6 of 7 (180 Views)

Re: Timed Pause

06-10-2012 09:18 AM in reply to: safcadd08

On Peters´s behalf

 

(command "_.delay" 10000)

 

 

is just pure and simple LISP ,

 

 

not a VLISP´s  BITE

*Expert Elite*
Kent1Cooper
Posts: 5,368
Registered: ‎09-13-2004
Message 7 of 7 (151 Views)

Re: Timed Pause

06-11-2012 08:59 AM in reply to: safcadd08

safcadd08 wrote:
.... Forgot to tell you the commands have to lisp and not vlisp....

As devitg said, they are ordinary AutoLISP.  For an example of how they might be used, paste this into your Command: line:

 

(command "_.line" (getvar 'viewctr) (polar (getvar 'viewctr) 0 (getvar 'viewsize)) "" "_.delay" 5000 "_.rotate" "_last" "" (getvar 'viewctr) "90")

 

and hit Enter.  No matter what your drawing units or zoom level, it should draw a Line from mid-screen off to the right, and 5 seconds later, rotate it so it goes upward.

Kent Cooper
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.