See the top rated post in this thread. Click here

Results 1 to 5 of 5

Thread: Delay / Wait in Lisp

  1. #1
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Delay / Wait in Lisp

    Anyone know of a way to delay further execution for a specified time? I know I can use the DELAY command, but that doesn't work if you cannot issue a command at that point.

  2. #2
    Active Member
    Join Date
    2002-12
    Posts
    77
    Login to Give a bone
    1

    Default Re: Delay / Wait in Lisp

    Quote Originally Posted by irneb View Post
    Anyone know of a way to delay further execution for a specified time? I know I can use the DELAY command, but that doesn't work if you cannot issue a command at that point.

    Try this

    Code:
    ;;; ------------ SUBROUTINE TO PAUSE
    (defun WAIT (Seconds / Stop)
    		
    	(setq Stop (+ (getvar "DATE") (/ Seconds 86400.0)))
    	(while (> Stop (getvar "DATE"))
    		(princ)
    	)
    )

  3. #3
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: Delay / Wait in Lisp

    Thanks, that should work I suppose ... just ... it uses 100% CPU to wait ... so what I'm waiting for is never completing ... oh well, maybe I simply have to find other ways of writing my code!

  4. #4
    Active Member
    Join Date
    2002-12
    Posts
    77
    Login to Give a bone
    0

    Default Re: Delay / Wait in Lisp

    Not sure what you are trying to do but you may want a while loop? What I posted was a sub to stop processing
    Anyone know of a way to delay further execution for a specified time?
    If you want to wait til something is completed then you'll need a loop for that.

  5. #5
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: Delay / Wait in Lisp

    Thanks, I do get the picture. The thing is it's an asynchronous call to ACad using ActiveX. So while the lisp is (princ)'ing it makes ACad not respond to the ActiveX call. If it was in another proggy, then windows would have shared the CPU load. All I can think of is to check the CMDACTIVE sysvar, but still that's going to loop right?

    Oh well, maybe look into reactors ... just need to restart the lisp after approximately X seconds, but leave ACad's running alone so the other command has time to finish. BTW, I'm using a call to the Script ActiveX object to send keys to ACad - so I can try to send Alt+? into a dialog box.

Similar Threads

  1. time delay fuse graph lisp routine?
    By Liamnacuac in forum AMEP General
    Replies: 0
    Last Post: 2010-02-08, 04:24 PM
  2. This is a good thing....can't wait!!!
    By dellis in forum DV - The 3rd Dimension
    Replies: 0
    Last Post: 2008-10-30, 08:32 PM
  3. How long do you wait for Support Requests?
    By Andre Baros in forum Revit Architecture - General
    Replies: 16
    Last Post: 2008-04-28, 08:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •