;;; Writes a log file in the same directory as ;;; the dwg with the same name. Add as many commands ;;; as you want to trace. ;;; Add (load "Write_Log.lsp") to your acad.doc file ;;; and put lisp in a acad supported directory ;;; Lisp must load every drawing ;;; Use (startapp "notepad" (findfile "acad.lsp")) at ;;; the command line to find it. ;;; Use OPENLOG to view current dwg log ;;; Written by Jason Rhymes www.acadianagraphics.com ;;; Revised / Jan 8 2010 / v1.0 (vl-load-com) (or cmdreactor (setq cmdreactor (vlr-command-reactor nil '((:vlr-commandwillstart . cmdstart) ) ) ;_ end of vlr-command-reactor ) ;_ end of setq ) ;_ end of or (defun cmdstart (react cmd /) (setq cmd (strcase (car cmd) t)) (cond ;;; Copy the following to and edit track more commands ;;;================;;;Here ((wcmatch cmd "*explode*") (setq cmdname (strcat "Objects were exploded")) (writelog) ) ;;;================;;;to Here ((wcmatch cmd "*qsave*") (setq cmdname (strcat "Drawing was saved")) (writelog) ) ((wcmatch cmd "*layer*") (setq cmdname (strcat "Layers were modified")) (writelog) ) ((wcmatch cmd "*erase*") (setq cmdname (strcat "Objects were erased")) (writelog) ) ((wcmatch cmd "*close*") (setq cmdname (strcat "Drawing was closed")) (writelog) ) ) ) ;_ end of defun (defun writelog (/) (if (null cmdname) (setq cmdname (strcat "Drawing was opened")) ) (setq dpath (getvar "dwgprefix")) (setq name (getvar "dwgname")) (setq dname (substr name 1 (- (strlen name) 4))) (setq str (strcat dname ": " cmdname " by " (getvar "loginname") " on " (menucmd "M=$(edtime,$(getvar,date),MO\"-\"DD\"-\"YY H:MMam/pm)" ) ) ) (setq logfile (strcat dpath dname ".log")) (setq opfile (open logfile "a")) (write-line (strcat str) opfile) (close opfile) writelog ) (defun c:openlog (/) (startapp "notepad" logfile) )