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

Timed Pause

239 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 (226 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 (217 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,879
Registered: ‎09-13-2004
Message 4 of 7 (211 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 (210 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 (186 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,879
Registered: ‎09-13-2004
Message 7 of 7 (157 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
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.