Jump to content

Putting a time delay on user input


plackowski

Recommended Posts

I'm interested in creating Snake using autolisp, but as far as I can tell, user input is required to get past a grread command. Is there anyway I can break the grread command if no input is received within amount of time?

Link to comment
Share on other sites

I believe that I am understanding you correctly that you have grread setup with tracking. If the user does not move the mouse the code stays on grread.

 

I haven't found a way to get past this.

Link to comment
Share on other sites

You used to be able to supply continuous input to the grread function by including an expression to regenerate the drawing within the grread expression - though, this is not recommended.

 

Here is an example to demonstrate:

(defun c:tg2 ( / o p ) 
   (setq p (getvar 'viewctr))
   (setq o
       (vla-addcircle (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object)))
           (vlax-3D-point (cons (+ (car p) (/ (getvar 'viewsize) 5.0)) (cdr p)))
           (/ (getvar 'viewsize) 20.0)
       )
   )
   (setq p (vlax-3D-point p))
   (while (= 5 (car (grread t 14 1)))
       (vla-rotate o p 0.0175)
       (command "_.regen")
   )
   (princ)
)
(vl-load-com) (princ)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...