;;;HUA 8-1/2x11 (ANSI A Size 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. ;;; ;;; Copyright: 3/14/2006 ;;; Edited: 9/23/2009 ;;; (DEFUN hua_A_sheet (/ found_hua_sheet found_hua_fill) (SETQ OLD_ATTREQ (GETVAR "ATTREQ")) (SETVAR "ATTREQ" 0) (SETQ OLD_INSUNITS (GETVAR "INSUNITS")) (SETVAR "INSUNITS" 0) (SETQ hua_sheet_name "hua8511p") (SETQ hua_fill_name "huattbata") (IF (SSGET "W" (GETVAR "EXTMIN")(GETVAR "EXTMAX")(LIST (CONS 2 hua_sheet_name))) (ALERT (STRCAT "\n Sheet Border \"" hua_sheet_name "\" already exists! ")) (IF (IF (FINDFILE (STRCAT hua_sheet_name ".dwg")) (SETQ found_hua_sheet (FINDFILE (STRCAT hua_sheet_name ".dwg"))) (IF (FINDFILE (STRCAT "..\\" hua_sheet_name ".dwg")) (SETQ found_hua_sheet (FINDFILE (STRCAT "..\\" hua_sheet_name ".dwg"))) (IF DOS_COPY ;this function is part of McNeel & Associates free DOSLIB utility v6.1 (PROGN (DOS_DRIVE "H:") (DOS_CHDIR (GETVAR "dwgprefix")) (SETQ prj810dir (GETVAR "dwgprefix")) (WHILE (WCMATCH prj810dir "*\\800*\\810*\\*\\*") (SETQ prj810dir (DOS_CHDIR "..\\"))) (IF (AND (DOS_COPY "N:/STANDARDS/800 Drawings/810 Design Drawings/hua8511p.dwg" prj810dir) (DOS_COPY "N:/STANDARDS/800 Drawings/810 Design Drawings/huattbata.dwg" prj810dir) ) ;_ end of AND (PROGN (SETQ found_hua_sheet (DOS_RELATIVEPATH (GETVAR "dwgprefix") (STRCAT prj810dir "hua8511p.dwg"))) (SETQ found_hua_fill (DOS_RELATIVEPATH (GETVAR "dwgprefix") (STRCAT prj810dir "huattbata.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 v6.1 (PROGN ;If this function is available the relative path will be used where possible (SETQ relblkname (DOS_RELATIVEPATH (GETVAR "dwgprefix") found_hua_sheet)) (IF relblkname (SETQ found_hua_sheet relblkname) ) ;_ end of if ) ;_ end of PROGN ) ;_ end of if (IF (EQ (GETVAR "tilemode") 1) (SETVAR "tilemode" 0) ) ;_ end of if (COMMAND "-layer" "m" hua_sheet_name "") (COMMAND "-xref" "o" found_hua_sheet "0,0" 1 1 0) ) ;_ end of progn ) ;_ end of IF ) ;_ end of if (IF (SSGET "W" (GETVAR "EXTMIN")(GETVAR "EXTMAX")(LIST (CONS 2 hua_fill_name))) (ALERT (STRCAT "\n Sheet Title Block fill-in \"" hua_fill_name "\" already exists! ")) (IF (IF (AND (OR found_hua_fill (FINDFILE (STRCAT hua_fill_name ".dwg"))) found_hua_sheet) (IF found_hua_fill T (SETQ found_hua_fill (FINDFILE (STRCAT hua_fill_name ".dwg"))) ) ;_ end of IF (SETQ found_hua_fill (FINDFILE (STRCAT "..\\" hua_fill_name ".dwg"))) ) ;_ end of IF (IF (AND found_hua_fill found_hua_sheet) (PROGN (IF (WCMATCH (STRCASE found_hua_fill) "\\*.DWG") (SETQ found_hua_fill (SUBSTR found_hua_fill 2)) ) (IF (EQ (GETVAR "tilemode") 1) (SETVAR "tilemode" 0) ) ;_ end of if (SETVAR "DIMSCALE" 0.0) (SETVAR "LTSCALE" 0.5) (COMMAND "-layer" "m" hua_fill_name "") (COMMAND ".zoom" "w" "0,0" "8.5,11") (COMMAND ".limits" "0,0" "8.5,11") (COMMAND "-insert" found_hua_fill "0,0" 1 1 0) (COMMAND ".ddatte" "l") ) ;_ end of progn ) ;_ end of IF ) ;_ end of IF ) ;_ end of if (SETVAR "ATTREQ" OLD_ATTREQ) (SETVAR "INSUNITS" OLD_INSUNITS) (COND ((AND found_hua_sheet found_hua_fill) (PRINC)) (found_hua_fill (ALERT (STRCAT "\nSheet Border Drawing file\n\"" (STRCASE hua_sheet_name) ".DWG\" not found!\nAutoCAD support file search path should include \"L:\\Util\\\". " ) ;_ end of STRCAT ) ;_ end of ALERT ) (found_hua_sheet (ALERT (STRCAT "\nSheet Title Fill-in Drawing file\n\"" (STRCASE hua_fill_name) ".DWG\" not found!\nAutoCAD support file search path should include \"L:\\Util\\\". " ) ;_ end of STRCAT ) ;_ end of ALERT ) (T (ALERT (STRCAT "\nSheet Border and Title Fill-in Drawing files\n\"" (STRCASE hua_sheet_name) ".DWG, and " (STRCASE hua_fill_name) ".DWG\" not found!\nAutoCAD support file search path should include \"L:\\Util\\\". " ) ;_ end of STRCAT ) ;_ end of ALERT ) ) ;_ end of COND (SETQ hua_sheet_name nil) (SETQ hua_fill_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! ***|;