feargt Posted September 17, 2008 Posted September 17, 2008 Does anybody have a lisp routine for counting commands used in an autocad session, I have tried using google but I only found a routine usable up to acad 2006 and is not useable on Civ3d 2008. Thank you in advance for any assistance received. Quote
ReMark Posted September 17, 2008 Posted September 17, 2008 Why the interest in such a command? Could you not adapt the routine you found to work with software? Quote
ASMI Posted September 17, 2008 Posted September 17, 2008 Just for fun. Use LookCount command to look command count. It works for standard AutoCAD commands only. Lisp, arx, vba commands counting can be added. (defun CmdCount() (vl-load-com) (if(not cmdcount:reactor) (setq cmdcount:reactor (vlr-Command-Reactor nil '((:vlr-commandEnded . CmdCountReaction)) ) cmdcount:count 0) ); end if (princ) ); end of c:cmdcount (defun CmdCountReaction(Reac Arg) (setq cmdcount:count(1+ cmdcount:count)) (princ) ); end of CmdCount (defun c:LookCount() (if cmdcount:count (alert (strcat "\nCommands number = " (itoa cmdcount:count)) ); end alert ); end if (princ) ); end of LookCount (CmdCount) Quote
feargt Posted September 17, 2008 Author Posted September 17, 2008 Hi, the purpose of what I'm looking for is to help me with a proposal that I am making to my boss as to how I can improve productivity. I want to be able to show him how much we can increase productivity with a liitle bit of time investment. Which is the one thing that we are very short on currently so any proposal has to be well researched on my behalf. Quote
feargt Posted September 17, 2008 Author Posted September 17, 2008 Hi asmi, thanks but it appears that this routine only appears to count commands used. I need something that will also list the commands used and how often. Quote
ReMark Posted September 17, 2008 Posted September 17, 2008 Well thanks for clearing things up a bit. Looks like you have modified your original request beyond just counting. Quote
ASMI Posted September 17, 2008 Posted September 17, 2008 thanks but it appears that this routine only appears to count commands used. I need something that will also list the commands used and how often. Ok. (defun CmdSpy() (vl-load-com) (if(not cmdspy:cmdreactor) (setq cmdspy:cmdreactor (vlr-Command-Reactor nil '((:vlr-CommandEnded . CmdSpyReaction)) ); end vlr-Command-Reactor ); end setq ); end if (princ) ); end of CmdSpy (CmdSpy) (defun CmdSpyReaction(Reac Args / cLst) (if (not (setq cLst(assoc(car Args)cmdspy:list))) (setq cmdspy:list(cons(cons(car Args) 1)cmdspy:list)) (setq cmdspy:list(subst(cons(car Args)(1+(cdr cLst))) cLst cmdspy:list)) ); end if (princ) ); end of CmdSpyReaction (defun c:lookcmdlist() (if cmdspy:list (progn (setq cmdspy:list (vl-sort cmdspy:list '(lambda(a b)(>(cdr a)(cdr b))))) (princ "\n====== Command Statistic ======\n") (foreach i cmdspy:list (princ(strcat "\n "(car i)" ")) (repeat(- 25(strlen(car i)))(princ ".")) (princ(itoa(cdr i))) ); end foreach (princ "\n\n========== End Report =========") (textscr) ); end progn (princ "\nNo command history found ") ); end if (princ) ); end of c:lookcmdlist Type LookCmdList to run. Command: lookcmdlist ====== Command Statistic ====== CIRCLE ...................8 LINE .....................5 ELLIPSE ..................2 SETVAR ...................1 ========== End Report ========= It only one session report with standard commnads only. Do you want to save report in drawing with start/end date/time and user name? Quote
CmdrDuh Posted September 17, 2008 Posted September 17, 2008 That doesn't exist out of the box, but could be written pretty easily. The hard part would be how you intend to benchmark what your doing. If it were me, I would not count commands, but write a program to just record the amount of time it takes you to do X number of commands on a particular drawing. The bad thing is how do you intend to quantify how automation is going to improve things? You almost need the automation in place to come back and time vs the manual version. Quote
feargt Posted September 18, 2008 Author Posted September 18, 2008 Thank you Asmi, that is exactly what I am looking for at the mo. CmdrDuh, Thanks for your constructive comments. Timing how long it takes to do x amount of commands on a drawing is an unrealistic option for me currently. I need to be able to say how many fewer commands can be used to do the same drawing, and I need to be able to put this as a percentage. Obviously it takes different users varying times to complete a drawing and in turn would create a varying percentage. But this would be something in the future to consider regarding a proposal for training. Thanks again Quote
ASMI Posted September 18, 2008 Posted September 18, 2008 I think need to add the total counter: (defun CmdSpy() (vl-load-com) (if(not cmdspy:cmdreactor) (setq cmdspy:cmdreactor (vlr-Command-Reactor nil '((:vlr-CommandEnded . CmdSpyReaction)) ); end vlr-Command-Reactor ); end setq ); end if (princ) ); end of CmdSpy (CmdSpy) (defun CmdSpyReaction(Reac Args / cLst) (if (not (setq cLst(assoc(car Args)cmdspy:list))) (setq cmdspy:list(cons(cons(car Args) 1)cmdspy:list)) (setq cmdspy:list(subst(cons(car Args)(1+(cdr cLst))) cLst cmdspy:list)) ); end if (princ) ); end of CmdSpyReaction (defun c:lookcmdlist(/ cTot) (if cmdspy:list (progn (setq cmdspy:list (vl-sort cmdspy:list '(lambda(a b)(>(cdr a)(cdr b)))) cTot(apply '+(mapcar 'cdr cmdspy:list)) ); end setq (princ "\n====== Command Statistic ======\n") (foreach i cmdspy:list (princ(strcat "\n "(car i)" ")) (repeat(- 26(strlen(car i)))(princ ".")) (princ " ")(princ(itoa(cdr i))) ); end foreach (princ(strcat "\n\n TOTAL: "(itoa cTot))) (princ "\n\n========== End Report =========") (textscr) ); end progn (princ "\nNo command history found ") ); end if (princ) ); end of c:lookcmdlist Command: lookcmdlist ====== Command Statistic ====== INSERT .................... 9 GRIP_STRETCH .............. 4 MOVE ...................... 3 SETVAR .................... 3 LINE ...................... 3 MIRROR .................... 2 CIRCLE .................... 2 COPY ...................... 1 BLOCK ..................... 1 ERASE ..................... 1 +DSETTINGS ................ 1 TOTAL: 30 ========== End Report ========= Quote
feargt Posted September 18, 2008 Author Posted September 18, 2008 Thanks ASMI, Better again, One query though, is it possible to record the following situation. Where no command is active and the user selects several objects and then changes all the layer properties to the same layer in the properties dialogue box. Quote
ASMI Posted September 18, 2008 Posted September 18, 2008 One query though, is it possible to record the following situation. Where no command is active and the user selects several objects and then changes all the layer properties to the same layer in the properties dialogue box. Yes it possible. But it requre much more code, because change properties for ecah object is separate event. This code must to catch of active selection set creation event and group change properties events for all entities in selection set for single event. I havn't time to write it now. May be some other want to have some training in event reactors writting Quote
feargt Posted September 18, 2008 Author Posted September 18, 2008 Thanks again. thanks for answering my query too as I am currently starting to learn the art of lisp programming albeit with severe time constraints, it was something that I wished to know for the future. Quote
kosio_gerasimov Posted January 23, 2010 Posted January 23, 2010 Total respect, ASMI, very good code you have posted. I liked it so much that I spent the last few days improving it and I think I pretty much achieved my goals. Just one remark to make - I dropped the initial idea to count the created, modified and so no objects as well. This turned out to be quiet difficult job because in the drawing database all the time lots of objects are created and modified which have nothing to do with the entities we draw and modify. This is why I decided that such statistics will be misleading and I gave up the idea. In the attached .zip file you will find the Productivity Analysis Tool v1.1 source code (.lsp) and the compiled AutoLISP code (.fas). In order to make it run you need to attach it to the Startup Suite (Tools/Load Application and in the Startup Suite area locate the Contents button). Hope this helps you improve your productivity. If you feel like it, you can give me feedback on the e-mail written in the source file:) Productivity_Analysis_Tool.zip Quote
bobafuka Posted January 26, 2010 Posted January 26, 2010 Kosio, You certainly did improve it.... Very impressive. Can you add a productivity ratio to this, please: total commands divided by minutes? Thanks. Boba Quote
Freerefill Posted January 26, 2010 Posted January 26, 2010 My two cents... I wrote a batch program that was originally used to cycle through layout tabs and plot them. What used to take 5 or 6 commands for each of 50+ tabs now takes one command and 2 or 3 options. Given that, I don't know if "number of commands" divided by "minutes" is a good metric of productivity. Some people work slower, some people work just as hard but more efficiently, some people work much, much faster but are really bad at what they do. You really need to include a measure of output, or all that you have is a means of describing how fast an individual is throwing commands into AutoCAD.. not whether or not those commands are doing anything. The mathematically ideal situation is one command to complete all work. I know this is not likely physically possible, but, it is the ideal case. However, the actual work still needs to be done, physically or autonomously. So, time will still be taken. A "commands/minutes" ratio will give a higher ratio for a completely manual operation, whereas the 99% autonomous one will give a very low ratio. You would have no way of interpreting what those ratios meant without total output. Again, just my two cents. Quote
bobafuka Posted January 26, 2010 Posted January 26, 2010 Your 2 cents worth is actually worth more than that. But there must be a figure to bounce around. Examining a persons work, good or bad does not provide a complete picture. If a comms/min number is available and a piece of work to compare it, the picture is more complete. If you see that a person is doing 25% of commands AND their work is crap, you can pretty much assess there worth. Bosses, don't know about cad. They only know numbers. So I'm not going to tell them what you said as they will be doubtful of the efficacy of my numbers... But thanks. Quote
Freerefill Posted January 26, 2010 Posted January 26, 2010 You're absolutely correct, the complete picture would indeed be a comparison of the number of commands, the time taken, and the quality of the work. The goal being the least number of commands, the least amount of time, and a high quality product. Given that, perhaps you could consider adding another axis to your chart, and grading a few sample jobs on a Poor to Excellent metric. That would give you a much clearer indication of efficiency. I sort of have a knack for thinking way too much about something, to the point where I'm just a blathering idiot wasting everyone's time.. that said, would something like this work? Just imagine that Time and Commands start at the origin at 0, and Quality starts at the origin at Excellent and moves outward to Poor. A high quality, low work job would have all three data points close to the origin, thus, the smaller the triangle, the more efficient the work. Quote
bobafuka Posted January 27, 2010 Posted January 27, 2010 I'm thinking of using more than one piece of work over a prolonged period and the opinions of several people's experience. Unless someone can create a hologram version. I like the thought process. But no. 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.