Jump to content

AutoLisp that tracks time - question


jennielowery

Recommended Posts

while searching for a way to more efficiently track my job times on AutoCAD .. I came across an autolisp that someone wrote for someone else who asked for it. It was back from 2010. The thread degraded after a while and no more responses.

 

 

I got the lisp to work, but I'm having trouble deciphering the results properly, and was hoping someone could help.

 

 

I'm from the US, so when dates/times are displayed the way we normally see them .. it always throws me for a loop lol.

 

 

Help?

 

 

Here is the response from the lisp

 

DATE: 30.07.14 16.25.21

DRAWING: G:\LongTermCareRX\Elder Care\Royston, GA\Eldercare - Royston, GA (LTC) V.7 07-30-14.dwg

CREATED: 13.05.14 12.25.18

TOTAL EDITING TIME: 09.32.06

 

 

I'm trying to figure out what the total elapsed edit time is .. I know I opened the drawing at 4:23pm and finished the edit (a test edit not a real edit mind you) and closed/saved the drawing at 4:25pm .. so .. lol .. is that 9 seconds and a bunch of change?

 

 

Just not familiar with this time format.

 

 

TIA,

Jennie

Link to comment
Share on other sites

I can help you with the time part, the TOTAL EDITING TIME is just that, total time since the drawing was created, has nothing to do with the current editing session. Becomes even a bigger issue when you start a drawing by copying another, takes time from original drawing.

Link to comment
Share on other sites

Try this routine.

(defun c:test()
 (defun tmp(l / a l1)
   (setq a '(("1" "January") ("2" "February") ("3" "March") ("4" "April") ("5" "May") ("6" "June")
      ("7" "July") ("8" "August") ("9" "September") ("10" "October") ("11" "November") ("12" "December"))
  l1 (mapcar 'vl-princ-to-string l))
   (cond ((= (length l1) 6) (strcat (cadr (assoc (nth 1 l1) a)) " " (nth 2 l1) " "(nth 0 l1) " - " (nth 3 l1) "h " (nth 4 l1) "m " (nth 5 l1)))
  ((= (length l1) 3) (strcat (nth 0 l1) "h " (nth 1 l1) "m " (nth 2 l1)))
  (t ""))
 )
 
 (load "julian")
 (princ (strcat "\nDate/Time of first save : " (tmp (jtoc (getvar 'TDCREATE)))))
 (princ (strcat "\nDate/Time of last save : " (tmp (jtoc (getvar 'TDUPDATE)))))
 (princ (strcat "\nTotal time of Editing : " (tmp (cdddr (jtoc (getvar 'TDUSRTIMER))))))
 (princ)
)

Link to comment
Share on other sites

There is also the TIME built-in command.

 

 

 

Yes, that was also a suggestion in the thread I got the lisp from .. only problem is .. I have to remember to activate it each time I open a drawing .. and sometimes I open so many a day (while answering the phone and various other tasks not computer related) that sometimes I simply forget .. I need something that I can insert into my acad1014doc.lsp so it starts each time I open a drawing .. lazy I know .. but I need all the help I can get lol .. my memory is awful and my desk covered in sticky notes! haha

 

 

I can help you with the time part, the TOTAL EDITING TIME is just that, total time since the drawing was created, has nothing to do with the current editing session. Becomes even a bigger issue when you start a drawing by copying another, takes time from original drawing.

 

 

thank you! I was afraid that's what was happening but without the OP to ask, I was just guessing .. although the poster claimed it tracked each time you worked on it (and thus produces a log in folder the DWG is housed). This will still work, I will just have to check the log before I start working on old drawings.

 

 

Try this routine.

(defun c:test()
 (defun tmp(l / a l1)
   (setq a '(("1" "January") ("2" "February") ("3" "March") ("4" "April") ("5" "May") ("6" "June")
      ("7" "July") ("8" "August") ("9" "September") ("10" "October") ("11" "November") ("12" "December"))
  l1 (mapcar 'vl-princ-to-string l))
   (cond ((= (length l1) 6) (strcat (cadr (assoc (nth 1 l1) a)) " " (nth 2 l1) " "(nth 0 l1) " - " (nth 3 l1) "h " (nth 4 l1) "m " (nth 5 l1)))
  ((= (length l1) 3) (strcat (nth 0 l1) "h " (nth 1 l1) "m " (nth 2 l1)))
  (t ""))
 )

 (load "julian")
 (princ (strcat "\nDate/Time of first save : " (tmp (jtoc (getvar 'TDCREATE)))))
 (princ (strcat "\nDate/Time of last save : " (tmp (jtoc (getvar 'TDUPDATE)))))
 (princ (strcat "\nTotal time of Editing : " (tmp (cdddr (jtoc (getvar 'TDUSRTIMER))))))
 (princ)
)

 

What does this lisp do exactly?

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...