Author Topic: How to run a lisp when close file ?  (Read 2656 times)

0 Members and 1 Guest are viewing this topic.

kruuger

  • Bull Frog
  • Posts: 372
Re: How to run a lisp when close file ?
« Reply #30 on: June 04, 2012, 12:20:53 am »
What is to prevent the user from opening the drawing, and doing nothing for several hours and saving the drawing (effectively producing nothing). Won't their time still be logged?

Perhaps it would be prudent to incorporate a Sysvar Reactor that monitors Cmdactive, and when commands are not active, the timer is prgramatically stopped. Just a thought, as this thread somewhat reminds me an AUGI thread about CadTempo.
program is not used for monitoring work. purpose is to easy track person who modify the drawing.
we can get him and point out that something was wrong in drawing.
kruuger

BlackBox

  • Water Moccasin
  • Posts: 2306
Re: How to run a lisp when close file ?
« Reply #31 on: June 04, 2012, 09:13:14 am »

program is not used for monitoring work. purpose is to easy track person who modify the drawing.
kruuger

I would argue that one is dependent on the other.

Without the context of knowing what modification(s) have occurred, one cannot possibly know which user(s) is(are) responsible.

Again, were a user to open a drawing, draw a line, delete the line just drawn, then save the drawing (effectively doing nothing)... That user would be logged.

"Potential has a shelf life." - Margaret Atwood

dgorsman

  • Swamp Rat
  • Posts: 1414
Re: How to run a lisp when close file ?
« Reply #32 on: June 04, 2012, 09:23:24 am »
A long time ago, I was in the same boat.  The piping lead asked me to print off a stack of drawings.  A few days later he comes back and asks "Why was this changed?"  "This shouldn't look like this" and so on, pointing to my name on an automated datestamp on the prints.  I had to repeated point out to him that the log (datestamp on drawing in this case) was only changed when the drawing was printed and I had *never* worked on the drawings.

The moral of the story: tracking logs don't always say what you think they are saying.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

kruuger

  • Bull Frog
  • Posts: 372
Re: How to run a lisp when close file ?
« Reply #33 on: June 04, 2012, 09:52:28 am »

program is not used for monitoring work. purpose is to easy track person who modify the drawing.
kruuger

I would argue that one is dependent on the other.

Without the context of knowing what modification(s) have occurred, one cannot possibly know which user(s) is(are) responsible.

Again, were a user to open a drawing, draw a line, delete the line just drawn, then save the drawing (effectively doing nothing)... That user would be logged.
A long time ago, I was in the same boat.  The piping lead asked me to print off a stack of drawings.  A few days later he comes back and asks "Why was this changed?"  "This shouldn't look like this" and so on, pointing to my name on an automated datestamp on the prints.  I had to repeated point out to him that the log (datestamp on drawing in this case) was only changed when the drawing was printed and I had *never* worked on the drawings.

The moral of the story: tracking logs don't always say what you think they are saying.
it's a better have more people on log list rather then none.
in my case log per day is good enough to find someone who made a bad mistake.
if someone is working in company where every move are tracked, then my compassion.
kruuger



irneb

  • Swamp Rat
  • Posts: 1244
  • ACad R9-2013, Revit Arch 6-2013
Re: How to run a lisp when close file ?
« Reply #34 on: June 04, 2012, 11:30:17 am »
Again, were a user to open a drawing, draw a line, delete the line just drawn, then save the drawing (effectively doing nothing)... That user would be logged.
I can't remember, does the SysVar reactor catch changes in the CmdActive sysvar? If so perhaps just save a running total of how many commands the user's used during his/her editing time. E.g. if they've had the DWG open for several hours, but only 10 commands were issued, they probably only had it open as a reference to another drawing (i.e. for something like Copy-n-Paste).

Another alternative could be to count the number of objects inside the drawing at open, and then save the difference at Save. That way you can see how much extra work / erases were made.

There's no perfect answer, especially since any user could have multiple DWGs open at the same time. But it's near impossible to work on more than 1 at any one instant. Also what about those using RefEdit? They're inside one DWG, but actually modifying another.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

BlackBox

  • Water Moccasin
  • Posts: 2306
Re: How to run a lisp when close file ?
« Reply #35 on: June 04, 2012, 11:54:51 am »
There's no perfect answer

This is the most accurate phrase yet.  :lol:

I can't remember, does the SysVar reactor catch changes in the CmdActive sysvar?


I'd have to experiment myself, now that you mention it.

Another alternative could be to count the number of objects inside the drawing at open, and then save the difference at Save. That way you can see how much extra work / erases were made.

There's no perfect answer, especially since any user could have multiple DWGs open at the same time. But it's near impossible to work on more than 1 at any one instant. Also what about those using RefEdit? They're inside one DWG, but actually modifying another.

Giving this a bit more thought, perhaps to simplify the who-dun-it concept _and_ to provide clear identification of what modifications have been made, a programmatic file copy at Save would prove useful. Then modify the dialog to present the user with the log list, and upon selection (or checkbox, etc.) the associated drawing (the one logged to that event/date/user) is programmatically referenced into the active drawing for 'review'.

