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 (235 Views)

Timed Pause

235 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 (222 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,705
Registered: ‎03-14-2004
Message 3 of 7 (213 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,779
Registered: ‎09-13-2004
Message 4 of 7 (207 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 (206 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,705
Registered: ‎03-14-2004
Message 6 of 7 (182 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,779
Registered: ‎09-13-2004
Message 7 of 7 (153 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
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!