M76 Posted March 9, 2010 Posted March 9, 2010 Hi I'm looking for a program that logs each command ran by the user, with timestamp, and the number of objects affected by the command. Each command would be a line in the log. Optionally it would be nice if it would count lisp routines as one command. But this is not neccessary, only if its easily acheived. Quote
MSasu Posted March 9, 2010 Posted March 9, 2010 Please check this tread: http://www.cadtutor.net/forum/showthread.php?t=27191 Regards, Quote
M76 Posted March 9, 2010 Author Posted March 9, 2010 I did but it doesn't explain how to find the number of changed objects. Quote
M76 Posted March 10, 2010 Author Posted March 10, 2010 Let me rephrase the question, how to count the number of changed objects after I run a command. Quote
MSasu Posted March 10, 2010 Posted March 10, 2010 The code from suggested tread are using reactors to “spy” actions from current drawing – someone with more experience than me on reactors can be able to tell if this routine can be modified to count entities that were affected in surveyed session along with used command. I’m afraid that code poster is no longer member of the forum, so cannot ask him directly for help (see http://www.cadtutor.net/forum/showthread.php?t=43876). My suggestion is to ask a moderator to join this post with the one quoted on post #2 to increase visibility of your issue. Regards, Quote
M76 Posted March 11, 2010 Author Posted March 11, 2010 Well I've checked every possibility but I'm stuck. I've tried using vlr-acdb-reactor which supposed to be exaclty what I need: "Constructs a reactor object that notifies when an object is added to, modified in, or erased from a drawing database" The problem is, that if for example a line is modified, I move one endpoint, it calls the reactor lots of times. It seems that every command affects the number of calls differently if I move the end of a line, 10 calls if I move the start counts 4. If I move a text object that only calls it once. If I edit the value of a text it calls it twice. How am I supposed to count this way? I also tried vlr-object-reactor but it needs a list of objects to watch, so I'd have to constantly update this list with erased or added objects, which would take a lot of time on a large drawing. Quote
mkweaver Posted March 13, 2010 Posted March 13, 2010 Well I've checked every possibility but I'm stuck.I've tried using vlr-acdb-reactor which supposed to be exaclty what I need: "Constructs a reactor object that notifies when an object is added to, modified in, or erased from a drawing database" The problem is, that if for example a line is modified, I move one endpoint, it calls the reactor lots of times. It seems that every command affects the number of calls differently if I move the end of a line, 10 calls if I move the start counts 4. If I move a text object that only calls it once. If I edit the value of a text it calls it twice. How am I supposed to count this way? I also tried vlr-object-reactor but it needs a list of objects to watch, so I'd have to constantly update this list with erased or added objects, which would take a lot of time on a large drawing. Psuedo code: OnCommandStarted - setq active T object modified/added/erased - add it's handle to a list OnCommandEnded - if active T? Yes, remove duplicate handles from list reset active to nil write entry to log end if Quote
Recommended Posts
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.