;;; ;;; Requires: ukword.lsp ;; (DEFUN set_mjrg () (IF mjrg (SETQ this_mjrg mjrg) (PROGN (SETQ this_dir (LAST (DOS_STRTOKENS (GETVAR "dwgprefix") "\\"))) (COND ((AND mjrg (WCMATCH (STRCASE (STRCAT "## " mjrg)) (STRCASE (SUBSTR this_dir 1 4)) ) ;_ end of WCMATCH ) ;_ end of AND (SETQ this_mjrg mjrg) ) ((WCMATCH (STRCASE (GETVAR "DWGNAME")) "*PLAN & PROFILE*") (SETQ this_mjrg "C") ) ((WCMATCH (STRCASE (GETVAR "DWGNAME")) "[CGSAPEMTMHFL]????X[O1-9]#*.DWG" ) ;_ end of WCMATCH (SETQ this_mjrg (STRCASE (SUBSTR (GETVAR "DWGNAME") 1 1))) ) ((WCMATCH (STRCASE this_dir) "01 GENERAL") (SETQ this_mjrg "G") ) ((WCMATCH (STRCASE this_dir) "02 CIVIL") (SETQ this_mjrg "C") ) ((WCMATCH (STRCASE this_dir) "03 STRUCTURAL") (SETQ this_mjrg "S") ) ((WCMATCH (STRCASE this_dir) "04 ARCHITECTURAL") (SETQ this_mjrg "A") ) ((WCMATCH (STRCASE this_dir) "05 P&ID") (SETQ this_mjrg "I") ) ((WCMATCH (STRCASE this_dir) "06 ENVIRONMENTAL") (SETQ this_mjrg "M") ) ((WCMATCH (STRCASE this_dir) "06 MECHANCIAL") (SETQ this_mjrg "M") ) ((WCMATCH (STRCASE this_dir) "07 TELEMETRY") (SETQ this_mjrg "T") ) ((WCMATCH (STRCASE this_dir) "08 ELECTRICAL") (SETQ this_mjrg "E") ) ((WCMATCH (STRCASE this_dir) "09 MECHANICAL") (SETQ this_mjrg "M") ) ((WCMATCH (STRCASE this_dir) "09 HVAC") (SETQ this_mjrg "H") ) ((WCMATCH (STRCASE this_dir) "10 PLUMBING") (SETQ this_mjrg "P") ) ((WCMATCH (STRCASE this_dir) "11 FIRE") (SETQ this_mjrg "F") ) ((WCMATCH (STRCASE this_dir) "12 LANDSCAPE") (SETQ this_mjrg "L") ) ((NOT asked_set_mjrg) (IF ukword NIL (LOAD "ukword" "\nFile UKWORD.LSP not loaded! ")) (WHILE (OR (NOT this_mjrg) (WCMATCH this_mjrg "`?")) (SETQ this_mjrg (ukword 1 "A C E F G H I L M P S ?" "CAD Layer Guidelines (CLG) Major Group [A/C/E/F/G/H/I/L/M/P/S/?]" (IF this_mjrg this_mjrg (IF mjrg mjrg "C")) ) ;_ end of ukword ) ;_ end of SETQ (IF (WCMATCH this_mjrg "`?") (ALERT (STRCAT "The CLG (1st Ed.) Major Group is a single\n" "character representing a discipline:\n\n" "A = Architectural\n" "C = Civil\n" "E = Electrical\n" "F = Fire Protection\n" "G = General\n" "H = HVAC\n" "I = Instrumentation\n" "L = Landscaping\n" "M = Mechanical\n" "P = Plumbing\n" "S = Structural" ) ) ) ) (SETQ asked_set_mjrg (IF this_mjrg this_mjrg (IF mjrg mjrg "C") ) ;_ end of IF ) ;_ end of SETQ ) ) ;_ end of COND ) ;_ end of PROGN ) ;_ end of IF (IF this_mjrg (SETQ mjrg this_mjrg) (IF asked_set_mjrg (SETQ mjrg asked_set_mjrg) (SETQ mjrg (IF mjrg mjrg "C")) ) ;_ end of IF ) ;_ end of IF (PRINC) ) ;_ end of DEFUN ;|«Visual LISP© Format Options» (72 2 40 2 T "end of " 60 9 2 0 0 T T nil T) ;*** DO NOT add text below the comment! ***|;