While I do not keep track of who-dun-what, I do keep what I term 'void' copies of our drawings, which are made via LISP routine using a command (aptly named c:VOID ) to programmatically copy the drawing to a predetermined folder within our project's directory structure, adding the date to the file name. This can then be referenced to easily identify what changes were made, etc.

Admittedly, this can cause storage issues for those without the benefit of having massive amounts of available server space, etc.. This is just my workflow, and is certainly not perfect, nor would it apply to all. Just thought I'd share.
"Potential has a shelf life." - Margaret Atwood

HasanCAD

  • Swamp Rat
  • Posts: 689
Re: How to run a lisp when close file ?
« Reply #36 on: June 05, 2012, 02:00:03 am »
How to reset the LOG?
In some cased ( specially in details drawings) we copy and rename an old file to use in a new projects.
So we need to reset the file history.

HasanCAD

  • Swamp Rat
  • Posts: 689
Re: How to run a lisp when close file ?
« Reply #37 on: June 05, 2012, 02:13:43 am »
The monitoring of the user activity is the response of the senior/team leader as well.
for monitoring the user activity we can use LEE's lisplog routine

kruuger

  • Bull Frog
  • Posts: 372
Re: How to run a lisp when close file ?
« Reply #38 on: June 05, 2012, 02:19:17 am »
How to reset the LOG?
In some cased ( specially in details drawings) we copy and rename an old file to use in a new projects.
So we need to reset the file history.
Code - Auto/Visual Lisp: [Select]
  1. (defun c:DLOG ()
  2.  (if (cd:DCT_GetDict (namedobjdict) "ADS_HISTORY")
  3.    (progn
  4.      (cd:DCT_RemoveDict (namedobjdict) "ADS_HISTORY")
  5.      (princ "\nLog history was deleted")
  6.    )
  7.    (princ "\nNo log history in drawing")
  8.  )
  9.  (princ)
  10. )
  11. ; =========================================================================================== ;
  12. ; Pobiera slownik / Gets a dictionary                                                         ;
  13. ;  Root [ENAME/nil] - ENAME = slownik "rodzic" / "parent" dictionary                          ;
  14. ;                     nil   = (namedobjdict) jako "rodzic" / (namedobjdict) as "parent"       ;
  15. ;  Name [STR]       - nazwa slownika / name of the dictionary                                 ;
  16. ; ------------------------------------------------------------------------------------------- ;
  17. ; (cd:DCT_GetDict (namedobjdict) "NAZWA")                                                     ;
  18. ; =========================================================================================== ;
  19. (defun cd:DCT_GetDict (Root Name)
  20.  (cdr (assoc -1 (dictsearch (if (not Root) (namedobjdict) Root) Name)))
  21. )
  22. ; =========================================================================================== ;
  23. ; Usuwa slownik / Removes the dictionary                                                      ;
  24. ;  Root [ENAME/nil] - ENAME = slownik "rodzic" / "parent" dictionary                          ;
  25. ;                     nil   = (namedobjdict) jako "rodzic" / (namedobjdict) as "parent"       ;
  26. ;  Name [STR]       - nazwa slownika / name of the dictionary                                 ;
  27. ; ------------------------------------------------------------------------------------------- ;
  28. ; (cd:DCT_RemoveDict (namedobjdict) "NAZWA")                                                  ;
  29. ; =========================================================================================== ;
  30. (defun cd:DCT_RemoveDict (Root Name)
  31.  (dictremove (if (not Root) (namedobjdict) Root) Name)
  32. )
  33. (princ "\n>> Type DLOG to invoke <<")
?
k.

HasanCAD

  • Swamp Rat
  • Posts: 689
Re: How to run a lisp when close file ?
« Reply #39 on: June 07, 2012, 04:10:24 am »
Thanks Kruuger for the awesome lisp I'll study to learn from.

HasanCAD

  • Swamp Rat
  • Posts: 689
Re: How to run a lisp when close file ?
« Reply #40 on: June 07, 2012, 04:19:21 am »
...
rewritten AUTOR.LSP to LOG.LSP (new shortcut LOG)
...
kruuger
How did you do the yellow circle which moved with the mouse?

Coder

  • Bull Frog
  • Posts: 320
Re: How to run a lisp when close file ?
« Reply #41 on: June 07, 2012, 06:55:38 am »
...
rewritten AUTOR.LSP to LOG.LSP (new shortcut LOG)
...
kruuger
How did you do the yellow circle which moved with the mouse?

It is an option in the video recorder , nothing is related to lisp .

jbuzbee

  • Swamp Rat
  • Posts: 788
Re: How to run a lisp when close file ?
« Reply #42 on: June 07, 2012, 10:39:31 am »
This needs an OpenDCL interface: just sayen . . .  8-)
James Buzbee
Windows XP