• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

delay the execution of the program

  • Thread starter Thread starter Angelo2449
  • Start date Start date

Angelo2449

Guest
Hello everyone,
I am writing an animation program, my problem is getting a certain delay in running.
delay must be independent of the speed of the processor and, therefore, should be tied to time.
I attach a small lisp that, drawing a line, selecting it and defining the point of rotation, the wheel of an angle of 5°.
I got the delay of about a second, calling a simple external program that is responsible for it.
how could I get the same result with the only lisp?
Thank you.
Code:
 (defun c:ruotalinea (/ lineax perno copyx angx cont a)

(setq lineax (entsel "select line"))
(setq pin (getpoint "clicks the rotation point"))
(setq cont 0)

(repeat 10)
(setq cont (1+ cont))

(runapp "c:\\autocadsupporto\\\libertytre\\ritardo.exe "c:\\autocadsupporto\\\libertytre\\\ritardo.tkn" :vlax-true)

(command "_copy" lineax "" pin pin ")
(setq copyx (entlast)

(setq angx (* cont -5))
(command "_rotate" copyx "" angx pin)
);

);
 
in this lisp (not my... but I do not remember where I took it and apologized with the author!), the use of a progressive bar is shown. to spend time use a simple repeat.
 

Attachments

Hello everyone,
I am writing an animation program, my problem is getting a certain delay in running.
delay must be independent of the speed of the processor and, therefore, should be tied to time.
I attach a small lisp that, drawing a line, selecting it and defining the point of rotation, the wheel of an angle of 5°.
I got the delay of about a second, calling a simple external program that is responsible for it.
how could I get the same result with the only lisp?
Thank you.
Code:
 (defun c:ruotalinea (/ lineax perno copyx angx cont a)

(setq lineax (entsel "select line"))
(setq pin (getpoint "clicks the rotation point"))
(setq cont 0)

(repeat 10)
(setq cont (1+ cont))

(runapp "c:\\autocadsupporto\\\libertytre\\ritardo.exe "c:\\autocadsupporto\\\libertytre\\\ritardo.tkn" :vlax-true)

(command "_copy" lineax "" pin pin ")
(setq copyx (entlast)

(setq angx (* cont -5))
(command "_rotate" copyx "" angx pin)
);

);
Code:
(command "_delay" 1000) 1 second delay
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top