;;; ;;; AUDITOR.LSP ;;; Autor: Eduard Otto eduaotto@gmx.de ;;; Version: 1.86 ;;; Datum: 17.10.2002 ;;; Getestet unter: AutoCAD 2002 ;;; Änderungen: 16.10.2002 - Wochentagberechnung für "Sitzungsanfang" und "Sitzungsende" korrigiert. ;;; 17.10.2002 - Leerzeichen als Trenner zwischen Wochentag und Datum eingefügt. ;;; - doppelte Definition einer Variablen entfernt. ;;; - Sitzungsabschluss für die aktuelle Datei eingefügt, falls sie ;;; unter anderem Namen abgespeichert wird. ;;; ;;; Ursprüngliche Idee und Codes aus den AutoCAD-Foren von "www.Industrie24.com", ;;; Inspirationen und Erleuchtungen von den Webseiten "www.activex.autolisp.info", ;;; "www.afraLisp.com" und "www.autodesk.com" und dem Studium vieler Programme ;;; von genannten, bekannten und unbekannten Autoren. ;;; Verbesserungen und Kommentare sind willkommen. ;;; ;;; Diese Lisp -besser Arx- Anwendung sollte von Acad automatisch ;;; aufgerufen werden bsp. aus der ACAD2000DOC.LSP. ;;; Falls keine S::STARTUP Funktion in ACAD2000DOC.LSP ;;; vorhanden ist, dann folgenden Eintrag hinzufügen: ;;; ;;; (defun S::STARTUP () ;;; (load "AUDITOR.LSP") ;;; ) ;;; ;;; Falls eine S::STARTUP Funktion vorhanden ist, ;;; dann (load "AUDITOR.LSP") zur Funktion S::STARTUP hinzufügen. ;;; ;;; Beschreibung: ;;; Jede Änderung der Zeichnung wird im Verzeichnis der Zeichnung ;;; in einer ASCII-Datei protokolliert, die den Namen der Zeichnung ;;; mit der Endung ".LOG" erhält. ;;; Beim Schliessen der Zeichnung werden zusätzlich einige Auswertungen ;;; in die gleiche Datei geschrieben. ;;; Neue Zeichnungen, die ungespeichert beendet werden, erhalten keine ".LOG" Datei. ;;; ;;; ;;; Hier die Form wie die Einträge in ".LOG" aussehen. ;;; ___________________________________________________________________________________ ;;; ;;; ;;; Zeichnung ;; geändert am ;; um: ;; von: ; ;;; ;;; (... oder, wenn eine Änderung vorgenommen wurde und die Zeichnung direkt danach ;;; unter neuem Namen abgespeichert wird:) ;;; ;;; Zeichnung ;; wurde als Zeichnung ;; gespeichert am ;; um: ;; von: ; ;;; ___________________________________________________________________________________ ;;; ;;; Datum: ;;; ;;; Zeichnung: ;;; Erstellt am : .. * ;;; Geändert am : .. ;;; Letzter Zugriff : .. ;;; Bearbeitungszeitraum : ( - ) * ;;; Bearbeitungszeit der Zeichnung: Stunden, Minuten ;;; ;;; Sitzungsanfang: / .. ;;; Sitzungsende : / .. ;;; ------ ;;; Sitzungszeit : Std. : Min. : Sek. ;;; Sitzungszeit : Stunden (dezimal) ;;; ;;; Zeichnung wurde mal gespeichert von . ;;; ;;; (oder ... falls nicht gespeichert ...:) ;;; ;;; Zeichnung wurde während dieser Sitzung von nicht geändert. ;;; ;;; * HINWEIS: "Erstellt am" und "Bearbeitungszeitraum" enthalten nur dann ;;; gültige Werte, wenn die Zeichnungsvorlage eine ".DWT Endung hatte! ;;; ___________________________________________________________________________________ ;;; ;;; (vl-load-com) (if (not *AUDITOR_REACTOR_$*) (progn (setq *AUDITOR_REACTOR_$* 'T) (setvar "cmdecho" 0) ;;; ******************************************************************** ;;; ;;; Dieses sind die eigentlichen Reaktorzeilen, die reagieren wenn ;;; u.a. befehle gestartet werden. *** ;;; (if (not *AUDITOR_CHK_MOD_$*) (setq *AUDITOR_CHK_MOD_$* (vlr-dwg-reactor nil '((:vlr-beginSave . AUDITOR_CHK_MOD))) ) ;_ setq ) ;_ if (if (not *AUDITOR_WRITE_LOG_$*) (setq *AUDITOR_WRITE_LOG_$* (vlr-dwg-reactor nil '((:vlr-saveComplete . AUDITOR_WRITE_LOG))) ) ;_ setq ) ;_ if (if (not *AUDITOR_END_LOG_$*) (setq *AUDITOR_END_LOG_$* (vlr-dwg-reactor nil '((:vlr-beginClose . AUDITOR_END_LOG))) ) ;_ setq ) ;_ if ;;; ******************************************************************** ;;; (if (not *plotaCommand_$*) (setq *plotaCommand_$* (vlr-command-reactor nil '((:vlr-commandWillStart . plotaCommand))) ) ;_ setq ) ;_ if ;;(vlr-command-reactor nil '((:vlr-commandWillStart . plotaCommand))) (defun plotaCommand (reactor value / ) (setq value (car value)) (cond ((= value "-PLOT") (setq tab_z (strcat " Zeichnung wurde gedruckt von " (getvar "LOGINNAME") "\n")) ))) (if (not *plotbCommand_$*) (setq *plotbCommand_$* (vlr-command-reactor nil '((:vlr-commandWillStart . plotbCommand))) ) ;_ setq ) ;_ if ;;(vlr-command-reactor nil '((:vlr-commandWillStart . plotbCommand))) (defun plotbCommand (reactor value / ) (setq value (car value)) (cond ((= value "PLOT") (setq tab_z (strcat " Zeichnung wurde gedruckt von " (getvar "LOGINNAME") "\n")) ))) ; ******************************************************************** ;;; (defun AUDITOR_CleanReactors () ; clear the variable (setq *AUDITOR_CHK_MOD_$* nil *AUDITOR_WRITE_LOG_$* nil *AUDITOR_END_LOG_$* nil *AUDITOR_REACTOR_$* nil *plotaCommand_$* nil *plotbCommand_$* nil ) ;_ setq (mapcar 'vlr-remove-all '(:VLR-AcDb-reactor :VLR-Editor-reactor :VLR-Linker-reactor :VLR-Object-reactor :VLR-Command-Reactor :VLR-DeepClone-Reactor :VLR-DocManager-Reactor :VLR-DWG-Reactor :VLR-DXF-Reactor :VLR-Editor-reactor :VLR-Insert-Reactor :VLR-Linker-Reactor :VLR-Lisp-Reactor :VLR-Miscellaneous-Reactor :VLR-Mouse-Reactor :VLR-Object-Reactor :VLR-SysVar-Reactor :VLR-Toolbar-Reactor :VLR-Undo-Reactor :VLR-Wblock-Reactor :VLR-Window-Reactor :VLR-XREF-Reactor ) ) ;_ mapcar ) ;_ defun ;;;====================================================== ;;; ;;; AUDITOR_DayOfYear - Return integer count of days with ;;; 1 = Jan 1 of year since Jan 1. ;;; ;;; MM - integer month ;;; DD - integer day ;;; YY - integer full year ;;; (defun AUDITOR_DayOfYear (MM DD YY / iVal tD) (setq iVal (if (AUDITOR_isLeapYear YY) 62 63 ) ;_ if ) ;_ setq (if (> MM 2) (setq MM (1+ MM) tD (- (fix (* MM 30.6)) iVal) ) ;_ setq (setq MM (1- MM) tD (fix (/ (* MM iVal) 2.0)) ) ;_ setq ) ;_ if (+ DD tD) ) ;_defun ;;;====================================================== ;;; ;;; AUDITOR_isLeapYear - Return T if leap year, nil if not a leap year ;;; ;;; YY - integer full year ;;; (defun AUDITOR_isLeapYear (YY / TT) (setq TT (/ YY 4.0)) (if (equal (- TT (fix TT)) 0.0 0.00001) (progn ;; Divisible by 4, test for 100 year exception (setq TT (/ YY 100.0)) (if (equal (- TT (fix TT)) 0.0 0.00001) (progn ;; Divisible by 100, test for 400 year double exception (setq TT (/ YY 400.0)) (if (equal (- TT (fix TT)) 0.0 0.00001) T ;divisible by 400 is leap year nil ;divisible by 100 is not leap year ) ;_ if ) ;_ progn T ;divisible by 4 but not 100, is leap year ) ;_ if ) ;_ progn nil ) ;not divisible by 4, not a leap year ) ;_defun ;;;====================================================== ;;; ;;; AUDITOR_AstroCalendar - return string date given Julian date ;;; JD - real Julian date ;;; ;;; Returns string of form "DD.MM.YYYY" ;;; (defun AUDITOR_AstroCalendar (JD / II F A B C D E G TT DD MM YY) (setq II (fix (+ JD 0.5)) F (- JD II) ) ;_ setq (if (> II 2299160.0) (setq A (fix (/ (- II 1867216.25) 35624.25)) B (+ II 1 A (fix (/ A -4.0))) ) ;_ setq (setq B II) ) ;_ if (setq C (+ B 1524.0) D (fix (/ (- C 122.1) 365.25)) E (fix (* D 365.25)) G (fix (/ (- C E) 30.6001)) TT (+ C (- E) F (fix (* G -30.6001))) DD (fix (+ TT 0.5)) ) ;_ setq (if (< G 13.5) (setq MM (1- (fix G))) (setq MM (- (fix G) 13)) ) ;_ if (if (> MM 2) (setq YY (- (fix D) 4716)) (setq YY (- (fix D) 4715)) ) ;_ if (setq DD (itoa DD)) (setq MM (itoa MM)) (setq YY (itoa YY)) (if (= (strlen DD) 1) (setq DD (strcat "0" DD)) ) ;_ if (if (= (strlen MM) 1) (setq MM (strcat "0" MM)) ) ;_ if (strcat DD "." MM "." YY) ) ;_defun ;;;====================================================== ;;; ;;; AUDITOR_AcadCalendar - same as AstroCalendar but uses ;;; offset AutoCAD Julian Date ;;; (defun AUDITOR_AcadCalendar (aJD) (setq aJD (- (fix aJD) 0.5)) (AUDITOR_AstroCalendar aJD) ) ;_defun ;;;====================================================== ;;; ;;; AUDITOR_AstroJulianDate - given date, calculate Julian Date ;;; MM - integer Month number ;;; DD - integer Day number ;;; YY - integer Year number (complete year as in 2002) ;;; ;;; Returns real number. ;;; (defun AUDITOR_AstroJulianDate (MM DD YY / A B C D) (setq B 1) (if (<= YY 1582) (progn ;test for date <10/15/1582 (if (< YY 1582) (setq B 0) (if (< MM 10) (setq B 0) (if (< DD 15) (setq B 0) ) ;_ if ) ;_ if ) ;_ if ) ;_ progn ) ;_ if ;; (if (or (= MM 1) (= MM 2)) (setq YY (1- YY) MM (+ MM 12) ) ;_ setq ) ;_ if (if (= B 1) ;Correction for date > 10/15/1582 (setq A (fix (/ YY 100.0)) B (+ (- 2.0 A) (fix (/ A 4.0))) ) ;_ setq ) ;_ if (if (< YY 0) (setq C (fix (- (* YY 365.25) 0.75))) (setq C (fix (* YY 365.25))) ) ;_ if (setq D (fix (* 30.6001 (+ MM 1)))) (+ B C D DD 1720994.5) ) ;_defun ;;;====================================================== ;;; ;;; AUDITOR_DayOfWeek - Determine day of week, return string ;;; ;;; MM - integer month ;;; DD - integer day ;;; YY - integer full year ;;; (defun AUDITOR_DayOfWeek (MM DD YY / T1) (if (not (AUDITOR_isint MM)) (setq MM (atoi MM)) ) (if (not (AUDITOR_isint DD)) (setq DD (atoi DD)) ) (if (not (AUDITOR_isint YY)) (setq YY (atoi YY)) ) (setq T1 (/ (+ (AUDITOR_AstroJulianDate MM DD YY) 1.5) 7.0) T1 (fix (+ 0.4 (* 7.0 (- T1 (fix T1))))) ) ;_ setq (nth T1 '("Sonntag " "Montag " "Dienstag " "Mittwoch " "Donnerstag" "Freitag " "Samstag " ) ) ;_ nth ) ;_ defun ;;;====================================================== ;;; ;; from BIRARR.lsp - Version 2.04 by Roger ROSEC (defun AUDITOR_BiF_FileName (/ Name) (setq Name (getvar "DWGNAME")) (if (wcmatch Name "?:*,*`\*") (setq Name (substr Name (+ 1 (strlen (getvar "DWGPREFIX"))))) ) ;_ if (if (wcmatch Name "*`.[dD][wW][gG]") (setq Name (substr Name 1 (- (strlen Name) 4))) ) ;_ if Name ) ;_ defun ;;;------------------------------------------------------ ;;; (defun AUDITOR_EditingTime (/ total_time hours minutes rest result) (setq total_time (* 24 (getvar "TDINDWG"))) (setq hours (fix total_time)) (setq rest (- total_time hours)) (setq minutes (fix (* rest 60))) (setq result (strcat " Bearbeitungszeit der Zeichnung: " (itoa hours) (if (= hours 1) " Stunde, " " Stunden, " ) ;_ if (itoa minutes) (if (= minutes 1) " Minute" " Minuten" ) ;_ if ) ;_ strcat ) ;_ setq result ) ;_ defun ;;;------------------------------------------------------ ;;; (defun AUDITOR_GetDay () ;aktueller Tag (substr (rtos (getvar "CDATE") 2 9) 7 2) ) ;_ defun ;; (defun AUDITOR_GetMonth () ;aktueller Monat (substr (rtos (getvar "CDATE") 2 9) 5 2) ) ;_ defun ;; (defun AUDITOR_GetYear () ;aktuelles Jahr (substr (rtos (getvar "CDATE") 2 9) 1 4) ) ;_ defun ;;;------------------------------------------------------ ;;; (defun AUDITOR_GetDayOfWeekDateTime (td / d dow datestr h1 j m m1 s1 time1 y) (setq time1 (* 86400.0 (- td (setq j (fix td))))) (setq h1 (/ time1 3600.0)) (setq m1 (* (- h1 (fix h1)) 60)) (setq s1 (* (- m1 (fix m1)) 60)) (setq h1 (itoa (fix h1))) (setq m1 (itoa (fix m1))) (setq s1 (itoa (fix s1))) (if (= (strlen h1) 1) (setq h1 (strcat "0" h1)) ) ;_ if (if (= (strlen m1) 1) (setq m1 (strcat "0" m1)) ) ;_ if (if (= (strlen s1) 1) (setq s1 (strcat "0" s1)) ) ;_ if (setq time1 (strcat h1 ; Stunden ":" m1 ; Minuten ":" s1 ; Sekunden ) ;_ strcat ) ;_ setq (setq j (- j 1721119.0)) (setq y (fix (/ (1- (* 4 j)) 146097.0))) (setq j (- (* j 4.0) 1.0 (* 146097.0 y))) (setq d (fix (/ j 4.0))) (setq j (fix (/ (+ (* 4.0 d) 3.0) 1461.0))) (setq d (- (+ (* 4.0 d) 3.0) (* 1461.0 j))) (setq d (fix (/ (+ d 4.0) 4.0))) (setq m (fix (/ (- (* 5.0 d) 3) 153.0))) (setq d (- (* 5.0 d) 3.0 (* 153.0 m))) (setq d (fix (/ (+ d 5.0) 5.0))) (setq y (+ (* 100.0 y) j)) (if (< m 10.0) (setq m (+ m 3)) (progn (setq m (- m 9)) (setq y (1+ y)) ) ;_ progn ) ;_ if (setq dow (AUDITOR_DayOfWeek m d (fix y))) ; Wochentag (setq d (itoa (fix d))) (setq m (itoa (fix m))) (setq y (itoa (fix y))) (if (= (strlen d) 1) (setq d (strcat "0" d)) ) ;_ if (if (= (strlen m) 1) (setq m (strcat "0" m)) ) ;_ if (setq datestr (strcat dow ; Wochentag " " d ; Tag "." m ; Monat "." y ; Jahr " " time1 ; Uhrzeit ) ;_ strcat ) ;_ setq datestr ) ;_ defun ;;;------------------------------------------------------ ;;; (defun AUDITOR_GetHoursMinutesSeconds (timein / hours minutes rest result seconds) (setq hours (fix timein)) (setq rest (- timein hours)) (setq minutes (* rest 60)) (setq rest (- minutes (fix minutes))) (setq seconds (* rest 60)) (setq hours (itoa hours)) (setq minutes (itoa (fix minutes))) (setq seconds (itoa (fix seconds))) (if (= (strlen hours) 1) (setq hours (strcat "0" hours)) ) ;_ if (if (= (strlen minutes) 1) (setq minutes (strcat "0" minutes)) ) ;_ if (if (= (strlen seconds) 1) (setq seconds (strcat "0" seconds)) ) ;_ if (setq result (strcat hours ":" minutes ":" seconds)) result ) ;_ defun ;;;------------------------------------------------------ ;;; (defun AUDITOR_GetTime (/ CD) (setq CD (rtos (getvar "CDATE") 2 12)) (strcat (substr CD 10 2) ;aktuelle Stunden ":" (substr CD 12 2) ;aktuelle Minuten ":" (substr CD 14 2) ;aktuelle Sekunden ) ;_ strcat ) ;_ defun ;;;------------------------------------------------------ ;;; (defun AUDITOR_isint (a) (if (= (type a) 'INT) ; is TYPE integer? T ; yes, return T nil ; no, return nil ) ) ;_ defun ;;;------------------------------------------------------ ;;; (defun AUDITOR_NumberOfDays (std stm sty upd upm upy / c d d1 y) (if (not (AUDITOR_isint std)) (setq std (atoi std)) ) (if (not (AUDITOR_isint stm)) (setq stm (atoi stm)) ) (if (not (AUDITOR_isint sty)) (setq sty (atoi sty)) ) (if (not (AUDITOR_isint upd)) (setq upd (atoi upd)) ) (if (not (AUDITOR_isint upm)) (setq upm (atoi upm)) ) (if (not (AUDITOR_isint upy)) (setq upy (atoi upy)) ) (setq d1 1) (setq c sty) (while (<= c upy) (if (= c sty) (progn (setq d (AUDITOR_DayOfYear stm std sty)) (setq y (if (AUDITOR_isLeapYear c) 366 365 ) ;_ if ) ;_ setq (setq d (- y d)) ) ;_ progn ) ;_ if (if (= c upy) (setq d (AUDITOR_DayOfYear upm upd upy)) ) ;_ if (if (and (/= c sty) (/= c upy)) (progn (setq d (if (AUDITOR_isLeapYear c) 366 365 ) ;_ if ) ;_ setq ) ;_ progn ) ;_ if (if (and (= c sty) (= c upy)) (progn (setq d (- (AUDITOR_DayOfYear upm upd upy) (AUDITOR_DayOfYear stm std sty) ) ;_ - ) ;_ setq ) ;_ progn ) ;_ if (setq d1 (+ d1 d)) (setq c (1+ c)) ) ;_ while (if (= d1 1) (strcat (itoa d1) " Tag " "(" (AUDITOR_AcadCalendar (getvar "TDCREATE")) ") *" ) ;_ strcat (strcat (itoa d1) " Tage " "(" (AUDITOR_AcadCalendar (getvar "TDCREATE")) " - " (AUDITOR_AcadCalendar (getvar "TDUPDATE")) ") *" ) ;_ strcat ) ;_ if ) ;_ defun ;;;------------------------------------------------------ ;;; (defun AUDITOR_Replace (f_oldstr f_newstr f_string / f_cur f_loop) ;like subst but with strings not lists (if (null (and (AUDITOR_stringp f_oldstr) (AUDITOR_stringp f_newstr) (AUDITOR_stringp f_string) ) ;_ and ) ;_ null (exit) ) ;_ if (if (> (strlen f_oldstr) (strlen f_string)) (exit) ) ;_ if (setq f_loop 1) (repeat (strlen f_string) (progn (setq f_cur (substr f_string f_loop (strlen f_oldstr))) (if (= f_cur f_oldstr) (setq f_string (strcat (substr f_string 1 (- f_loop 1)) f_newstr (substr f_string (+ f_loop (strlen f_oldstr)) (strlen f_string) ) ;_ substr ) ;_ strcat ) ;_ setq ) ;_ if (setq f_loop (1+ f_loop)) ) ;_ progn ) ;_ repeat f_string ) ;_ defun ;;;------------------------------------------------------ ;;; (defun AUDITOR_stringp (f_val) ;test if a string (if (= (type f_val) 'STR) t nil ) ;_ if ) ;_ defun ;;;------------------------------------------------------ ;;; (defun AUDITOR_file_genesis () (setq creation_date (AUDITOR_AcadCalendar (getvar "TDCREATE")) creation_day (substr creation_date 1 2) creation_month (substr creation_date 4 2) creation_year (substr creation_date 7 4) update_day (substr (AUDITOR_GetDayOfWeekDateTime (getvar "TDUPDATE")) 13 2 ) ;_ substr update_month (substr (AUDITOR_GetDayOfWeekDateTime (getvar "TDUPDATE")) 16 2 ) ;_ substr update_year (substr (AUDITOR_GetDayOfWeekDateTime (getvar "TDUPDATE")) 19 4 ) ;_ substr ) ;_ setq ) ;;;====================================================== ;;; >> MAIN PROGRAM << ;;;====================================================== (setq AUDITOR_DWGSTART (getvar "DATE") AUDITOR_md_kontroll nil AUDITOR_sav nil AUDITOR_savcnt 0 AUDITOR_start (AUDITOR_GetTime) AUDITOR_SESSION_START (strcat (AUDITOR_DayOfWeek (AUDITOR_GetMonth) (AUDITOR_GetDay) (AUDITOR_GetYear) ) ;_ AUDITOR_DayOfWeek " " (AUDITOR_GetDay) "." (AUDITOR_GetMonth) "." (AUDITOR_GetYear) ) ;_ strcat ) ;_ setq ;;;------------------------------------------------------- ;;; (defun AUDITOR_SAVE_COUNT (reactor callbackData) (setq AUDITOR_sav "T") (setq AUDITOR_savcnt (+ AUDITOR_savcnt 1)) (princ (strcat "\n... Zeichnung geändert ... " (rtos AUDITOR_savcnt 2 0) " mal gespeichert." ) ;_ strcat ) ;_ princ (princ) ) ;_ defun ;;;------------------------------------------------------- ;;; (defun AUDITOR_END_LOG (reactor callbackData) (if (and (= (getvar "DWGTITLED") 1) (/= (substr (getvar "DWGNAME") (- (strlen (getvar "DWGNAME")) 2) 4 ) ;_ substr "sv$" ) ;_ /= ) ;_ and (progn (AUDITOR_file_genesis) (setq timein (/ (* (- (getvar "DATE") AUDITOR_DWGSTART) 1440.0) 60.0) ) ;_ setq (setq AUDITOR_timefile (open (strcat (getvar "DWGPREFIX") (AUDITOR_BiF_FileName) ".LOG") "a" ) ;_ open ) ;_ setq (write-line "" AUDITOR_timefile) (write-line "......................................................................................" AUDITOR_timefile ) ;_ write-line (write-line "" AUDITOR_timefile) (write-line (strcat " Datum: " (AUDITOR_GetDay) "." (AUDITOR_GetMonth) "." (AUDITOR_GetYear) ) ;_ strcat AUDITOR_timefile ) ;_ write-line (write-line "" AUDITOR_timefile) (write-line (strcat " Zeichnung: " (getvar "DWGPREFIX") (getvar "DWGNAME") ) ;_ strcat AUDITOR_timefile ) ;_ write-line (write-line (strcat " Erstellt am : " (AUDITOR_GetDayOfWeekDateTime (getvar "TDCREATE")) " *" ) ;_ strcat AUDITOR_timefile ) ;_ write-line (write-line (strcat " Geändert am : " (AUDITOR_GetDayOfWeekDateTime (getvar "TDUPDATE")) ) ;_ strcat AUDITOR_timefile ) ;_ write-line (write-line (strcat " Letzter Zugriff : " (AUDITOR_GetDayOfWeekDateTime (getvar "DATE")) ) ;_ strcat AUDITOR_timefile ) ;_ write-line (write-line (strcat " Bearbeitungszeitraum : " (AUDITOR_NumberOfDays creation_day creation_month creation_year update_day update_month update_year ) ;_ AUDITOR_NumberOfDays ) ;_ strcat AUDITOR_timefile ) ;_ write-line (write-line (AUDITOR_EditingTime) AUDITOR_timefile ) ;_ write-line (write-line "" AUDITOR_timefile) (write-line (strcat " Sitzungsanfang: " AUDITOR_start " / " AUDITOR_SESSION_START ) ;_ strcat AUDITOR_timefile ) ;_ write-line (write-line (strcat " Sitzungsende : " (AUDITOR_GetTime) " / " (AUDITOR_DayOfWeek (AUDITOR_GetMonth) (AUDITOR_GetDay) (AUDITOR_GetYear) ) ;_ DayOfWeek " " (AUDITOR_GetDay) "." (AUDITOR_GetMonth) "." (AUDITOR_GetYear) ) ;_ strcat AUDITOR_timefile ) ;_ write-line (write-line " --------" AUDITOR_timefile) (write-line (strcat " Sitzungszeit : " (AUDITOR_GetHoursMinutesSeconds timein) " Std. : Min. : Sek." ) ;_ strcat AUDITOR_timefile ) ;_ write-line (write-line (strcat " Sitzungszeit : " (setq timein (AUDITOR_Replace "." "," (rtos timein 2 2))) "\t" (if (= timein "1") " Stunde (dezimal)" " Stunden (dezimal)" ) ;_ if ) ;_ strcat AUDITOR_timefile ) ;_ write-line (write-line "" AUDITOR_timefile) (if AUDITOR_sav (write-line (strcat " Zeichnung wurde " (rtos AUDITOR_savcnt 2 0) " mal gespeichert von " (getvar "LOGINNAME") ) ;_ strcat AUDITOR_timefile ) ;_ write-line (write-line (strcat " Zeichnung wurde während dieser" " Sitzung von " (getvar "LOGINNAME") " nicht geändert." ) ;_ strcat AUDITOR_timefile ) ;_ write-line ) ;_ if ;; (if tab_z (write-line tab_z AUDITOR_timefile) ) ;; (write-line "" AUDITOR_timefile) (write-line " * HINWEIS: \"\Erstellt am\"\ und \"\Bearbeitungszeitraum\"\ enthalten nur dann" AUDITOR_timefile ) ;_ write-line (write-line " gültige Werte, wenn die Zeichnungsvorlage eine .DWT Datei war!" AUDITOR_timefile ) ;_ write-line (write-line "///////////////////////////////////////////////////////////////////////////////////////////////////" AUDITOR_timefile ) ;_ write-line (close AUDITOR_timefile) (AUDITOR_CleanReactors) ) ;_ progn ) ;_ if ) ;_ defun AUDITOR_END_LOG ;;;------------------------------------------------------- ;;; (defun AUDITOR_CHK_MOD (reactor callbackData) (setvar "cmdecho" 0) (setq AUDITOR_DB_MOD (getvar "DBMOD") AUDITOR_altname (strcat (getvar "DWGPREFIX") (getvar "DWGNAME")) AUDITOR_modepfad (strcat (getvar "DWGPREFIX") (AUDITOR_BiF_FileName) ".LOG") ) ;_ setq (if (not (or (= (logand AUDITOR_DB_MOD 1) 1) (= (logand AUDITOR_DB_MOD 2) 2) (= (logand AUDITOR_DB_MOD 4) 4) ) ;_ or ) ;_ not (progn (setq AUDITOR_DB_MOD nil) (princ "\n... keine Änderung in der Zeichnung ... ") ) ;_ progn (progn (setq AUDITOR_DB_MOD T) (setq AUDITOR_md_kontroll nil) (AUDITOR_SAVE_COUNT reactor callbackData) ) ;_ progn ) ;_ if ) ;_ defun AUDITOR_CHK_MOD ;;;------------------------------------------------------- ;;; (defun AUDITOR_WRITE_LOG (reactor callbackData) (if (and AUDITOR_DB_MOD (= AUDITOR_md_kontroll nil)) (progn (setq AUDITOR_anwender (getvar "LOGINNAME") AUDITOR_zeichnungsname (cadr callbackData) AUDITOR_date_str (rtos (getvar "CDATE") 2 9) AUDITOR_year (substr AUDITOR_date_str 1 4) AUDITOR_month (substr AUDITOR_date_str 5 2) AUDITOR_day (substr AUDITOR_date_str 7 2) AUDITOR_date (strcat AUDITOR_day "." AUDITOR_month "." AUDITOR_year) AUDITOR_hour (substr AUDITOR_date_str 10 2) AUDITOR_minu (substr AUDITOR_date_str 12 2) AUDITOR_zeit (strcat AUDITOR_hour ":" AUDITOR_minu) ) ;_ setq (if (/= (substr AUDITOR_zeichnungsname (- (strlen AUDITOR_zeichnungsname) 2) 4) "sv$" ) ;_ /= (progn (if (/= AUDITOR_altname AUDITOR_zeichnungsname) (setq AUDITOR_modetxt (strcat " Zeichnung " ";" AUDITOR_altname ";" " wurde als Zeichnung " ";" AUDITOR_zeichnungsname ";" " gespeichert am " ";" AUDITOR_date ";" " um: " ";" AUDITOR_zeit ";" " von: " ";" AUDITOR_anwender ) ;_ strcat AUDITOR_modepfad_new (strcat (substr AUDITOR_zeichnungsname 1 (- (strlen AUDITOR_zeichnungsname) 4) ) ;_ substr ".LOG" ) ;_ strcat ) ;_ setq (setq AUDITOR_modetxt (strcat " Zeichnung " ";" AUDITOR_zeichnungsname ";" " geändert am " ";" AUDITOR_date ";" " um: " ";" AUDITOR_zeit ";" " von: " ";" AUDITOR_anwender ) ;_ strcat ) ;_ setq ) ;_ if ;; falls Datei geändert u. unter neuem Namen gespeichert, dann ;; erzeuge für diee Ursprungsdatei einen Sitzungsabschluss. (if AUDITOR_modepfad_new (progn (AUDITOR_file_genesis) (setq timein (/ (* (- (getvar "DATE") AUDITOR_DWGSTART) 1440.0) 60.0) ) ;_ setq (setq AUDITOR_timefile (open AUDITOR_modepfad "a")) ;;------------------------------------------------- (write-line "+++++++++++++++++++++++++++++++++" AUDITOR_timefile ) ;_ write-line (write-line "" AUDITOR_timefile) (write-line (strcat " Datum: " AUDITOR_date) AUDITOR_timefile) (write-line "" AUDITOR_timefile) (write-line (strcat " Zeichnung: " AUDITOR_altname ) ;_ strcat AUDITOR_timefile ) ;_ write-line (write-line (strcat " Erstellt am : " (AUDITOR_GetDayOfWeekDateTime (getvar "TDCREATE")) " *" ) ;_ strcat AUDITOR_timefile ) ;_ write-line (write-line (strcat " Geändert am : " (AUDITOR_GetDayOfWeekDateTime (getvar "TDUPDATE")) ) ;_ strcat AUDITOR_timefile ) ;_ write-line (write-line (strcat " Letzter Zugriff : " (AUDITOR_GetDayOfWeekDateTime (getvar "DATE")) ) ;_ strcat AUDITOR_timefile ) ;_ write-line (write-line (strcat " Bearbeitungszeitraum : " (AUDITOR_NumberOfDays creation_day creation_month creation_year update_day update_month update_year ) ;_ AUDITOR_NumberOfDays ) ;_ strcat AUDITOR_timefile ) ;_ write-line (write-line (AUDITOR_EditingTime) AUDITOR_timefile ) ;_ write-line (write-line "" AUDITOR_timefile) (write-line (strcat " Sitzungsanfang: " AUDITOR_start " / " AUDITOR_SESSION_START ) ;_ strcat AUDITOR_timefile ) ;_ write-line (write-line (strcat " Sitzungsende : " (AUDITOR_GetTime) " / " (AUDITOR_DayOfWeek (AUDITOR_GetMonth) (AUDITOR_GetDay) (AUDITOR_GetYear) ) ;_ DayOfWeek " " (AUDITOR_GetDay) "." (AUDITOR_GetMonth) "." (AUDITOR_GetYear) ) ;_ strcat AUDITOR_timefile ) ;_ write-line (write-line " --------" AUDITOR_timefile) (write-line (strcat " Sitzungszeit : " (AUDITOR_GetHoursMinutesSeconds timein) " Std. : Min. : Sek." ) ;_ strcat AUDITOR_timefile ) ;_ write-line (write-line (strcat " Sitzungszeit : " (setq timein (AUDITOR_Replace "." "," (rtos timein 2 2))) "\t" (if (= timein "1") " Stunde (dezimal)" " Stunden (dezimal)" ) ;_ if ) ;_ strcat AUDITOR_timefile ) ;_ write-line (write-line "" AUDITOR_timefile) (if AUDITOR_sav (write-line (strcat " Zeichnung wurde " (rtos AUDITOR_savcnt 2 0) " mal gespeichert von " (getvar "LOGINNAME") ) ;_ strcat AUDITOR_timefile ) ;_ write-line (write-line (strcat " Zeichnung wurde während dieser" " Sitzung von " (getvar "LOGINNAME") " nicht geändert." ) ;_ strcat AUDITOR_timefile ) ;_ write-line ) ;_ if ;; (write-line "" AUDITOR_timefile) (write-line " * HINWEIS: \"\Erstellt am\"\ und \"\Bearbeitungszeitraum\"\ enthalten nur dann" AUDITOR_timefile ) ;_ write-line (write-line " gültige Werte, wenn die Zeichnungsvorlage eine .DWT Datei war!" AUDITOR_timefile ) ;_ write-line (write-line "*********************************************" AUDITOR_timefile ) ;_ write-line ;;----------------------------- (write-line "" AUDITOR_timefile) (close AUDITOR_timefile) ;;--------------------------------------------- (setq AUDITOR_timefile (open AUDITOR_modepfad_new "a")) (write-line "" AUDITOR_timefile) (write-line AUDITOR_modetxt AUDITOR_timefile) (close AUDITOR_timefile) (setq AUDITOR_modepfad_new nil) ) ;_ progn ) ;_ if (setq AUDITOR_timefile (open AUDITOR_modepfad "a")) ;;(write-line "" AUDITOR_timefile) (write-line AUDITOR_modetxt AUDITOR_timefile) (close AUDITOR_timefile) ) ;_ progn ) ;_ if (setq AUDITOR_md_kontroll 1) ) ;_ progn ) ;_ if ) ;_ defun AUDITOR_WRITE_LOG ;;;------------------------------------------------------- ;;; ) ;_ progn (princ "\n... Programm ist schon geladen.") ) ;_ if