Author Topic: Anyone know how to fix the animation caused by dialog box ?  (Read 1169 times)

0 Members and 1 Guest are viewing this topic.

CatDance

  • Newt
  • Posts: 57
Anyone know how to fix the animation caused by dialog box ?
« on: October 25, 2021, 02:55:44 PM »
After a display of dialog box, the animation is affected.

If I commented the line of dialog box ie. the line 3 as shown below (not displaying a dialog box) then animation is okay,

Code - Auto/Visual Lisp: [Select]
  1. (defun C:Test ()
  2.  
  3.   (alert "Toggle this dialog box to ON/Off will affect how animation is displayed on screen")
  4.   (setq x 50.0)
  5.   (setq CCo 0)
  6.   (command "zoom" "c" "100, 100" 100)
  7.   (repeat 10
  8.     (setq CCo (1+ CCo))
  9.     (command "text" "j" "mc" (list x 100) "35" "0" (itoa CCo))
  10.     (DelayTim$ 350)
  11.     (command "erase" (entlast) "")
  12.     (setq x (+ x 10))
  13.   )
  14.  
  15. );defun C:Test
  16.  
  17.  
  18.  
  19.  
  20.  
  21. ;===========================================================================================
  22. ; DelayTimer$                                                              
  23. ;==============================================
  24. (defun DelayTim$ (d / CurrTime)
  25.   (setq RepeatLoop t)
  26.   (setq PrevTime (* 864000000 (getvar "cdate")))
  27.   (while RepeatLoop
  28.     (setq CurrTime (* 864000000 (getvar "cdate")))         ;get current time
  29.     (if (> (- CurrTime PrevTime) d) (setq RepeatLoop nil)) ;if timer not lapsed yet, delay for d millisec
  30.     (command "zoom" "c" "100, 100" 100)
  31.  
  32.   )  
  33. ) ;defun DelayTimer$
  34.  
  35.  
A must-read book: Amazing story how Bill + Paul started Microsoft and history of computer revolution.
https://www.amazon.com/Hard-Drive-Making-Microsoft-Empire/dp/0887306292

Brief history of Microsoft
https://www.youtube.com/watch?v=BLaMbaVT22E

Lee Mac

  • Seagull
  • Posts: 12905
  • London, England
Re: Anyone know how to fix the animation caused by dialog box ?
« Reply #1 on: October 25, 2021, 03:21:41 PM »
Rather than using a processor-intensive while loop for your delay function, I would suggest calling the DELAY command, e.g. -
Code - Auto/Visual Lisp: [Select]
  1. (defun delaytim$ ( ms )
  2.     (command "_.delay" ms "_.zoom" "_c" '(100 100) 100)
  3. )

CatDance

  • Newt
  • Posts: 57
Re: Anyone know how to fix the animation caused by dialog box ?
« Reply #2 on: October 25, 2021, 03:31:11 PM »
Rather than using a processor-intensive while loop for your delay function, I would suggest calling the DELAY command, e.g. -
Code - Auto/Visual Lisp: [Select]
  1. (defun delaytim$ ( ms )
  2.     (command "_.delay" ms "_.zoom" "_c" '(100 100) 100)
  3. )

Thanks for the quick reply, Lee Mac.
I will give it a try.
A must-read book: Amazing story how Bill + Paul started Microsoft and history of computer revolution.
https://www.amazon.com/Hard-Drive-Making-Microsoft-Empire/dp/0887306292

Brief history of Microsoft
https://www.youtube.com/watch?v=BLaMbaVT22E

CatDance

  • Newt
  • Posts: 57
Re: Anyone know how to fix the animation caused by dialog box ?
« Reply #3 on: October 25, 2021, 03:48:20 PM »
Rather than using a processor-intensive while loop for your delay function, I would suggest calling the DELAY command, e.g. -
Code - Auto/Visual Lisp: [Select]
  1. (defun delaytim$ ( ms )
  2.     (command "_.delay" ms "_.zoom" "_c" '(100 100) 100)
  3. )

It didn't work.
It is strange becos there are other part of codes that are using dialog box too but those are okay. Only this part of the code which I don't understand why ?!?? :blink:
A must-read book: Amazing story how Bill + Paul started Microsoft and history of computer revolution.
https://www.amazon.com/Hard-Drive-Making-Microsoft-Empire/dp/0887306292

Brief history of Microsoft
https://www.youtube.com/watch?v=BLaMbaVT22E

d2010

  • Bull Frog
  • Posts: 323
Re: Anyone know how to fix the animation caused by dialog box ?
« Reply #4 on: October 26, 2021, 12:22:54 PM »
Rather than using a processor-intensive while loop for your delay function, I would suggest calling the DELAY command, e.g. -
Code - Auto/Visual Lisp: [Select]
  1. (defun delaytim$ ( ms )
  2.     (command "_.delay" ms "_.zoom" "_c" '(100 100) 100)
  3. Thanks for the quick reply, Lee Mac.
  4.  
The solution form <Mr.LeeMac is good, buy a secondary question
=How to calibrate between, the speeds? (speed of GraphScr, speed of TextScr, s)
 :straight: