;;;Creates viewport just inside our standard ANSI-D size sheet border. ;;;Includes a notch around our revision block. ;;; ;;;Expects the border to be scaled 1:1 with origin at 0.0,0.0 per standard. ;;; ;;; Author: ;;; Henry C. Francis ;;; 425 N. Ashe St. ;;; Southern Pines, NC 28387 ;;; ;;; http://www.paracadd.com ;;; All rights reserved. ;;; ;;; Copyright: 2-6-2006 ;;; Edited: 5-2-2008 ;;; (DEFUN c:ansidvp () (COMMAND) (vl-load-com) (SETQ old_vp_osmode (GETVAR "osmode")) (SETQ old_vp_cecolor (GETVAR "cecolor")) (SETQ old_vp_celtype (GETVAR "celtype")) (SETVAR "osmode" 0) (SETVAR "cecolor" "ByLayer") (SETVAR "celtype" "ByLayer") (vla-put-MSpace (vla-get-Activedocument (vlax-get-Acad-Object)) :vlax-false) ;;; (COMMAND "pspace") (IF c:mymview nil (LOAD "mymview" "File MYMVIEW.LSP not loaded! ") ) ;_ end of if (IF c:mymview (PROGN (SETQ from_vpfun T) (c:mymview)) ;;; (COMMAND ".-layer" "m" "G-VI027NPLT" "") ) ;_ end of if (IF ukword NIL (LOAD "ukword" "\nFile UKWORD.LSP not loaded! ")) (SETQ vp1_type (ukword 1 "Left Right Top Full" "Type of plan viewport? [Left/Right/Top/Full]" (IF vp1_type vp1_type "Full"))) (IF uint NIL (LOAD "uint" "\nFile UINT.LSP not loaded! ")) (SETQ vp_number (uint 1 "" "Specify viewport number" (IF (AND vp_number (EQ (TYPE vp_number) 'INT)) vp_number 2))) (COND ((AND vp_number (EQ (TYPE vp_number) 'INT) (< vp_number 10)) (SETQ ent_assoc_8 (CONS 8 (STRCAT "G-VI0" (ITOA vp_number) "7NPLT")))) ((AND vp_number (EQ (TYPE vp_number) 'INT) (< vp_number 100)) (SETQ ent_assoc_8 (CONS 8 (STRCAT "G-VI" (ITOA vp_number) "7NPLT")))) (T (ALERT "Viewport number out of range or not specified.\nDefault number (2) was applied.\nSpecified number must be between 0 and 99") (SETQ ent_assoc_8 (CONS 8 "G-VI027NPLT"))) ) (COND ((EQ vp1_type "Left") (COMMAND ".mview" "p" "1.55,11.00" "16.3438,11.00" "16.3438,21.45" "1.55,21.45" "" ) ;_ end of command ) ((EQ vp1_type "Right") (COMMAND ".mview" "p" "16.3438,11.00" "31.1375,11.00" "31.1375,20.8194" "24.95,20.8194" "24.95,21.45" "16.3438,21.45" "" ) ;_ end of command ) ((EQ vp1_type "Top") (COMMAND ".mview" "p" "1.55,11.00" "31.1375,11.00" "31.1375,20.8194" "24.95,20.8194" "24.95,21.45" "1.55,21.45" "" ) ;_ end of command ) ((EQ vp1_type "Full") (COMMAND ".mview" "p" "1.55,0.55" "31.1375,0.55" "31.1375,20.8194" "24.95,20.8194" "24.95,21.45" "1.55,21.45" "" ) ;_ end of command ) ) (SETVAR "osmode" old_vp_osmode) (SETVAR "cecolor" old_vp_cecolor) (SETVAR "celtype" old_vp_celtype) (PRINC) ) ;_ end of defun (DEFUN c:ansidpl2 () ;creates a standard plan viewport (view 2 = "VI02") polyline for "sheet view" viewport clipping (SETQ pvppl_1 (LIST 1.55 0.55 0.0) pvppl_1a (LIST 1.55 11.00 0.0) pvppl_1b (LIST 16.3438 11.00 0.0) pvppl_2 (LIST 31.1375 0.55 0.0) pvppl_2a (LIST 31.1375 11.00 0.0) pvppl_3 (LIST 31.1375 20.8194 0.0) pvppl_4 (LIST 24.95 20.8194 0.0) pvppl_5 (LIST 24.95 21.45 0.0) pvppl_6 (LIST 1.55 21.45 0.0) pvppl_6b (LIST 16.3438 21.45 0.0) ) ;_ end of setq (IF ukword NIL (LOAD "ukword" "\nFile UKWORD.LSP not loaded! ")) (SETQ vp_type (ukword 1 "Left Right Full" "Type of plan viewport? [Left/Right/Full]" (IF vp_type vp_type "Full"))) (IF uint NIL (LOAD "uint" "\nFile UINT.LSP not loaded! ")) (SETQ vp_number (uint 1 "" "Specify viewport number" (IF (AND vp_number (EQ (TYPE vp_number) 'INT)) vp_number 2))) (COND ((AND vp_number (EQ (TYPE vp_number) 'INT) (< vp_number 10)) (SETQ ent_assoc_8 (CONS 8 (STRCAT "G-VI0" (ITOA vp_number) "7NPLT")))) ((AND vp_number (EQ (TYPE vp_number) 'INT) (< vp_number 100)) (SETQ ent_assoc_8 (CONS 8 (STRCAT "G-VI" (ITOA vp_number) "7NPLT")))) (T (ALERT "Viewport number out of range or not specified.\nDefault number (2) was applied.\nSpecified number must be between 0 and 99") (SETQ ent_assoc_8 (CONS 8 "G-VI027NPLT"))) ) (COND ((EQ vp_type "Left") (PROGN (ENTMAKE (LIST (CONS 0 "POLYLINE") ent_assoc_8 (CONS 10 (LIST 0 0 0)) (CONS 66 1) (CONS 70 1))) (ENTMAKE (LIST (CONS 0 "VERTEX") ent_assoc_8 (CONS 10 pvppl_1a) (CONS 66 1))) (ENTMAKE (LIST (CONS 0 "VERTEX") ent_assoc_8 (CONS 10 pvppl_1b) (CONS 66 1))) (ENTMAKE (LIST (CONS 0 "VERTEX") ent_assoc_8 (CONS 10 pvppl_6b) (CONS 66 1))) (ENTMAKE (LIST (CONS 0 "VERTEX") ent_assoc_8 (CONS 10 pvppl_6) (CONS 66 1))) (ENTMAKE (LIST (CONS 0 "SEQEND") ent_assoc_8)) ) ;_ end of PROGN ) ((EQ vp_type "Right") (PROGN (ENTMAKE (LIST (CONS 0 "POLYLINE") ent_assoc_8 (CONS 10 (LIST 0 0 0)) (CONS 66 1) (CONS 70 1))) (ENTMAKE (LIST (CONS 0 "VERTEX") ent_assoc_8 (CONS 10 pvppl_1b) (CONS 66 1))) (ENTMAKE (LIST (CONS 0 "VERTEX") ent_assoc_8 (CONS 10 pvppl_2a) (CONS 66 1))) (ENTMAKE (LIST (CONS 0 "VERTEX") ent_assoc_8 (CONS 10 pvppl_3) (CONS 66 1))) (ENTMAKE (LIST (CONS 0 "VERTEX") ent_assoc_8 (CONS 10 pvppl_4) (CONS 66 1))) (ENTMAKE (LIST (CONS 0 "VERTEX") ent_assoc_8 (CONS 10 pvppl_5) (CONS 66 1))) (ENTMAKE (LIST (CONS 0 "VERTEX") ent_assoc_8 (CONS 10 pvppl_6b) (CONS 66 1))) (ENTMAKE (LIST (CONS 0 "SEQEND") ent_assoc_8)) ) ;_ end of PROGN ) ((EQ vp_type "Full") (PROGN (ENTMAKE (LIST (CONS 0 "POLYLINE") ent_assoc_8 (CONS 10 (LIST 0 0 0)) (CONS 66 1) (CONS 70 1))) (ENTMAKE (LIST (CONS 0 "VERTEX") ent_assoc_8 (CONS 10 pvppl_1) (CONS 66 1))) (ENTMAKE (LIST (CONS 0 "VERTEX") ent_assoc_8 (CONS 10 pvppl_2) (CONS 66 1))) (ENTMAKE (LIST (CONS 0 "VERTEX") ent_assoc_8 (CONS 10 pvppl_3) (CONS 66 1))) (ENTMAKE (LIST (CONS 0 "VERTEX") ent_assoc_8 (CONS 10 pvppl_4) (CONS 66 1))) (ENTMAKE (LIST (CONS 0 "VERTEX") ent_assoc_8 (CONS 10 pvppl_5) (CONS 66 1))) (ENTMAKE (LIST (CONS 0 "VERTEX") ent_assoc_8 (CONS 10 pvppl_6) (CONS 66 1))) (ENTMAKE (LIST (CONS 0 "SEQEND") ent_assoc_8)) ) ;_ end of PROGN ) ) (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! ***|;