Results 1 to 6 of 6

Thread: How to Show A Real Timer

  1. #1
    AUGI Addict
    Join Date
    2006-04
    Location
    (getpoint "Anywhere on the Enter Key =>")
    Posts
    1,160
    Login to Give a bone
    0

    Default How to Show A Real Timer

    Hi ALL,

    I know the following phrase or similar:

    (menucmd "M=$(edtime, $(getvar, date),MO/DD/YY HH:MM:SS)")

    But how to show a real timer - I mean the timer showing the live second digit.

    Can anyone help?


    Thanks,

    Ke

  2. #2
    I could stop if I wanted to
    Join Date
    2003-11
    Posts
    277
    Login to Give a bone
    0

    Default Re: How to Show A Real Timer

    Hi ke.li,
    test my code
    Code:
    ; ddc is stand for Display Digital Clock
    ;        Design by  : Adesu <Ade Suharna>
    ;        Email      : mteybid@yuasabattery.co.id
    ;        Homepage   : http://www.yuasa-battery.co.id
    ;        Create     : 15 April 2006
    ;        Program no.: 0357/04/2006
    ;        Edit by    : Adesu 29/08/2007    1).
    (defun c:ddc (/ txs stx loc1 th el1 sse1 dhr loc1a  el4 loc2 el2 sse2 dmin loc2a el5
    	      loc3 el3 sse3 dsec  year month date loc4 th1 str4  el6 start
    	      end time hour minute second )
      (setq txs (getvar "textstyle"))                       ; for get textstyle current
      (setq stx "Arial")
      (if
        (= (tblsearch "style" "arial") nil)                 ; 1)
        (command "_style" stx stx "0" "1" "0" "n" "n" "n")
        )                                                   ; if
      (setvar "textstyle" stx)                              ; for set new textstyle
      (setq loc1 (getpoint "\nClick any location for put clock<0,0,0>: "))
      (if (= loc1 nil)(setq loc1 '(0 0 0)))
      (setq th 5)
      (command "_text" loc1 th "" "00" 0)
      (setq el1 (entlast))
      (setq sse1 (entget el1))
      (setq dhr (cdr (assoc 1 sse1)))    
      (setq loc1a (list (+ (car loc1) 8.5)(cadr loc1)(caddr loc1)))
      (command "_text" loc1a th "" ":" 0)
      (setq el4 (entlast))
      (setq loc2 (list (+ (car loc1) 10)(cadr loc1)(caddr loc1)))
      (command "_text" loc2 th "" "00" 0)
      (setq el2 (entlast))
      (setq sse2 (entget el2))
      (setq dmin (cdr (assoc 1 sse2)))   
      (setq loc2a (list (+ (car loc1) 18.5)(cadr loc1)(caddr loc1)))
      (command "_text" loc2a th "" ":" 0)
      (setq el5 (entlast))
      (setq loc3 (list (+ (car loc2) 10)(cadr loc2)(caddr loc2)))
      (command "_text" loc3 th "" "00" 0)
      (setq el3 (entlast))
      (setq sse3 (entget el3))
      (setq dsec (cdr (assoc 1 sse3))) 
      (setq year (substr (rtos (getvar "CDATE") 2 6) 1 4))
      (setq month (substr (rtos (getvar "CDATE") 2 6) 5 2))
      (setq date (substr (rtos (getvar "CDATE") 2 6) 7 2))
      (setq loc4 (polar loc1 (* pi 1.5) 5))
      (setq th1 2.5)
      (cond
        ((= month "01")(setq month "January"))
        ((= month "02")(setq month "February"))
        ((= month "03")(setq month "March"))
        ((= month "04")(setq month "April"))
        ((= month "05")(setq month "May"))
        ((= month "06")(setq month "June"))
        ((= month "07")(setq month "July"))
        ((= month "08")(setq month "August"))
        ((= month "09")(setq month "September"))
        ((= month "10")(setq month "October"))
        ((= month "11")(setq month "November"))
        ((= month "12")(setq month "December"))
        )                                                                  ; cond
      (setq str4 (strcat date "-" month "-" year))
      (command "_text" loc4 th1 "" str4 0)
      (setq el6 (entlast))
      (command "_zoom" "e")                                                ; 1).
      (setq start 0)
      (setq end (getdist "\nEnter value in second for finish<1000>: "))
      (if (= end nil)(setq end 1000))
      (while
        (< start end)
        (setq time (rtos (getvar "CDATE") 2 6))
        (setq hour (substr time 10 2))
        (setq minute (substr time 12 2))
        (setq second (substr time 14 2))         
        (if
          (/= dsec second)
          (progn
    	(entdel el3)
    	(command "_text" loc3 th "" second 0)
    	(setq el3 (entlast))
    	)                                                              ; progn
          )                                                                ; if
        (if
          (/= dmin minute)
          (progn
    	(entdel el2)
    	(command "_text" loc2 th "" minute 0)
    	(setq el2 (entlast))
    	)                                                              ; progn
          )                                                                ; if
        (if
          (/= dhr hour)
          (progn
    	(entdel el1)
    	(command "_text" loc1 th "" hour 0)
    	(setq el1 (entlast))
    	)                                                              ; progn
          )                                                                ; if
        (setq start (1+ start))
        )                                                                  ; while
      (setq lst (list el1 el2 el3 el4 el5 el6))
      (foreach x lst
        (entdel x)
        )                                                                  ; foreach
      (setvar "textstyle" txs)   
      (princ)
      )

    Quote Originally Posted by ke.li View Post
    Hi ALL,

    I know the following phrase or similar:

    (menucmd "M=$(edtime, $(getvar, date),MO/DD/YY HH:MM:SS)")

    But how to show a real timer - I mean the timer showing the live second digit.

    Can anyone help?


    Thanks,

    Ke

  3. #3
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: How to Show A Real Timer

    Ade, how is anyone supposed to get any work done while this is running?

    Ke, why not just display the OS clock? Why force AutoCAD to use CPU cycles for something that is already there in the OS?
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

  4. #4
    AUGI Addict
    Join Date
    2006-04
    Location
    (getpoint "Anywhere on the Enter Key =>")
    Posts
    1,160
    Login to Give a bone
    0

    Talking Re: How to Show A Real Timer

    RobertB,

    It would be nice showing a clock in a dialog box.


    Quote Originally Posted by RobertB View Post
    Ade, how is anyone supposed to get any work done while this is running?

    Ke, why not just display the OS clock? Why force AutoCAD to use CPU cycles for something that is already there in the OS?

  5. #5
    Certifiable AUGI Addict robert.1.hall72202's Avatar
    Join Date
    2004-07
    Location
    Detroit Michigan
    Posts
    2,508
    Login to Give a bone
    0

    Default Re: How to Show A Real Timer

    yahoo widgets anyone?
    I have a nice neon clock running in the corner
    of my cad session.

  6. #6
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: How to Show A Real Timer

    Quote Originally Posted by Robert.Hall View Post
    yahoo widgets anyone?
    I have a nice neon clock running in the corner
    of my cad session.
    Exactly. I can't understand why anyone would want to hog AutoCAD resources to display a "real" clock.
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

Similar Threads

  1. Replies: 0
    Last Post: 2014-12-01, 05:02 AM
  2. Timer Mod.
    By tsassi in forum AutoCAD Customization
    Replies: 2
    Last Post: 2009-02-22, 02:57 PM
  3. DWG Timer Log - HELP!
    By eleonard in forum AutoLISP
    Replies: 7
    Last Post: 2008-04-30, 10:37 PM
  4. Timer
    By whittendesigns in forum Revit Architecture - Wish List
    Replies: 12
    Last Post: 2006-12-15, 05:46 AM
  5. First Timer
    By mkunko in forum New Forum Users (Non technical)
    Replies: 0
    Last Post: 2004-08-12, 05:17 PM

Posting Permissions

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