;;; ;;; Author: ;;; Henry C. Francis ;;; 425 N. Ashe St. ;;; Southern Pines, NC 28387 ;;; ;;; http://paracadd.com ;;; All rights reserved. ;;; ;;; Copyright: 2010 ;;; Edited: 2-8-2010 ;;;**************************************************************************** (DEFUN autotags_error (msg /) (PRINC (STRCAT "\nError: " msg)) (IF old_autotagscmdecho (SETVAR "CMDECHO" old_autotagscmdecho) ) ;_ end of IF (SETQ do_exist (IF old_do_exist old_do_exist NIL ) ;_ end of IF ) ;_ end of SETQ (SETQ *error* orig_autotagserror) (IF blklayfn (CLOSE blklayfn) ) (PRINC) ) ;_ end of DEFUN ;;;**************************************************************************** (DEFUN C:AUTOTAGS () (SETQ orig_autotagserror *error* *error* autotags_error ) ;_ end of SETQ (SETQ old_autotagscmdecho (GETVAR "CMDECHO")) (SETQ old_do_exist do_exist) (SETQ do_exist T) (SETVAR "cmdecho" 0) (SETQ ent_assoc_8_lst NIL) (IF txtsize NIL (LOAD "txtsize" "\nFile TXTSIZE.LSP not loaded! ") ) ;_ end of IF (txtsize "110") (IF dimscl nil (LOAD "dimscl") ) ;_ end of if (dimscl) (IF getstyle (getstyle "A") (PROGN (LOAD "getstyle") (getstyle "A")) ) ;_ end of if (IF gvpno nil (LOAD "gvpno" "\nFile GVPNO.LSP not loaded! ") ) ;_ end of if (gvpno) (SETQ adja (- 0 (GETVAR "viewtwist"))) (SETQ cor_obliq (/ PI 12.0)) (IF ukword NIL (LOAD "ukword" "\nFile UKWORD.LSP not loaded! ") ) ;_ end of IF (IF ustr NIL (LOAD "ustr" "\nFile USTR.LSP not loaded! ") ) ;_ end of IF (SETQ bdef_sel (NENTSELP "\nSelect Xref source for tag labels. ")) (IF (AND bdef_sel (EQ (LENGTH bdef_sel) 4) (EQ (TYPE (LAST bdef_sel)) 'LIST) ;;; (EQ (LENGTH (LAST bdef_sel)) 1) (EQ (TYPE (LAST (LAST bdef_sel))) 'ENAME) ;;; (EQ (CDR (ASSOC 0 (ENTGET (CAAR (REVERSE bdef_sel))))) (EQ (CDR (ASSOC 0 (ENTGET (LAST (LAST bdef_sel))))) "INSERT" ) ;_ end of EQ (OR (NOT (ASSOC 67 (ENTGET (LAST (LAST bdef_sel))))) (EQ (CDR (ASSOC 67 (ENTGET (LAST (LAST bdef_sel))))) 0) ) ;_ end of OR ) ;_ end of AND (PROGN (SETQ xr_prefix "*|") (IF (SETQ fnd_taglist (FINDFILE "taglist.csv")) (PROGN (SETQ autotags_lst NIL) (SETQ open_taglist (OPEN fnd_taglist "r")) (READ-LINE open_taglist) (WHILE (SETQ tagline (READ-LINE open_taglist)) (IF (WCMATCH tagline "*`,*`,*") (SETQ autotags_lst (APPEND autotags_lst (LIST tagline))) ) ;_ end of IF ) ;_ end of WHILE (CLOSE open_taglist) ) ;_ end of PROGN (SETQ autotags_lst NIL) ) ;_ end of IF (SETQ bdefname (CDR (ASSOC 2 (ENTGET (LAST (LAST bdef_sel)))))) (SETQ bdef (ENTGET (TBLOBJNAME "block" bdefname ) ;_ end of tblobjname ) ;_ end of entget ) ;_ end of setq (IF vpbnd nil (LOAD "vpbnd" "\nFile VPBND.LSP not loaded! ") ) ;_ end of IF (vpbnd) ;sets viewport boundary parameters for (ptisinvp ) function (WHILE (AND (SETQ next_ent (ENTNEXT (CDR (ASSOC -1 bdef)))) (NOT (EQ (CDR (ASSOC 0 (SETQ bdef (ENTGET next_ent)))) "ENDBLK") ) ;_ end of not ) ;_ end of AND (IF (AND (EQ (CDR (ASSOC 0 bdef)) "INSERT") (ptisinvp (SETQ tag_pt (CDR (ASSOC 10 bdef)))) ;source is in vpbnd.lsp ) ;_ end of AND (PROGN (SETQ nent_name (CDR (ASSOC 2 bdef)) nentl (CDR (ASSOC 8 bdef)) tag_pt (POLAR tag_pt (+ (- 0 (GETVAR "VIEWTWIST")) (* PI 0.5)) (* 1.5 txtht) ) ;_ end of POLAR ) ;_ end of SETQ (IF (AND autotags_lst (EVAL (CONS 'OR (MAPCAR '(LAMBDA (x)(WCMATCH x (STRCASE(STRCAT(SUBSTR nent_name(+(STRLEN bdefname)2))"`,"(SUBSTR nentl(+(STRLEN bdefname)2))"`,*"))))(MAPCAR 'STRCASE autotags_lst)) ) ;_ end of CONS ) ;_ end of EVAL ) ;_ end of AND (IF (EVAL (CONS 'OR (MAPCAR '(LAMBDA (x)(WCMATCH x (STRCASE(STRCAT(SUBSTR nent_name(+(STRLEN bdefname)2))"`,"(SUBSTR nentl(+(STRLEN bdefname)2))"`,"))))(MAPCAR 'STRCASE autotags_lst)) ) ;_ end of CONS ) ;_ end of EVAL (PROGN (SETQ tag_str "") ) ;_ end of PROGN (PROGN (SETQ tag_str "") (FOREACH n autotags_lst (IF (WCMATCH (STRCASE n) (STRCASE(STRCAT(SUBSTR nent_name (+ (STRLEN bdefname) 2))"`,"(SUBSTR nentl (+ (STRLEN bdefname) 2))"`,*")) ) ;_ end of WCMATCH (PROGN (SETQ tag_str (SUBSTR n (1+(STRLEN(STRCAT(SUBSTR nent_name(+ (STRLEN bdefname) 2))","(SUBSTR nentl (+ (STRLEN bdefname) 2))",")))) ) ;_ end of SETQ ) ) ;_ end of IF ) ;_ end of FOREACH ) ;_ end of PROGN ) ;_ end of IF (PROGN (tag_cond) (IF (EQ tag_str "~") (PROGN (IF (MEMBER(STRCASE(STRCAT(SUBSTR nent_name(+ (STRLEN bdefname) 2))","(SUBSTR nentl(+ (STRLEN bdefname) 2))","))(MAPCAR 'STRCASE autotags_lst)) NIL (SETQ autotags_lst (APPEND autotags_lst (LIST(STRCAT(SUBSTR nent_name(+ (STRLEN bdefname) 2))","(SUBSTR nentl(+ (STRLEN bdefname) 2))",")) ) ;_ end of APPEND ) ;_ end of SETQ ) (SETQ tag_str "") ) ;_ end of PROGN (PROGN (IF (MEMBER(STRCASE(STRCAT(SUBSTR nent_name(+(STRLEN bdefname)2))","(SUBSTR nentl(+(STRLEN bdefname)2))"," tag_str))(MAPCAR 'STRCASE autotags_lst)) NIL (SETQ autotags_lst (APPEND autotags_lst (LIST(STRCAT(SUBSTR nent_name(+(STRLEN bdefname)2))","(SUBSTR nentl(+(STRLEN bdefname)2))"," tag_str)) ) ;_ end of APPEND ) ;_ end of SETQ ) ) ;_ end of PROGN ) ;_ end of IF ) ;_ end of PROGN ) ;_ end of IF (IF DEBUG_TAGS (PROGN (PRINC "\n\nLayer=") (PRINC nentl) (PRINC "\nName=") (PRINC nent_name) ) ;_ end of PROGN ) ;_ end of IF (IF (OR c:gp_laysets c:corp_laysets) NIL (PROGN (LOAD "gpdgn" "\nFile GPDGN.LSP not loaded! ") (IF c:corp_laysets NIL (LOAD "gp_laysets" "\nFile GP_LAYSETS.LSP not loaded")) ) ) (IF (EQ tag_str "") NIL (PROGN (ENTMAKE (LIST (CONS 0 "TEXT") (CONS 7 "STANDARD") (CONS 8 (STRCAT mjrg llt prod text_color "NOTE"));txcolr (CONS 10 tag_pt) (CONS 11 tag_pt) (CONS 40 txtht) (CONS 50 adja) (CONS 51 cor_obliq) (CONS 62 256) (CONS 72 1) (CONS 73 2) (CONS 1 (STRCASE tag_str)) ) ;_ end of list ) ;_ end of entmake (SETQ ent_assoc_8_lst (APPEND ent_assoc_8_lst (LIST (CONS 8 (STRCAT mjrg llt prod text_color "NOTE")) ) ;_ end of LIST ) ;_ end of APPEND ) ;_ end of SETQ ) ) (SETQ tag_str NIL nent_name NIL nentl NIL tag_pt NIL ) ) ;_ end of PROGN ;;; (IF (EQ (CDR (ASSOC 0 bdef)) "INSERT") ;;; (ALERT (CDR (ASSOC 2 bdef))) ;;; ) ) ;_ end of IF ) ;_ end of while (SETQ blklayfn (IF (FINDFILE "taglist.csv") (OPEN (FINDFILE "taglist.csv") "w") (OPEN (STRCAT (GETVAR "DWGPREFIX") "taglist.csv") "w") ) ) ;_ end of SETQ (IF autotags_lst (PROGN (SETQ autotags_lst (ACAD_STRLSORT autotags_lst)) (WRITE-LINE "Block Name,Layer Name,Tag Label" blklayfn) (FOREACH n autotags_lst (WRITE-LINE n blklayfn)) ) ;_ end of PROGN ) ;_ end of IF (CLOSE blklayfn) ) ;_ end of PROGN (PROGN (SETQ use_current_dwg (ukword 1 "Yes No" "No Xref was selected. Apply autotags to current drawing? " (IF use_current_dwg use_current_dwg "No"))) (IF (EQ use_current_dwg "Yes") (PROGN (SETQ ins_ss (SSGET "X" '((0 . "INSERT"))) ins_cnt 0 ins_ss_cnt (SSLENGTH ins_ss) xr_prefix "" ) (IF (SETQ fnd_taglist (FINDFILE "taglist.csv")) (PROGN (SETQ autotags_lst NIL) (SETQ open_taglist (OPEN fnd_taglist "r")) (READ-LINE open_taglist) (WHILE (SETQ tagline (READ-LINE open_taglist)) (IF (WCMATCH tagline "*`,*`,*") (SETQ autotags_lst (APPEND autotags_lst (LIST tagline))) ) ;_ end of IF ) ;_ end of WHILE (CLOSE open_taglist) ) ;_ end of PROGN (SETQ autotags_lst NIL) ) ;_ end of IF (IF vpbnd nil (LOAD "vpbnd" "\nFile VPBND.LSP not loaded! ") ) ;_ end of IF (vpbnd) ;sets viewport boundary parameters for (ptisinvp ) function (WHILE (< ins_cnt ins_ss_cnt) (SETQ bdef (ENTGET (SSNAME ins_ss ins_cnt))) (IF (ptisinvp (SETQ tag_pt (CDR (ASSOC 10 bdef))));source is in vpbnd.lsp (PROGN (SETQ nent_name (CDR (ASSOC 2 bdef)) nentl (CDR (ASSOC 8 bdef)) tag_pt (POLAR tag_pt (+ (- 0 (GETVAR "VIEWTWIST")) (* PI 0.5)) (* 1.5 txtht) ) ;_ end of POLAR ) ;_ end of SETQ (IF (AND autotags_lst (EVAL (CONS 'OR (MAPCAR '(LAMBDA (x)(WCMATCH x (STRCASE(STRCAT nent_name "`," nentl "`,*")))) (MAPCAR 'STRCASE autotags_lst)) ) ;_ end of CONS ) ;_ end of EVAL ) ;_ end of AND (IF (EVAL (CONS 'OR (MAPCAR '(LAMBDA (x)(WCMATCH x (STRCASE(STRCAT nent_name "`," nentl "`,"))))(MAPCAR 'STRCASE autotags_lst)) ) ;_ end of CONS ) ;_ end of EVAL (PROGN (SETQ tag_str "") ) ;_ end of PROGN (PROGN (SETQ tag_str "") (FOREACH n autotags_lst (IF (WCMATCH (STRCASE n) (STRCASE(STRCAT nent_name "`," nentl "`,*")) ) ;_ end of WCMATCH (PROGN (SETQ tag_str (SUBSTR n (1+(STRLEN(STRCAT nent_name "," nentl ",")))) ) ;_ end of SETQ ) ) ;_ end of IF ) ;_ end of FOREACH ) ;_ end of PROGN ) ;_ end of IF (PROGN (tag_cond) (IF (EQ tag_str "~") (PROGN (IF (MEMBER(STRCASE(STRCAT nent_name "," nentl ","))(MAPCAR 'STRCASE autotags_lst)) NIL (SETQ autotags_lst (APPEND autotags_lst (LIST(STRCAT nent_name "," nentl ",")) ) ;_ end of APPEND ) ;_ end of SETQ ) (SETQ tag_str "") ) ;_ end of PROGN (PROGN (IF (MEMBER(STRCASE(STRCAT nent_name "," nentl "," tag_str))(MAPCAR 'STRCASE autotags_lst)) NIL (SETQ autotags_lst (APPEND autotags_lst (LIST(STRCAT nent_name "," nentl "," tag_str)) ) ;_ end of APPEND ) ;_ end of SETQ ) ) ;_ end of PROGN ) ;_ end of IF ) ;_ end of PROGN ) ;_ end of IF (IF DEBUG_TAGS (PROGN (PRINC "\n\nLayer=") (PRINC nentl) (PRINC "\nName=") (PRINC nent_name) ) ;_ end of PROGN ) ;_ end of IF (IF (EQ tag_str "") NIL (PROGN (ENTMAKE (LIST (CONS 0 "TEXT") (CONS 7 "STANDARD") (CONS 8 (STRCAT mjrg llt prod txcolr "NOTE")) (CONS 10 tag_pt) (CONS 11 tag_pt) (CONS 40 txtht) (CONS 50 adja) (CONS 51 cor_obliq) (CONS 62 256) (CONS 72 1) (CONS 73 2) (CONS 1 (STRCASE tag_str)) ) ;_ end of list ) ;_ end of entmake (SETQ ent_assoc_8_lst (APPEND ent_assoc_8_lst (LIST (CONS 8 (STRCAT mjrg llt prod txcolr "NOTE")) ) ;_ end of LIST ) ;_ end of APPEND ) ;_ end of SETQ ) ) (SETQ tag_str NIL nent_name NIL nentl NIL tag_pt NIL ) ) ;_ end of PROGN ;;; (IF (EQ (CDR (ASSOC 0 bdef)) "INSERT") ;;; (ALERT (CDR (ASSOC 2 bdef))) ;;; ) ) ;_ end of IF (SETQ ins_cnt (1+ ins_cnt)) ) ;_ end of while (SETQ blklayfn (IF (FINDFILE "taglist.csv") (OPEN (FINDFILE "taglist.csv") "w") (OPEN (STRCAT (GETVAR "DWGPREFIX") "taglist.csv") "w") ) ) ;_ end of SETQ (IF autotags_lst (PROGN (SETQ autotags_lst (ACAD_STRLSORT autotags_lst)) (WRITE-LINE "Block Name,Layer Name,Tag Label" blklayfn) (FOREACH n autotags_lst (WRITE-LINE n blklayfn)) ) ;_ end of PROGN ) ;_ end of IF (CLOSE blklayfn) ) ;_ end of PROGN ) ) ) (IF old_autotagscmdecho (SETVAR "CMDECHO" old_autotagscmdecho) ) ;_ end of IF (SETQ do_exist (IF old_do_exist old_do_exist NIL ) ;_ end of IF ) ;_ end of SETQ (IF ent_assoc_8_lst (PROGN (FOREACH n ent_assoc_8_lst (SETQ thslayenam (TBLOBJNAME "LAYER" (CDR n))) (IF thslayenam (PROGN (SETQ thslayent (ENTGET thslayenam)) (SETQ thslayent (SUBST (CONS 62 (ATOI (SUBSTR (CDR n) 7 1))) (ASSOC 62 thslayent) thslayent ) ;_ end of SUBST ) ;_ end of SETQ (SETQ thslayent (SUBST (CONS 6 "CONTINUOUS") (ASSOC 6 thslayent) thslayent ) ;_ end of SUBST ) ;_ end of SETQ (ENTMOD thslayent) (ENTUPD (CDR (ASSOC -1 thslayent))) ) ;_ end of PROGN ) ;_ end of IF ) ;_ end of FOREACH (SETQ ent_assoc_8_lst NIL) ) ;_ end of PROGN ) ;_ end of if (PRINC) ) ;_ end of DEFUN ;;;**************************************************************************** (DEFUN tag_cond () (COND ((WCMATCH (STRCASE nentl) (STRCAT xr_prefix "??00FO?CABL")) (SETQ tag_str "FO") ) ((WCMATCH (STRCASE nentl) (STRCAT xr_prefix "??00FO?SIGN")) (SETQ tag_str "FO MARKER") ) ((OR (WCMATCH (STRCASE nentl) (STRCAT xr_prefix "??00FO?0PED")) (WCMATCH (STRCASE nentl) (STRCAT xr_prefix "??00FO?SYMB")) ) ;_ end of OR (SETQ tag_str "FO PED.") ) ((OR (WCMATCH (STRCASE nentl) (STRCAT xr_prefix "??0ROW?MONU")) (WCMATCH (STRCASE nent_name) "*RWMON*") ) ;_ end of OR (SETQ tag_str "R/W MON.") ) ((WCMATCH (STRCASE nentl) (STRCAT xr_prefix "??0TEL?POLE")) (SETQ tag_str "TP") ) ((OR (WCMATCH (STRCASE nentl) (STRCAT xr_prefix "??CABL?0PED")) (WCMATCH (STRCASE nent_name) "*CATV") ) ;_ end of OR (SETQ tag_str "CATV") ) ((OR (WCMATCH (STRCASE nentl) (STRCAT xr_prefix "??0TEL?0PED")) (WCMATCH (STRCASE nentl) (STRCAT xr_prefix "X-TELPED")) (WCMATCH (STRCASE nentl) (STRCAT xr_prefix "??COMM?TPED")) (WCMATCH (STRCASE nent_name) "*TPED") ) ;_ end of OR (SETQ tag_str "TEL. PED") ) ((WCMATCH (STRCASE nentl) (STRCAT xr_prefix "*GATE*")) (SETQ tag_str "GATE") ) ((OR (WCMATCH (STRCASE nentl) (STRCAT xr_prefix "*MANH")) (WCMATCH (STRCASE nent_name) "*MH_EX") ) ;_ end of OR (SETQ tag_str "MH") ) ((OR (WCMATCH (STRCASE nentl) (STRCAT xr_prefix "??MAIL?0BOX")) (WCMATCH (STRCASE nent_name) "*MBOX") ) ;_ end of OR (SETQ tag_str "MB") ) ((WCMATCH (STRCASE nentl) (STRCAT xr_prefix "??ECTR?MANH")) (SETQ tag_str "ELEC. MH") ) ((WCMATCH (STRCASE nentl) (STRCAT xr_prefix "??POWR?EQPM")) (SETQ tag_str "POWER EQUIP.") ) ((WCMATCH (STRCASE nentl) (STRCAT xr_prefix "??POWR?PANL")) (SETQ tag_str "POWER PANEL") ) ((OR (WCMATCH (STRCASE nentl) (STRCAT xr_prefix "??00SD?CBSN")) (WCMATCH (STRCASE nentl) (STRCAT xr_prefix "??SDRN?00GI")) (WCMATCH (STRCASE nentl) (STRCAT xr_prefix "??SDRN?CBSN")) (WCMATCH (STRCASE nent_name) "*CB") ) ;_ end of OR (SETQ tag_str "CB") ) ((WCMATCH (STRCASE nentl) (STRCAT xr_prefix "CHCULV?0BOX")) (SETQ tag_str "BOX CULVERT") ) ((OR (WCMATCH (STRCASE nentl) (STRCAT xr_prefix "??LITE?POLE")) (WCMATCH (STRCASE nent_name) "*LUMIN") ) ;_ end of OR (SETQ tag_str "LP") ) ((AND (OR (WCMATCH (STRCASE nentl) (STRCAT xr_prefix "*GUY*")) (WCMATCH (STRCASE nentl) (STRCAT xr_prefix "??POWR?POLE")) ) ;_ end of OR (WCMATCH (STRCASE nent_name) "*GUY*") (NOT (WCMATCH (STRCASE nent_name) "*POLE*")) ) ;_ end of AND (SETQ tag_str "GUYWIRE") ) ((WCMATCH (STRCASE nentl) (STRCAT xr_prefix "*GUY*POLE*")) (SETQ tag_str "GUY POLE") ) ((OR (AND (WCMATCH (STRCASE nentl) (STRCAT xr_prefix "??POWR?POLE")) (NOT (WCMATCH (STRCASE nent_name) "*GUY*")) ) ;_ end of AND (WCMATCH (STRCASE nent_name) "*U_POLE") ) ;_ end of OR (SETQ tag_str "PP") ) ((WCMATCH (STRCASE nentl) (STRCAT xr_prefix "??PLNT*BOX*")) (SETQ tag_str "PLANTER BOX") ) ((WCMATCH (STRCASE nentl) (STRCAT xr_prefix "MONITORING-WELL")) (SETQ tag_str "MON. WELL") ) ((WCMATCH (STRCASE nentl) (STRCAT xr_prefix "X-WELL")) (SETQ tag_str "WELL") ) ((WCMATCH (STRCASE nentl) (STRCAT xr_prefix "NCGS-MONUMENT")) (SETQ tag_str "NCGS MON.") ) ((OR (WCMATCH (STRCASE nentl) (STRCAT xr_prefix "WM")) (WCMATCH (STRCASE nentl) (STRCAT xr_prefix "X-WM")) (WCMATCH (STRCASE nentl) (STRCAT xr_prefix "*000W*")) (WCMATCH (STRCASE nentl) (STRCAT xr_prefix "*X*WATER")) (WCMATCH (STRCASE nentl) (STRCAT xr_prefix "*WATR?SYMB")) ) ;_ end of OR (COND ((OR (WCMATCH (STRCASE nent_name) "*FH*") (WCMATCH (STRCASE nent_name) "*E_HYD*") ) ;_ end of OR (SETQ tag_str "FH") ) ((WCMATCH (STRCASE nent_name) "*WM*") (SETQ tag_str "WM") ) ((OR (WCMATCH (STRCASE nent_name) "*WV*") (WCMATCH (STRCASE nent_name) "*[GP]VLT*") ) ;_ end of OR (SETQ tag_str "WV") ) ((WCMATCH (STRCASE nent_name) "*WELL*") (SETQ tag_str "WELL") ) (T (SETQ tag_str (ustr 1 (STRCAT "Enter tag label for block \"" nent_name "\" on layer \"" nentl "\" [~ for none]") "~" T) ) ;_ end of SETQ ) ) ;_ end of COND ) ((OR (WCMATCH (STRCASE nentl) (STRCAT xr_prefix "??0EIR?SYMB")) (WCMATCH (STRCASE nentl) (STRCAT xr_prefix "X-EIR")) ) ;_ end of OR (SETQ tag_str "EIR") ) ((OR (WCMATCH (STRCASE nentl) (STRCAT xr_prefix "X-EIP")) (WCMATCH (STRCASE nentl) (STRCAT xr_prefix "X-IP")) ) ;_ end of OR (SETQ tag_str "EIP") ) ((WCMATCH (STRCASE nentl) (STRCAT xr_prefix "*SIGN*")) (SETQ tag_str "SIGN") ) (T (SETQ tag_str (ustr 1 (STRCAT "Enter tag label for block \"" nent_name "\" on layer \"" nentl "\" [~ for none]") "~" T) ) ;_ end of SETQ ) ) ) ;;;**************************************************************************** (DEFUN C:EDTAGS () (IF check_for_doslib NIL (LOAD "check_for_doslib" "\nFile CHECK_FOR_DOSLIB.LSP not loaded! ")) (check_for_doslib) (SETQ taglist (FINDFILE "taglist.csv")) (IF taglist (SETQ tag_file (DOS_GETFILENAV "Edit Tag Labels" taglist "csv" 4)) (SETQ new_tag_file (DOS_GETFILENAV "Create Tag Label File" (STRCAT (GETVAR "DWGPREFIX") "taglist.csv") "csv" 1)) ) (IF new_tag_file (PROGN (SETQ open_newtag (OPEN new_tag_file "w")) (WRITE-LINE "Block Name,Layer Name,Tag Label" open_newtag) (CLOSE open_newtag) ) ) (COND ((AND tag_file (FINDFILE (STRCAT (DOS_SPECIALDIR 38) "Microsoft Office\\Office12\\EXCEL.EXE"))) (STARTAPP (STRCAT (DOS_SPECIALDIR 38) "Microsoft Office\\Office12\\EXCEL.EXE") tag_file)) ((AND new_tag_file (FINDFILE (STRCAT (DOS_SPECIALDIR 38) "Microsoft Office\\Office12\\EXCEL.EXE"))) (STARTAPP (STRCAT (DOS_SPECIALDIR 38) "Microsoft Office\\Office12\\EXCEL.EXE") new_tag_file)) ((NOT (FINDFILE (STRCAT (DOS_SPECIALDIR 38) "Microsoft Office\\Office12\\EXCEL.EXE"))) (IF ukword NIL (LOAD "ukword" "\nFile UKWORD.LSP not loaded! ")) (SETQ have_excel (ukword 1 "Yes No" "Microsoft Excel was not found! Do you want to browse to it or another spreadsheet application?" (IF have_excel have_excel "No"))) (IF (EQ have_excel "Yes") (PROGN (IF (DOS_DIRP (STRCAT (DOS_SPECIALDIR 38) "Microsoft Office\\")) (SETQ appfile (DOS_GETFILENAV "Locate EXCEL.EXE" (STRCAT (DOS_SPECIALDIR 38) "Microsoft Office\\") "exe" 4)) (SETQ appfile (DOS_GETFILENAV "Locate Spreadsheet Application" (DOS_SPECIALDIR 38) "exe" 4)) ) ) (SETQ appfile NIL) ) (IF (AND appfile (OR tag_file new_tag_file)) (STARTAPP appfile (IF tag_file tag_file new_tag_file)) )) ) (PRINC) ) ;;;**************************************************************************** ;|«Visual LISP© Format Options» (72 2 40 2 T "end of " 60 9 2 0 0 nil T nil T) ;*** DO NOT add text below the comment! ***|;