;;;SHOW_LOG Shows Drawing log (EED) PRINTLOG to print. (uses LOG_IT to make log) ;;; ;;;> Author: Henry C. Francis ;;;> 425 N. Ashe St. ;;;> Southern Pines, NC 28387 ;;;> http://paracadd.com ;;;> All rights reserved. ;;; ;;;> COPYRIGHT: 1/2007 ;;;> EDITED: 08-30-2006 ;;; (defun c:show_log (/) (setq rapnm "HUA") (regapp rapnm) (setq edss (ssget "x" (list '(-3 ("HUA")) (cons 2 "DWG-EDIT-LOG")))) (if edss (progn (setq ename (ssname edss 0)) (setq xelst (entget ename (list rapnm))) (setq xedlst (cdr(reverse(cddr(assoc rapnm(cdr(assoc -3 xelst))))))) (foreach n xedlst (progn (cond ((eq(substr(cdr n)1 1)"O") (setq actstr "\nOpened By: ")) ((eq(substr(cdr n)1 1)"P") (setq actstr "\nPrinted By: ")) ((eq(substr(cdr n)1 1)"J") (setq actstr "\nPlotted By: ")) ((eq(substr(cdr n)1 1)"C") (setq actstr "\nClosed By: ")) ) (prompt (strcat actstr(substr(cdr n)13 3)" as: "(substr(cdr n)16)" on: "(substr(cdr n)4 2)"-" (substr(cdr n)6 2)"-"(substr(cdr n)2 2)" at: "(substr(cdr n)9 2)":"(substr(cdr n)11 2) ) ) ) ) );progn (princ "\nDrawing Edit Log is not available. ") );if (princ) ) (defun c:printlog (/) (setq rapnm "HUA") (regapp rapnm) (if (=(substr (setq curdwg (getvar"dwgname")) 2 1)":") (progn (setq cdstrl (strlen curdwg)) (while (not(=(substr curdwg (1- cdstrl) 1)"\\")) (setq cdstrl (1- cdstrl)) ) (setq curdwg (strcase(substr curdwg cdstrl))) );progn );if (setq lf1 (open "lpt1" "w")) (if (setq edss (ssget "x" (list '(-3 ("HUA")) (cons 2 "DWG-EDIT-LOG")(cons 10 (list 0.0 0.0 0.0))))) (progn (write-line (getvar"dwgname") lf1) (setq ename (ssname edss 0)) (setq xelst (entget ename (list rapnm))) (setq xedlst (cdr(reverse(cddr(assoc rapnm(cdr(assoc -3 xelst))))))) (foreach n xedlst (progn (cond ((eq(substr(cdr n)1 1)"O") (setq actstr "Opened By: ")) ((eq(substr(cdr n)1 1)"P") (setq actstr "Printed By: ")) ((eq(substr(cdr n)1 1)"J") (setq actstr "Plotted By: ")) ((eq(substr(cdr n)1 1)"C") (setq actstr "Closed By: ")) ) (write-line (strcat actstr(substr(cdr n)13 3)" as: "(substr(cdr n)16)" on: "(substr(cdr n)4 2)"-" (substr(cdr n)6 2)"-"(substr(cdr n)2 2)" at: "(substr(cdr n)9 2)":"(substr(cdr n)11 2) ) lf1) ) ) );progn (write-line "Log is not available. " lf1) );if (if lf1 (close lf1)) (princ) ) (defun c:writelog (/) (setq rapnm "HUA") (regapp rapnm) (if (=(substr (setq curdwg (getvar"dwgname")) 2 1)":") (progn (setq cdstrl (strlen curdwg)) (while (not(=(substr curdwg (1- cdstrl) 1)"\\")) (setq cdstrl (1- cdstrl)) ) (setq curdwg (strcase(substr curdwg cdstrl))) );progn );if (setq lf1 (open(strcat curdwg ".log") "w")) (if (setq edss (ssget "x" (list '(-3 ("HUA")) (cons 2 "DWG-EDIT-LOG")(cons 10 (list 0.0 0.0 0.0))))) (progn (write-line (getvar"dwgname") lf1) (setq ename (ssname edss 0)) (setq xelst (entget ename (list rapnm))) (setq xedlst (cdr(reverse(cddr(assoc rapnm(cdr(assoc -3 xelst))))))) (foreach n xedlst (progn (cond ((eq(substr(cdr n)1 1)"O") (setq actstr "\nOpened By: ")) ((eq(substr(cdr n)1 1)"P") (setq actstr "\nPrinted By: ")) ((eq(substr(cdr n)1 1)"J") (setq actstr "\nPlotted By: ")) ((eq(substr(cdr n)1 1)"C") (setq actstr "\nClosed By: ")) ) (write-line (strcat actstr(substr(cdr n)13 3)" as: "(substr(cdr n)16)" on: "(substr(cdr n)4 2)"-" (substr(cdr n)6 2)"-"(substr(cdr n)2 2)" at: "(substr(cdr n)9 2)":"(substr(cdr n)11 2) ) lf1) ) ) );progn (write-line "Log is not available. " lf1) );if (if lf1 (close lf1)) (princ) ) (princ)