(DEFUN c:fixwhodunit (/ this_scr this_uppath this_layout tblkfillin cnt this_fillin) (IF ukword nil (LOAD "UKWORD" "\nFile UKWORD.LSP not loaded! ") ) ;_ end of IF (SETQ fixemall (ukword 1 "Yes No" "This will reset the designed by, drawn by, and checked by entries to the single value you enter for each one for every occurrence in this drawing. Do you want to continue?[Yes/No]" "Yes" ) ;_ end of ukword ) ;_ end of SETQ (IF (EQ fixemall "Yes") (PROGN (IF (NOT (WCMATCH (GETVAR "TRUSTEDPATHS") (STRCAT "*" (GETVAR "DWGPREFIX") ";*,*" (GETVAR "DWGPREFIX")))) (SETVAR "TRUSTEDPATHS" (STRCAT (GETVAR "TRUSTEDPATHS") ";" (GETVAR "DWGPREFIX"))) ) (IF (SETQ whoscr (FINDFILE (STRCAT (GETVAR "DWGPREFIX") "whodunit.scr"))) (PROGN (SETQ this_scr (OPEN whoscr "r")) (WHILE (SETQ this_line (READ-LINE this_scr)) (IF this_line (IF (EQ this_line "") (COMMAND "") (PROGN ;;; (PRINC "\n") ;;; (PRINC this_line) ;;; (PRINC) (EVAL (READ this_line)) ) ) ) ) (CLOSE this_scr) ) (PROGN (IF ustr nil (LOAD "USTR" "\nFile USTR.LSP not loaded! ") ) ;_ end of IF (SETQ designed_by (ustr 1 "Designed By:" (IF designed_by designed_by (GETVAR "loginname") ) ;_ end of IF T ) ;_ end of ustr ) ;_ end of SETQ (SETQ drawn_by (ustr 1 "Drawn By:" (IF drawn_by drawn_by (GETVAR "loginname") ) ;_ end of IF T ) ;_ end of ustr ) ;_ end of SETQ (SETQ checked_by (ustr 1 "Checked By:" (IF checked_by checked_by (GETVAR "loginname") ) ;_ end of IF T ) ;_ end of ustr ) ;_ end of SETQ (IF (SETQ this_scr (FINDFILE (STRCAT (GETVAR "DWGPREFIX") "whodunit.scr") ) ;_ end of FINDFILE ) ;_ end of SETQ nil (PROGN (SETQ this_uppath (EVAL (CONS 'STRCAT (MAPCAR '(LAMBDA (x) (STRCAT x "\\")) (REVERSE (CDDR (REVERSE (DOS_STRTOKENS (GETVAR "DWGPREFIX") "\\" ) ;_ end of DOS_STRTOKENS ) ;_ end of REVERSE ) ;_ end of CDDR ) ;_ end of REVERSE ) ;_ end of MAPCAR ) ;_ end of CONS ) ;_ end of EVAL ) ;_ end of SETQ (IF (SETQ this_scr (FINDFILE (STRCAT this_uppath "whodunit.scr")) ) ;_ end of SETQ nil (SETQ this_scr nil) ) ;_ end of IF ) ;_ end of PROGN ) ;_ end of IF (IF this_scr NIL (PROGN (SETQ this_layout (GETVAR "CTAB")) (SETQ tblkfillin (SSGET "X" (LIST (CONS 2 "*ttbat*")))) (SETQ cnt 0) (WHILE (< cnt (SSLENGTH tblkfillin)) (SETQ this_ent (ENTGET (SSNAME tblkfillin cnt))) (SETVAR "CTAB" (CDR (ASSOC 410 this_ent))) (WHILE (NOT (EQ (CDR (ASSOC 0 this_ent)) "SEQEND")) (SETQ this_ent (ENTGET (ENTNEXT (CDR (ASSOC -1 this_ent)))) ) ;_ end of SETQ ) (SETQ this_ent (ENTGET (CDR (ASSOC -2 this_ent)))) (WHILE (NOT (EQ (CDR (ASSOC 0 this_ent)) "SEQEND")) (SETQ this_ent (ENTGET (ENTNEXT (CDR (ASSOC -1 this_ent)))) ) ;_ end of SETQ (COND ((AND (MEMBER (CONS 0 "ATTRIB") this_ent) (MEMBER (CONS 2 "DGN'D") this_ent) ) ;_ end of AND (SETQ this_ent (SUBST (CONS 1 designed_by) (ASSOC 1 this_ent) this_ent ) ;_ end of SUBST ) ;_ end of SETQ (ENTMOD this_ent) ) ((AND (MEMBER (CONS 0 "ATTRIB") this_ent) (MEMBER (CONS 2 "DRWN") this_ent) ) ;_ end of AND (SETQ this_ent (SUBST (CONS 1 drawn_by) (ASSOC 1 this_ent) this_ent ) ;_ end of SUBST ) ;_ end of SETQ (ENTMOD this_ent) ) ((AND (MEMBER (CONS 0 "ATTRIB") this_ent) (MEMBER (CONS 2 "CHK'D") this_ent) ) ;_ end of AND (SETQ this_ent (SUBST (CONS 1 checked_by) (ASSOC 1 this_ent) this_ent ) ;_ end of SUBST ) ;_ end of SETQ (ENTMOD this_ent) ) ) ;_ end of COND ) ;_ end of WHILE (SETQ cnt (1+ cnt)) ) ;_ end of WHILE (SETVAR "CTAB" this_layout) (PRINC "\n") (PRINC "Fixed designed by, drawn by, and checked by entries for " ) ;_ end of PRINC (PRINC (SSLENGTH tblkfillin)) (PRINC " title ") (IF (> (SSLENGTH tblkfillin) 1) (PRINC "blocks. ") (PRINC "block. ") ) ;_ end of IF (PRINC) ) ;_ end of PROGN ) ;_ end of IF ) ) ) ;_ end of PROGN (PRINC "\nFIXWHODUNIT command cancelled! ") ) ;_ end of IF (PRINC) ) ;_ end of DEFUN ;|«Visual LISP© Format Options» (72 2 40 2 T "end of " 80 9 2 1 1 nil nil nil T) ;*** DO NOT add text below the comment! ***|;