Another nice code I use to keep track of users actions is a code that logs through the Drawing Properties. If you take the attached code and place it in your ACADDOC.lsp you will start to get a running log of who opened the drawing and what time and date it was opened at. This little code is quicker to access than my previous code that's stored in a CSV excel file. This method we use daily to find out simply who the last user was on projects all the time. I got pieces of this code from the Autodesk News group and fellow Blogger Lee.
(defun-q s::STARTUP (/ acadObj acDoc acDocSumInfo customFieldName
fieldValue errHandler doc db si author initial Jobnumber word-to-strip-out S-letter-position full-word line2write file)
(vl-load-com)
(setq acadObj (vlax-get-acad-object))
(setq acDoc (vlax-get-property acadObj 'ActiveDocument))
(setq acDocSumInfo (vlax-get-property acDoc 'SummaryInfo))
(setq customFieldName (menucmd "M=$(edtime,$(getvar,date),D MON YY - HH:MM:SS)"))
(setq fieldValue "")
(setq errHandler (vl-catch-all-apply 'vlax-invoke-method (list
acDocSumInfo 'GetCustomByKey customFieldName 'fieldValue)))
;;Test error
;;(vl-catch-all-error-message errHandler)
(if (/= errHandler nil)
(progn
(setq fieldValue (getvar "loginname"))
(prompt "\nField doesn't exist... creating entry")
(if (or (/= fieldValue "")(/= fieldValue nil))
(vlax-invoke-method acDocSumInfo 'AddCustomInfo customFieldName
fieldValue)
)
)
(progn
(setq fieldValue (getstring T "\nEnter value: "))
(prompt "\nUpdate extry")
(if (or (/= fieldValue "")(/= fieldValue nil))
(vlax-invoke-method acDocSumInfo 'SetCustomByKey customFieldName
fieldValue)
)
)
)
(prompt "\nAuthor Field has been Created")
(PRINC))
Click here to Download the Lisp file:Download drawing_props.LSP



Hi Mark,
Regarding your tip on Drawing Log Part 2, I tried your code in AutoCAD 2002. Got this error message
AutoCAD menu utilities loaded.; error: ActiveX Server returned the error:
unknown name: SUMMARYINFO
Posted by: Roel | December 02, 2005 at 06:49 AM
Hi Mark,
Your Drawing Log Part 2 lisp is very good, my problem is we have drawings on two different drives lets say they are x: and y: drives. Our drafters have Autocad installed as a stand alone and their ACADDOC.lsp is on their own c: drive. How do i create log from each drafter that opens a drawing from either x: or y: drives?
Thanks in Advnce.
Posted by: Mitch | March 09, 2006 at 07:36 AM