;;;Loads standard page setups from PAGESETUP.DWT template file. ;;;Match list of page setup names below, (setq setupslst ...), to setups ;;;named in PAGESETUP.DWT Changes to PAGESETUP.DWT require changes here. ;;; ;;; ;;; ;;; ;;;****************************************************************************** ;;; ;;;> Author: Henry C. Francis ;;;> 425 N. Ashe St. ;;;> Southern Pines, NC 28387 ;;;> http://paracadd.com ;;;> All rights reserved. ;;; ;;;> COPYRIGHT: 2-8-2002 ;;;> EDITED: 06-03-2005 ;;; (DEFUN c:pgset () (IF (WCMATCH (GETVAR "ACADVER") "15.*") (PROGN (LOAD "loadpagesetups" "\nFile LOADPAGESETUPS.LSP not loaded! ") (loadpagesetups) ) ;_ end of PROGN ) ;_ end of IF (PRINC) ) ;_ end of DEFUN ;;;****************************************************************************** (defun loadpagesetups (/ pageanswers) (setq setupslst '("HUA 11X17 SHEET" "HUA 11X8.5 SHEET" "HUA 17X11 SHEET" "HUA 24X36 SHEET" "HUA 36X24 SHEET" "HUA 8.5X11 SHEET" "CMUD 18x12 SHEET" "CMUD 36x24 SHEET" ) ) ;_ end of setq (foreach n setupslst (if (getpages n) (setq pageanswers (append pageanswers (list "Yes"))) ) ;_ end of if ) ;_ end of foreach (if (findfile "pagesetup.dwt") (progn (command "-psetupin" "pagesetup.dwt" "*") ;The last string in the command, "C*", ;is a wildcard expression to import all ;of the setup names originally included ;in (setq setupslst ...) Edits to the list ;that do not begin with "C" will require ;that "C*" be edited (foreach n pageanswers (command n) ) ;_ end of foreach ) ;_ end of progn (PRINC "\nFile PAGESETUP.DWT not found! ") ) ;_ end of if (princ) ) ;_ end of defun ;;;****************************************************************************** ;;;Checks to see if a page setup already exists in the drawing. (defun getpages (name_to_check / pagesetuplst) (setq layList (dictsearch (namedobjdict) "ACAD_LAYOUT")) (setq kickopnt (assoc 102 layList)) (SETQ pltsets (entget (cdadr (member kickopnt laylist)))) (setq assocnt 0) (while (< assocnt (length pltsets)) (if (eq (cdr (nth assocnt pltsets)) "ACAD_PLOTSETTINGS") (setq setupdict (entget (cdr (nth (1+ assocnt) pltsets)))) ) ;_ end of if (setq assocnt (1+ assocnt)) ) ;_ end of while (setq assocnt 0) (while (< assocnt (length setupdict)) (cond ((eq (car (nth assocnt setupdict)) 3) (setq pagesetuplst (append pagesetuplst (list (strcase (cdr (nth assocnt setupdict)))) ) ;_ end of append ) ;_ end of setq ) ) ;_ end of cond (setq assocnt (1+ assocnt)) ) ;_ end of while (if (member (strcase name_to_check) pagesetuplst) T NIL ) ;_ end of if ) ;_ end of defun ;|«Visual LISP© Format Options» (72 2 40 2 T "end of " 60 9 0 0 0 T T nil T) ;*** DO NOT add text below the comment! ***|;