;Tip1757: USA.LSP USA Flag (C)2001, Watson Kilbourne ;; ;; Creates the United States of America banner. ;; Use black screen background for best results. ; ; I got this out of the December 2001 issue of Cadalyst. ; Check out www.cadalyst.com for other downloadables. ; Type USA . Specify the corners of your flag. -Paul B; ; (defun C:USA (/ CE BM OS OE SP HT XD XA EP YA D1 D2 D3 D4 RP RH XZ YZ P1 P2 P3 P4 P5 P6 P7 P8 P9 PX PY PZ S1 S2 S3 S4 S5 S6 ) (setq CE (getvar "CMDECHO") BM (getvar "BLIPMODE") OM (getvar "OSMODE") ) ;_ end of setq (defun NE (NE) (setvar "CMDECHO" CE) (setvar "BLIPMODE" BM) (setvar "OSMODE" OM) (princ "Function cancelled ") (princ) ) ;_ end of defun (setq OE *ERROR* *ERROR* NE ) ;_ end of setq (setvar "CMDECHO" 0) (setvar "OSMODE" 0) (while (= SP NIL) (setq SP (getpoint "\nPick lower left corner of flag: ")) ) ;_ end of while (while (= HT NIL) (setq HT (getcorner SP "\nPick upper right corner of flag : ") ) ;_ end of setq ) ;_ end of while (if (>= (angle SP HT) (/ pi 2)) (setq HT (polar SP (/ pi 4) (distance SP HT))) ) ;_ end of if (setq XD (distance SP HT) XA (angle SP HT) EP (polar SP (/ pi 2) (* XD (sin XA))) YA (angle SP EP) D1 (distance SP EP) D2 (/ D1 13) D3 (* D2 0.8) D4 (* D2 1.4) RP (polar SP 0.0 (* D1 1.5)) RH (polar EP 0.0 (* D1 1.5)) XZ (polar SP (* pi 1.25) D2) YZ (polar RH (* pi 0.25) D2) P1 (polar SP (/ pi 2) (* D2 6)) P2 (polar P1 0.0 (* D2 8.5)) P3 (polar EP 0.0 (* D2 8.5)) P4 (polar SP YA D2) P5 (polar RP YA D2) P6 (polar P4 YA D2) P7 (polar P5 YA D2) P8 (polar RP YA (* D2 6)) P9 (polar P2 YA D2) PX (polar P8 YA D2) PY (polar P9 YA D2) PZ (polar PX YA D2) S1 (polar P1 (* pi 0.25) D2) S2 (polar S1 (* pi 0.3) (* D3 0.172)) S3 (polar S1 (* pi 0.7) (* D3 0.172)) S4 (polar S1 YA (* D3 0.43952)) S5 (polar S1 (* pi 0.25) D2) S6 (polar P3 (* pi 1.25) D4) ) ;_ end of setq (command ".BLIPMODE" "OFF" ".FILL" "ON" ".ZOOM" "W" XZ YZ ".LAYER" "N" "BLUE" "C" "5" "BLUE" "S" "BLUE" "" ".SOLID" P1 P2 EP P3 "" ".LAYER" "N" "RED" "C" "1" "RED" "S" "RED" "" ".SOLID" SP P4 RP P5 "" ".ARRAY" "L" "" "R" "3" "1" (* D2 2) ".SOLID" P2 P9 P8 PX "" ".ARRAY" "L" "" "R" "4" "1" (* D2 2) ".LAYER" "N" "WHITE" "C" "7" "WHITE" "S" "WHITE" "" ".SOLID" P4 P6 P5 P7 "" ".ARRAY" "L" "" "R" "3" "1" (* D2 2) ".SOLID" P9 PY PX PZ "" ".ARRAY" "L" "" "R" "3" "1" (* D2 2) ".SOLID" S1 S2 S3 S4 "" ".ARRAY" "L" "" "P" S1 "5" "360" "Y" ".ARRAY" "W" P1 S5 "" "R" "5" "6" D4 D4 ".COPY" "W" P1 S6 "" S1 S5 ) ;_ end of command (setvar "CMDECHO" CE) (setvar "BLIPMODE" BM) (setvar "OSMODE" OM) (setq *ERROR* OE OE NIL ) ;_ end of setq (princ) ) ;_ end of defun