;;;CORP 34x22 (ANSI D Size Cover Sheet) Title Block Xref attachment function. ;;;Attach at 0,0; scale=1:1; angle=0°. ;;; ;;; Author: ;;; Henry C. Francis ;;; 425 N. Ashe St. ;;; Southern Pines, NC 28387 ;;; ;;; http://www.paracadd.com ;;; All rights reserved. ;;; ;;; Created: 9-23-2009 ;;; Edited: 5-7-2014 ;;; (DEFUN corp_D_cover (/); found_corp_sheet found_corp_fill) (SETQ OLD_ATTREQ (GETVAR "ATTREQ")) (SETVAR "ATTREQ" 0) (SETQ OLD_INSUNITS (GETVAR "INSUNITS")) (SETVAR "INSUNITS" 0) (SETQ old_fill_osmode (GETVAR "OSMODE")) (SETVAR "OSMODE" 0) (SETQ corp_std_dwg_path "\"L:\\Util\\");string for STRCAT messages (SETQ corp_sheet_name "CORPNEW2234C") (SETQ corp_fill_name "corpnewttbats") (SETQ corp_title_name "CORPDCVRTF") (IF (IF (FINDFILE (STRCAT corp_sheet_name ".dwg")) (SETQ found_corp_sheet (FINDFILE (STRCAT corp_sheet_name ".dwg"))) (IF (FINDFILE (STRCAT "..\\" corp_sheet_name ".dwg")) (SETQ found_corp_sheet (FINDFILE (STRCAT "..\\" corp_sheet_name ".dwg"))) (IF DOS_COPY ;this function is part of McNeel & Associates free DOSLIB utility (PROGN (DOS_DRIVE "L:") (DOS_CHDIR (GETVAR "dwgprefix")) (SETQ prj810dir (GETVAR "dwgprefix")) (WHILE (WCMATCH prj810dir "*\\800*\\810*\\*\\*") (SETQ prj810dir (DOS_CHDIR "..\\"))) (IF (AND (DOS_COPY "L:/Util/CORPNEW2234C.dwg" prj810dir) (DOS_COPY "L:/Util/corpnewttbats.dwg" prj810dir) ) ;_ end of AND (PROGN (SETQ found_corp_sheet (DOS_RELATIVEPATH (GETVAR "dwgprefix") (STRCAT prj810dir "CORPNEW2234C.dwg"))) (SETQ found_corp_fill (DOS_RELATIVEPATH (GETVAR "dwgprefix") (STRCAT prj810dir "corpnewttbats.dwg"))) ) ;_ end of PROGN ) ;_ end of IF ) ;_ end of PROGN ) ;_ end of if ) ;_ end of IF ) ;_ end of IF (PROGN (IF DOS_RELATIVEPATH ;this function is part of McNeel & Associates free DOSLIB utility (PROGN ;If this function is available the relative path will be used where possible (SETQ relblkname (DOS_RELATIVEPATH (GETVAR "dwgprefix") found_corp_sheet)) (IF relblkname (SETQ found_corp_sheet relblkname) ) ;_ end of if ) ;_ end of PROGN ) ;_ end of if (IF (EQ (GETVAR "tilemode") 1) (SETVAR "tilemode" 0) ) ;_ end of if (WHILE (WCMATCH found_corp_sheet "\\*") (SETQ found_corp_sheet (SUBSTR found_corp_sheet 2)) ) (COMMAND "-layer" "m" corp_sheet_name "") (IF (TBLSEARCH "block" corp_sheet_name) (PROGN (SETQ no_sheet NIL) (ENTMAKE (LIST (CONS 0 "INSERT") (CONS 2 corp_sheet_name) (CONS 10 (LIST 0.0 0.0 0.0)) (CONS 41 1.0) (CONS 42 1.0) (CONS 43 1.0) (CONS 50 0.0))) ;;; (ALERT (STRCAT corp_sheet_name " is already a standard block in this drawing! ")) ) (PROGN (SETQ no_sheet NIL) (COMMAND "-insert" (STRCAT corp_sheet_name "=") "0,0" 1 1 0) ) ) ) ;_ end of progn ) ;_ end of IF ;;; (IF (OR no_sheet (SSGET "W" (GETVAR "EXTMIN")(GETVAR "EXTMAX")(LIST (CONS 2 corp_fill_name)))) ;;; (IF (TBLSEARCH "block" corp_sheet_name) ;;; NIL ;;; (ALERT (STRCAT "\n Sheet Title Block fill-in \"" corp_fill_name "\" already exists! ")) ;;; ) (IF (IF (AND (OR found_corp_title (FINDFILE (STRCAT corp_title_name ".dwg"))) found_corp_sheet) (IF found_corp_title T (SETQ found_corp_title (FINDFILE (STRCAT corp_title_name ".dwg"))) ) ;_ end of IF (SETQ found_corp_title (FINDFILE (STRCAT "..\\" corp_title_name ".dwg"))) ) ;_ end of IF (IF (AND found_corp_title found_corp_sheet) (PROGN (IF (WCMATCH (STRCASE found_corp_title) "\\*.DWG") (SETQ found_corp_title (SUBSTR found_corp_title 2)) ) (IF (EQ (GETVAR "tilemode") 1) (SETVAR "tilemode" 0) ) ;_ end of if (SETVAR "DIMSCALE" 0.0) (SETVAR "LTSCALE" 0.5) (COMMAND "-layer" "m" corp_title_name "") (COMMAND ".zoom" "w" "0,0" "34,22") (COMMAND ".limits" "0,0" "34,22") (COMMAND "-insert" found_corp_title "0,0" 1 1 0) (COMMAND ".explode" (ssget "X" (LIST (CONS 2 (NTH 2 (DOS_SPLITPATH found_corp_title)))))) (IF setstdpage NIL (LOAD "setstdpage" "\nFile SETSTDPAGE.LSP not loaded! ")) (setstdpage "TIFF 34x22 288dpi PS") ) ;_ end of progn ) ;_ end of IF ) ;_ end of IF (IF (IF (AND (OR found_corp_fill (FINDFILE (STRCAT corp_fill_name ".dwg"))) found_corp_sheet) (IF found_corp_fill T (SETQ found_corp_fill (FINDFILE (STRCAT corp_fill_name ".dwg"))) ) ;_ end of IF (SETQ found_corp_fill (FINDFILE (STRCAT "..\\" corp_fill_name ".dwg"))) ) ;_ end of IF (IF (AND found_corp_fill found_corp_sheet) (PROGN (IF (WCMATCH (STRCASE found_corp_fill) "\\*.DWG") (SETQ found_corp_fill (SUBSTR found_corp_fill 2)) ) (IF (EQ (GETVAR "tilemode") 1) (SETVAR "tilemode" 0) ) ;_ end of if (SETVAR "DIMSCALE" 0.0) (SETVAR "LTSCALE" 0.5) (COMMAND "-layer" "m" corp_fill_name "") (COMMAND ".zoom" "w" "0,0" "34,22") (COMMAND ".limits" "0,0" "34,22") (COMMAND "-insert" found_corp_fill "3,0" 1 1 0) (IF attupd NIL (LOAD "attupd" "\nFile ATTUPD.LSP not loaded! ")) (IF attupd (PROGN (attupd corp_fill_name "TITLE_1" "COVER SHEET") (attupd corp_fill_name "SHT_NO." "G-1") ) ) ) ;_ end of progn ) ;_ end of IF ) ;_ end of IF ;;; ) ;_ end of if (SETVAR "ATTREQ" OLD_ATTREQ) (SETVAR "INSUNITS" OLD_INSUNITS) (SETVAR "OSMODE" old_fill_osmode) (COND (no_sheet NIL) ((AND found_corp_sheet found_corp_fill found_corp_title) (PRINC)) ((AND found_corp_fill found_corp_sheet) (ALERT (STRCAT "\nCover Sheet Title Text drawing file\n\"" (STRCASE corp_sheet_name) ".DWG\" not found!\nAutoCAD support file search path should include " corp_std_dwg_path "\". " ) ;_ end of STRCAT ) ;_ end of ALERT ) ((AND found_corp_fill found_corp_title) (ALERT (STRCAT "\nCover Sheet Border drawing file\n\"" (STRCASE corp_sheet_name) ".DWG\" not found!\nAutoCAD support file search path should include " corp_std_dwg_path "\". " ) ;_ end of STRCAT ) ;_ end of ALERT ) ((AND found_corp_title found_corp_sheet) (ALERT (STRCAT "\nProject Sheet Index Data drawing file\n\"" (STRCASE corp_sheet_name) ".DWG\" not found!\nAutoCAD support file search path should include " corp_std_dwg_path "\". " ) ;_ end of STRCAT ) ;_ end of ALERT ) (found_corp_sheet (ALERT (STRCAT "\nCover Sheet Title Text and Project Sheet Index Data drawing files\n\"" (STRCASE corp_title_name) ".DWG and " (STRCASE corp_fill_name) ".DWG\" not found!\nAutoCAD support file search path should include " corp_std_dwg_path "\". " ) ;_ end of STRCAT ) ;_ end of ALERT ) (found_corp_title (ALERT (STRCAT "\nCover Sheet Border and Project Sheet Index Data drawing files\n\"" (STRCASE corp_sheet_name) ".DWG and " (STRCASE corp_fill_name) ".DWG\" not found!\nAutoCAD support file search path should include " corp_std_dwg_path "\". " ) ;_ end of STRCAT ) ;_ end of ALERT ) (found_corp_fill (ALERT (STRCAT "\nCover Sheet Border and Cover Sheet Title Text drawing files\n\"" (STRCASE corp_sheet_name) ".DWG and " (STRCASE corp_title_name) ".DWG\" not found!\nAutoCAD support file search path should include " corp_std_dwg_path "\". " ) ;_ end of STRCAT ) ;_ end of ALERT ) (T (ALERT (STRCAT "\nCover Sheet Border and Project Sheet Index Data drawing files\n\"" (STRCASE corp_sheet_name) ".DWG, and " (STRCASE corp_fill_name) ".DWG\" not found!\nAutoCAD support file search path should include " corp_std_dwg_path "\". " ) ;_ end of STRCAT ) ;_ end of ALERT ) ) ;_ end of COND (SETQ corp_sheet_name nil) (SETQ corp_fill_name nil) (SETQ corp_title_name nil) (PRINC) ) ;_ end of defun ;|«Visual LISP© Format Options» (120 2 15 2 T "end of " 100 9 2 0 nil nil nil T T) ;*** DO NOT add text below the comment! ***|;