;;;Lisp function: (huandx) ;;; and other supporting lisp subroutines are included in this file. ;;; ;;; (huandx) Creates/Updates HUANDX.TXT - a sorted index of project ;;; drawing names, sheet nos., titles, and area info for viewports. ;;; This information is used by the commands below. ;;; ;;;Requirements: ;;; Block named *TTBAT. It can be ;;; customized but it must contain all attributes in the original ;;; HUATTBAT and be named as indicated. Unneeded attributes can be ;;; left blank or "parked" outside the sheet area. Attributes are ;;; for Title block fill-in. Only drawings containing one of these ;;; blocks are considered to be sheets in the project document set. ;;; ;;;Commands: Shtndx, Shtbnd, Viewsht, Esbnd, Bproj ;;; ;;;Use SHTNDX to create a complete drawing index from CDMNDX.TXT. ;;;Use SHTBND to create sheet number labels and rectangles outlining all ;;; viewport areas for all sheets. ;;;Use VIEWSHT to zoom to any viewport area of any sheet. Examine ;;; coordinate values to help select plan, profile or detail views. ;;;Use BPROJ to automatically compile the ordered list of project sheets ;;; for plotting and start BPLOT ready to plot them all. ;;; ;;;CDMNDX.TXT Notes: ;;; ;;; Use EDTXT to open HUANDX.TXT in Notepad. Open HUANDX.TXT to ;;; view drawing names and their associated sheet numbers (a very ;;; handy reference). ;;; ;;; HUANDX should be manually sorted after new sheets are added. ;;; Once the list is complete and has been sorted it will not need ;;; sorting again. ;;; ;;; Do not use word wrap! Sheet info must occupy only one line in ;;; the file. ;;; ;;; Sheets that belong to the project but are kept elsewhere can ;;; be manually added (vport info may be omitted) so SHTNDX will ;;; produce the complete sheet index. ;;; ;;; Add BOGUS drawing names and titles to provide section headings ;;; such as CIVIL, MECHANICAL, STRUCTURAL, ELECTRICAL, etc. ;;; ;;;> Author: Henry C. Francis ;;;> 425 N. Ashe St. ;;;> Southern Pines, NC 28387 ;;;> http://paracadd.com ;;;> All rights reserved. ;;; ;;;> COPYRIGHT: 4-22-97 ;;;> EDITED: 07-11-2005 ;;; (DEFUN huandx (/ ;attlst ttl1ss iniblk inient nxtent dwg_# sht_# dsgnd drwn chkd dscale sub_by desdir;| ttl11 ttl13 ttl33 ttl14 ttl12 ttl22 ttl44 |;ndx_df rd_lin wf_lst datlst ttllst ) (SETQ ttl_exst nil) (IF (SETQ ttl1ss (SSGET "x" '((-4 . "") (-4 . "and>") ) ) ;_ end of ssget ) ;_ end of setq (PROGN (IF (> (SSLENGTH ttl1ss) 1) (PRINC "\nMore than one block with title attributes is in the drawing. " ) ;_ end of princ (PROGN ;;; (IF (EQ (dos_win) "WINNT") (SETQ dwg_name (GETVAR "dwgname")) ;;; (SETQ dwg_name (SUBSTR (GETVAR "dwgname") ;;; (- (STRLEN (GETVAR "dwgname")) 7) ;;; ) ;_ end of substr ;;; ) ;_ end of setq ;;; ) ;_ end of if (SETQ iniblk (SSNAME ttl1ss 0)) (SETQ inient (ENTGET iniblk)) (SETQ attlst nil) (SETQ nxtent (ENTGET (ENTNEXT iniblk))) (WHILE (/= (CDR (ASSOC 0 nxtent)) "SEQEND") (IF (EQ (CDR (ASSOC 0 nxtent)) "ATTRIB") (IF attlst (SETQ attlst (APPEND attlst (LIST (ASSOC 2 nxtent) (ASSOC 1 nxtent)) ) ;_ end of append ) ;_ end of setq (SETQ attlst (LIST (ASSOC 2 nxtent) (ASSOC 1 nxtent))) ) ;_ end of if ) ;_ end of if (SETQ nxtent (ENTGET (ENTNEXT (CDAR nxtent)))) ) ;while (IF attlst (PROGN (IF (OR (MEMBER (CONS 2 "SHT_NO.") attlst)(MEMBER (CONS 2 "XX") attlst)) (COND ((MEMBER (CONS 2 "SHT_NO.") attlst) (SETQ sht_# (CDADR (MEMBER (CONS 2 "SHT_NO.") attlst)))) ((MEMBER (CONS 2 "XX") attlst) (SETQ sht_# (CDADR (MEMBER (CONS 2 "XX") attlst)))) ) (SETQ sht_# "") ) ;_ end of if ) ;_ end of progn ) ;_ end of if (vpbnds) ) ;_ end of progn ) ;_ end of if (IF (MEMBER (CONS 2 "TITLE_1/4") attlst) (SETQ ttl_1/4 (CDADR (MEMBER (CONS 2 "TITLE_1/4") attlst))) (SETQ ttl_1/4 "") ) ;_ end of if (IF (OR (MEMBER (CONS 2 "TITLE_1/2") attlst)(MEMBER (CONS 2 "SHEET_TITLE_1") attlst)) (COND ((MEMBER (CONS 2 "TITLE_1/2") attlst) (SETQ ttl_1/2 (CDADR (MEMBER (CONS 2 "TITLE_1/2") attlst)))) ((MEMBER (CONS 2 "SHEET_TITLE_1") attlst) (SETQ ttl_1/2 (CDADR (MEMBER (CONS 2 "SHEET_TITLE_1") attlst)))) ) (SETQ ttl_1/2 "") ) ;_ end of if (IF (OR (MEMBER (CONS 2 "TITLE_2/2") attlst)(MEMBER (CONS 2 "SHEET_TITLE_2") attlst)) (COND ((MEMBER (CONS 2 "TITLE_2/2") attlst) (SETQ ttl_2/2 (CDADR (MEMBER (CONS 2 "TITLE_2/2") attlst)))) ((MEMBER (CONS 2 "SHEET_TITLE_2") attlst) (SETQ ttl_2/2 (CDADR (MEMBER (CONS 2 "SHEET_TITLE_2") attlst)))) ) (SETQ ttl_2/2 "") ) ;_ end of if (IF (MEMBER (CONS 2 "TITLE_4/4") attlst) (SETQ ttl_4/4 (CDADR (MEMBER (CONS 2 "TITLE_4/4") attlst))) (SETQ ttl_4/4 "") ) ;_ end of if (IF (MEMBER (CONS 2 "TITLE_1/5") attlst) (SETQ ttl_1/5 (CDADR (MEMBER (CONS 2 "TITLE_1/5") attlst))) (SETQ ttl_1/5 "") ) ;_ end of if (IF (MEMBER (CONS 2 "TITLE_1/3") attlst) (SETQ ttl_1/3 (CDADR (MEMBER (CONS 2 "TITLE_1/3") attlst))) (SETQ ttl_1/3 "") ) ;_ end of if (IF (MEMBER (CONS 2 "TITLE_1") attlst) (SETQ ttl_1 (CDADR (MEMBER (CONS 2 "TITLE_1") attlst))) (SETQ ttl_1 "") ) ;_ end of if (IF (MEMBER (CONS 2 "TITLE_3/3") attlst) (SETQ ttl_3/3 (CDADR (MEMBER (CONS 2 "TITLE_3/3") attlst))) (SETQ ttl_3/3 "") ) ;_ end of if (IF (MEMBER (CONS 2 "TITLE_5/5") attlst) (SETQ ttl_5/5 (CDADR (MEMBER (CONS 2 "TITLE_5/5") attlst))) (SETQ ttl_5/5 "") ) ;_ end of if (IF (AND ttl_1/5 (> (STRLEN ttl_1/5) 0) ttl_1 (> (STRLEN ttl_1) 0) ttl_1/3 (> (STRLEN ttl_1/3) 0) ttl_3/3 (> (STRLEN ttl_3/3) 0) ttl_5/5 (> (STRLEN ttl_5/5) 0) ) ;_ end of and (SETQ ttl (STRCAT dwg_name "\t" sht_# "\t" ttl_1/5 " " ttl_1/3 " " ttl_1 " " ttl_3/3 " " ttl_5/5 "\t" (IF bnd_lst bnd_lst "" ) ;_ end of if ) ;_ end of strcat ) ;_ end of setq (IF (AND ttl_1/3 (> (STRLEN ttl_1/3) 0) ttl_1 (> (STRLEN ttl_1) 0) ttl_3/3 (> (STRLEN ttl_3/3) 0) ) ;_ end of and (SETQ ttl (STRCAT dwg_name "\t" sht_# "\t" ttl_1/3 " " ttl_1 " " ttl_3/3 "\t" (IF bnd_lst bnd_lst "" ) ;_ end of if ) ;_ end of strcat ) ;_ end of setq (IF (AND ttl_1 (> (STRLEN ttl_1) 0)) (SETQ ttl (STRCAT dwg_name "\t" sht_# "\t" ttl_1 "\t" (IF bnd_lst bnd_lst "" ) ;_ end of if ) ;_ end of STRCAT ) ;_ end of SETQ (IF (AND ttl_1/4 (> (STRLEN ttl_1/4) 0) ttl_1/2 (> (STRLEN ttl_1/2) 0) ttl_2/2 (> (STRLEN ttl_2/2) 0) ttl_4/4 (> (STRLEN ttl_4/4) 0) ) ;_ end of and (SETQ ttl (STRCAT dwg_name "\t" sht_# "\t" ttl_1/4 " " ttl_1/2 " " ttl_2/2 " " ttl_4/4 "\t" (IF bnd_lst bnd_lst "" ) ;_ end of if ) ;_ end of strcat ) ;_ end of setq (IF (AND ttl_1/2 (> (STRLEN ttl_1/2) 0) ;;; ttl_2/2 ;;; (> (STRLEN ttl_2/2) 0) ) ;_ end of and (SETQ ttl (STRCAT dwg_name "\t" sht_# "\t" ttl_1/2 " " ttl_2/2 "\t" (IF bnd_lst bnd_lst "" ) ;_ end of if ) ;_ end of strcat ) ;_ end of setq (SETQ ttl nil) ) ;_ end of if ) ;_ end of if ) ;_ end of if ) ;_ end of if ) ;_ end of if (IF (AND (WCMATCH (GETVAR "DWGPREFIX") "*\\0CAD\\?*") (OR (WCMATCH (GETVAR "DWGPREFIX") "*\\0CAD\\CIV*") (WCMATCH (GETVAR "DWGPREFIX") "*\\0CAD\\SITE*") (WCMATCH (GETVAR "DWGPREFIX") "*\\0CAD\\ARCH*") (WCMATCH (GETVAR "DWGPREFIX") "*\\0CAD\\STRU*") (WCMATCH (GETVAR "DWGPREFIX") "*\\0CAD\\MECH*") (WCMATCH (GETVAR "DWGPREFIX") "*\\0CAD\\PLUM*") (WCMATCH (GETVAR "DWGPREFIX") "*\\0CAD\\HVAC*") (WCMATCH (GETVAR "DWGPREFIX") "*\\0CAD\\ELEC*") (WCMATCH (GETVAR "DWGPREFIX") "*\\0CAD\\INST*") (WCMATCH (GETVAR "DWGPREFIX") "*\\0CAD\\GRAPHICS\\") (WCMATCH (GETVAR "DWGPREFIX") "*\\0CAD\\XREF*") ) ;_ end of OR ) ;_ end of AND (PROGN (SETQ up1_dir (DOS_CHDIR (STRCAT (GETVAR "DWGPREFIX") "..\\")) ) ;_ end of SETQ (WHILE (NOT (WCMATCH up1_dir "*\\0CAD\\")) (SETQ up1_dir (DOS_CHDIR (STRCAT up1_dir "..\\"))) ) ;_ end of WHILE (SETQ cdmndx_dir up1_dir) ) ;_ end of PROGN (SETQ cdmndx_dir (GETVAR "DWGPREFIX")) ) ;_ end of IF (IF ttl (IF (FINDFILE (STRCAT cdmndx_dir "cdmndx.txt")) (PROGN (SETQ nxfile (OPEN (STRCAT cdmndx_dir "cdmndx.txt") "r" ) ;_ end of open nxlist nil ) ;_ end of setq (WHILE (SETQ nxrdln (READ-LINE nxfile)) (SETQ nxlist (APPEND nxlist (LIST nxrdln))) ) ;_ end of while (SETQ xnxlst nxlist) (CLOSE nxfile) (SETQ TTLCNT 1) (WHILE (AND (/= (STRCASE(SUBSTR TTL TTLCNT 4)) ".DWG") (<= TTLCNT (STRLEN TTL)) (<= TTLCNT 32) ) (SETQ TTLCNT (1+ TTLCNT)) ) (FOREACH n nxlist ;;; (COND ;;; ((EQ (SUBSTR ttl 9 1) ".") (IF (EQ (STRCASE (SUBSTR ttl 1 (1- TTLCNT))) (STRCASE (SUBSTR n 1 (1- TTLCNT)))) (SETQ nxlist (SUBST ttl n nxlist) ttl_exst T ) ;_ end of setq ) ;;; ) ;;; ((EQ (SUBSTR ttl 10 1) ".") ;;; (IF ;;; (EQ (STRCASE (SUBSTR ttl 1 9)) (STRCASE (SUBSTR n 1 9))) ;;; (SETQ nxlist (SUBST ttl n nxlist) ;;; ttl_exst T ;;; ) ;_ end of setq ;;; ) ;;; ) ;;; ) ) ;_ end of foreach (IF ttl_exst nil (SETQ nxlist (APPEND nxlist (LIST ttl))) ) ;_ end of if ;;; (IF (> (LENGTH nxlist) 1) ;;; (SETQ nxlist (ACAD_STRLSORT nxlist)) ;;; ) ;_ end of if (IF (EQ xnxlst nxlist) nil (PROGN (SETQ nxfile (OPEN (STRCAT cdmndx_dir "cdmndx.txt") "w" ) ;_ end of open ) ;_ end of setq (FOREACH n nxlist (WRITE-LINE n nxfile) ;;; (PRINC (STRCAT "\n" n "\n")) ) ;_ end of foreach (CLOSE nxfile) ) ;_ end of progn ) ;_ end of if (PRINC (STRCAT "\n Index file " cdmndx_dir "CDMNDX.TXT has been updated. \n" ) ;_ end of strcat ) ;_ end of princ ) ;_ end of progn (PROGN (SETQ nxfile (OPEN (STRCAT cdmndx_dir "cdmndx.txt") "w" ) ;_ end of open ) ;_ end of setq (WRITE-LINE ttl nxfile) (CLOSE nxfile) (PRINC (STRCAT "\n Index file " cdmndx_dir "CDMNDX.TXT has been created. \n" ) ;_ end of strcat ) ;_ end of princ ) ;_ end of progn ) ;_ end of if (PRINC) ) ;_ end of if ) ;_ end of progn (PRINC) ) ;_ end of if (SETQ oldatlst attlst) (PRINC) ) ;_ end of defun (DEFUN c:shtndx (/ tag_lst ndx_line red_line note_offd note_len new_len note_lst start_pt cbpt2 cbpt3 cbpt4 cnpt1 cnpt1a hdrpt1 hdrpt1a ttl_pt cnpt2 cnpt2a cnpt3 cnpt3a cnpt4 cnpt4a cnpt5 cnpt5a cnpt6 cnpt6a cnpt7 cnpt7a cnpt8 cnpt8a cnpt9 cnpt9a cnpt10 cnpt10a note_txt str_cnt str_offd ) (IF (AND ureal uint ustr ukword uangle udist) NIL (LOAD "uutils") ) ;_ end of IF (SETQ wraplen (uint 1 "" "Note word wrap length" (IF wraplen wraplen 50.0 ) ;_ end of if ) ;_ end of uint ) ;_ end of setq (IF getstyle NIL (LOAD "getstyle") ) ;_ end of IF (SETQ osmod (GETVAR "osmode")) (SETVAR "osmode" 0) (SETQ ;llt "-" colr "1" colra nil colri nil txht (GETVAR "textsize") numb 0 modf "NOTE" ) ;_ end of SETQ (IF gvpno nil (LOAD "gvpno") ) ;_ end of if (gvpno) (IF mjrg nil (SETQ mjrg "G") ) ;_ end of IF (IF txtsize nil (LOAD "txtsize" "\nFile TXTSIZE.LSP not found! ") ) ;_ end of if (txtsize nil) (getstyle "A") (SETQ colr lncolr) (c:svlayr) (SETQ start_pt (upoint 1 "" "Pick point for upper left corner of Index" nil nil ) ;_ end of upoint ) ;_ end of setq (SETQ col_wid 1) (SETQ cnpt1 (POLAR (POLAR start_pt (- 0 (GETVAR "viewtwist")) (* dimsc 0.4)) (- 0 (GETVAR "viewtwist") (* PI 0.5)) (+ (* dimsc 0.65) (* txtht 1 dimsc)) ) ;_ end of polar cnpt1a (POLAR cnpt1 (- 0 (GETVAR "viewtwist")) (* dimsc col_wid)) hdrpt1 (POLAR (POLAR start_pt (- 0 (GETVAR "viewtwist")) (* dimsc 0.4)) (- 0 (GETVAR "viewtwist") (* PI 0.5)) (* dimsc 0.43) ) ;_ end of polar hdrpt1a (POLAR hdrpt1 (- 0 (GETVAR "viewtwist")) (* dimsc col_wid)) ) ;_ end of setq (SETQ note_ofil (OPEN (STRCAT (GETVAR "dwgprefix") "CDMNDX.TXT") "r")) (WHILE ; (and (SETQ ndx_line (READ-LINE note_ofil)) (WHILE (AND (/= (SUBSTR ndx_line 1 1) "\t") (/= (SUBSTR ndx_line 1 1) "\\") ) ;_ end of and (SETQ ndx_line (SUBSTR ndx_line 2)) ) ;_ end of while (SETQ strstep 2) (WHILE (AND (/= (SUBSTR ndx_line strstep 1) "\t") (/= (SUBSTR ndx_line strstep 1) "\\") ) ;_ end of and (SETQ strstep (1+ strstep)) ) ;_ end of while (SETQ vpstep (1+ strstep)) (IF (OR (WCMATCH (SUBSTR ndx_line vpstep) "*\t*" ) ;_ end of wcmatch (WCMATCH (SUBSTR ndx_line vpstep) "*\\*" ) ;_ end of wcmatch ) ;_ end of or (PROGN (WHILE (AND (/= (SUBSTR ndx_line vpstep 1) "\t") (/= (SUBSTR ndx_line vpstep 1) "\\") ) ;_ end of and (SETQ vpstep (1+ vpstep) ) ;_ end of setq ) ;_ end of while (SETQ sht_no (STRCASE (SUBSTR ndx_line 2 (- strstep 2))) vp_line (SUBSTR ndx_line (1+ vpstep)) ndx_line (STRCASE (SUBSTR ndx_line (1+ strstep) (- vpstep strstep 1)) ) ;_ end of strcase ) ;_ end of setq ) ;_ end of progn (SETQ sht_no (STRCASE (SUBSTR ndx_line 2 (- strstep 2))) ndx_line (STRCASE (SUBSTR ndx_line (1+ strstep))) ) ;_ end of setq ) ;_ end of if (IF note_lst (SETQ note_lst (APPEND note_lst (LIST (CONS sht_no ndx_line)) ) ;_ end of append ) ;_ end of setq (SETQ note_lst (LIST (CONS sht_no ndx_line))) ) ;_ end of if ) ;_ end of while (IF note_ofil (PROGN (CLOSE note_ofil) (SETQ cnt 1) (SETQ llt "-" colr txcolr modf "NOTE" ) ;_ end of setq (c:mklayr) (COMMAND ".text" "j" "mc" hdrpt1 (* txtht dimsc) (* (/ (- 0 (GETVAR "viewtwist")) PI) 180) "SHEET NO." ) ;_ end of command (COMMAND ".text" "j" "ml" hdrpt1a (* txtht dimsc) (* (/ (- 0 (GETVAR "viewtwist")) PI) 180) "TITLE" ) ;_ end of command (SETQ cnt 2 ) ;_ end of setq (FOREACH n note_lst (SET (READ (STRCAT "cnpt" (ITOA cnt))) (POLAR (EVAL (READ (STRCAT "cnpt" (ITOA (1- cnt))))) (- 0 (GETVAR "viewtwist") (* PI 0.5)) (* dimsc 0.22) ) ;_ end of polar ) ;_ end of set (SET (READ (STRCAT "cnpt" (ITOA cnt) "a")) (POLAR (EVAL (READ (STRCAT "cnpt" (ITOA (1- cnt)) "a"))) (- 0 (GETVAR "viewtwist") (* PI 0.5)) (* dimsc 0.22) ) ;_ end of polar ) ;_ end of set (SETQ cnt (1+ cnt) ) ;_ end of setq ) ;_ end of foreach (SETQ cnt 1) (FOREACH n note_lst (COMMAND ".text" "j" "ml" (POLAR (LIST (CAR (EVAL (READ (STRCAT "cnpt" (ITOA cnt))))) (CADR (EVAL (READ (STRCAT "cnpt" (ITOA cnt))))) 0 ) ;_ end of list (- 0 (GETVAR "viewtwist") (* PI 0.5)) (IF note_offd note_offd 0 ) ;_ end of if ) ;_ end of polar (* txtht dimsc) (* (/ (- 0 (GETVAR "viewtwist")) PI) 180) (CAR n) ) ;_ end of command (SETQ note_txt (CDR n)) (IF abrkstr NIL (LOAD "abrkstr" "\nFile ABRKSTR.LSP not loaded! ")) (abrkstr note_txt wraplen) (SETQ str_cnt 1) (REPEAT var_indx (SETQ str_offd (* (1- str_cnt) (* 1.5 txtht dimsc))) (COMMAND ".text" "j" "ml" (POLAR (EVAL (READ (STRCAT "cnpt" (ITOA cnt) "a"))) (- 0 (GETVAR "viewtwist") (* PI 0.5)) (IF note_offd (+ note_offd str_offd) str_offd ) ;_ end of if ) ;_ end of polar (* txtht dimsc) (* (/ (- 0 (GETVAR "viewtwist")) PI) 180) (EVAL (READ (STRCAT "typ_t" (ITOA str_cnt)))) ) ;_ end of command (SETQ str_cnt (1+ str_cnt)) (IF note_len (IF (> (SETQ new_len (DISTANCE (CAR (TEXTBOX (ENTGET (ENTLAST)))) (CADR (TEXTBOX (ENTGET (ENTLAST)))) ) ;_ end of DISTANCE ) ;_ end of setq note_len ) ;_ end of > (SETQ note_len new_len) ) ;_ end of if (SETQ note_len (DISTANCE (CAR (TEXTBOX (ENTGET (ENTLAST)))) (CADR (TEXTBOX (ENTGET (ENTLAST)))) ) ;_ end of DISTANCE ) ;_ end of setq ) ;_ end of if ) ;_ end of repeat (IF note_offd (SETQ note_offd (+ note_offd (* 1 txtht dimsc))) (SETQ note_offd (* 1 txtht dimsc)) ) ;_ end of if (IF note_offd (SETQ note_offd (+ note_offd str_offd)) ;(* dimsc 0.22) (SETQ note_offd str_offd) ;(+ (* dimsc 0.22) ) ;_ end of if (SETQ cnt (1+ cnt) box_botm (POLAR (CDR (ASSOC 10 (ENTGET (ENTLAST)))) (- 0 (GETVAR "viewtwist") (* PI 0.5)) (* dimsc txtht 1.5) ) ;_ end of polar ) ;_ end of setq ) ;_ end of foreach (SETQ cbpt2 (POLAR start_pt (- 0 (GETVAR "viewtwist")) (+ (* dimsc 1.5875) note_len) ) ;_ end of polar tmp_pt1 (POLAR cbpt2 (- 0 (GETVAR "viewtwist") (* PI 0.5)) 10) tmp_pt2 (POLAR box_botm (- 0 (GETVAR "viewtwist")) 10) cbpt3 (INTERS cbpt2 tmp_pt1 box_botm tmp_pt2 nil) cbpt4 (POLAR cbpt3 (ANGLE cbpt2 start_pt) (+ (* dimsc 1.5875) note_len) ) ;_ end of polar ttl_pt (POLAR (POLAR start_pt (- 0 (GETVAR "viewtwist")) (/ (DISTANCE start_pt cbpt2) 2) ) ;_ end of polar (- 0 (GETVAR "viewtwist") (* PI 0.5)) 0 ) ;_ end of polar ) ;_ end of setq (SETQ colr "6") (c:mklayr) (COMMAND ".text" "j" "c" ttl_pt (* 0.2 dimsc) (* (/ (- 0 (GETVAR "viewtwist")) PI) 180) "INDEX OF DRAWINGS" ) ;_ end of command ) ;_ end of progn (PRINC (STRCAT "\nRequired file " (GETVAR "dwgprefix") "CDMNDX.TXT not found! " ) ;_ end of strcat ) ;_ end of princ ) ;_ end of if (c:rslayr) (clr_txt) (PRINC) ) ;_ end of defun ;;;(DEFUN abrkstr (note wrap /) ;;; (PROGN ;;; (SETQ chr_indx 1 ;;; var_indx 1 ;;; ) ;_ end of setq ;;; (SETQ nxt_char (SUBSTR note chr_indx 1)) ;;; (WHILE (AND (NOT note_done) (NOT (EQ "" note))) ;;; (IF (EQ nxt_char " ") ;if breakpoint ;;; (PROGN ;;; (IF lst_break ;;; (SETQ fst_break lst_break) ;;; ) ;_ end of if ;;; (SETQ lst_break chr_indx) ;;; ) ;_ end of progn ;;; ) ;_ end of if ;;; (IF (EQ nxt_char "") ;if endpoint ;;; (PROGN ;;; (IF lst_break ;;; (SETQ fst_break lst_break) ;;; ) ;_ end of if ;;; (SETQ lst_break chr_indx ;;; done_note T ;;; ) ;_ end of setq ;;; ) ;_ end of progn ;;; ) ;_ end of if ;;; (COND ;;; ((> lst_break wrap) ;;; (SET (READ (STRCAT "typ_t" (ITOA var_indx))) ;;; (SUBSTR note 1 (1- fst_break)) ;;; ) ;_ end of set ;;; (SETQ note (SUBSTR note (1+ fst_break)) ;;; chr_indx 1 ;;; var_indx (1+ var_indx) ;;; fst_break nil ;;; lst_break nil ;;; nxt_char (SUBSTR note 1 1) ;;; ) ;_ end of setq ;;; ) ;;; ((EQ lst_break wrap) ;if 2nd break = wrap length ;;; (SET (READ (STRCAT "typ_t" (ITOA var_indx))) ;;; (SUBSTR note 1 (1- lst_break)) ;;; ) ;_ end of set ;;; (IF (> (STRLEN note) wrap) ;;; (SETQ note (SUBSTR note (1+ lst_break)) ;;; chr_indx 1 ;;; var_indx (1+ var_indx) ;;; fst_break nil ;;; lst_break nil ;;; nxt_char (SUBSTR note 1 1) ;;; ) ;_ end of setq ;;; (SETQ nxt_char "" ;;; note_done T ;;; ) ;_ end of setq ;;; ) ;_ end of if ;;; ) ;;; ((<= (STRLEN note) wrap) ;;; (SET (READ (STRCAT "typ_t" (ITOA var_indx))) ;;; note ;;; ) ;_ end of set ;;; (SETQ ;;; nxt_char ;;; "" ;;; note_done ;;; T ;;; ) ;_ end of setq ;;; ) ;_ end of cond ;;; ) ;_ end of cond ;;; (SETQ chr_indx (1+ chr_indx) ;;; nxt_char (SUBSTR note chr_indx 1) ;;; ) ;_ end of setq ;;; ) ;_ end of while ;;; (IF note_done ;;; (SETQ note_done nil) ;;; (PROGN ;;; (SET (READ (STRCAT "typ_t" (ITOA var_indx))) ;;; note ;;; ) ;_ end of set ;;; ) ;_ end of progn ;;; ) ;_ end of if ;;; ) ;_ end of progn ;;;) ;_ end of defun (DEFUN clr_txt () (SETQ typ_t1 nil typ_t2 nil typ_t3 nil typ_t4 nil typ_t5 nil typ_t6 nil typ_t7 nil typ_t8 nil typ_t9 nil typ_t10 nil fst_break nil lst_break nil ) ;_ end of setq ) ;_ end of defun (LOAD "SHTBND" "\nFile SHTBND.LSP not found! ") ;;;Loading SHTBND defuns C:SHTBND, C:VIEWSHT, and C:ESBND (DEFUN vpbnds () (IF (AND (= (GETVAR "cvport") 1) (EQ (GETVAR "tilemode") 0)) (PROGN (SETQ do_zoomp T) (COMMAND ".zoom" "w" (GETVAR "extmin") (GETVAR "extmax")) (COMMAND ".mspace") ) ;_ end of progn (PROGN (SETQ do_zoomp T) (COMMAND ".pspace") (COMMAND ".zoom" "w" (GETVAR "extmin") (GETVAR "extmax")) (COMMAND ".mspace") ) ;_ end of progn ) ;_ end of if (SETQ vportss (SSGET "x" '((0 . "VIEWPORT")))) (SETQ vpsslen (SSLENGTH vportss)) (SETQ cnt 0) (SETQ vpdatlst nil bnd_lst nil ) ;_ end of setq (WHILE (< cnt vpsslen) (SETQ vpdat (ENTGET (SSNAME vportss cnt))) (IF (AND (/= (CDR (ASSOC 8 vpdat)) "0") (NOT (WCMATCH (CDR (ASSOC 8 vpdat)) "*vi00*")) (> (CDR (ASSOC 68 vpdat)) 0) ) ;_ end of and (SETQ vpdatlst (APPEND (LIST (CONS (READ (SUBSTR (CDR (ASSOC 8 vpdat)) 5 2)) (CDR (ASSOC 69 vpdat)) ) ;_ end of cons ) ;_ end of list vpdatlst ) ;_ end of append ) ;_ end of setq ) ;_ end of if (SETQ cnt (1+ cnt)) ) ;_ end of while ; (if (< (length vpdatlst) 7) (FOREACH n vpdatlst (SETVAR "cvport" (CDR n)) (SETQ cvputw (- (* PI 2) (GETVAR "viewtwist"))) ;;; (REGAPP "ACAD") (SETQ cvpss (SSGET "X" (LIST (CONS 69 (CDR n))))) (SETQ cvpent (ENTGET (SSNAME cvpss 0) (LIST "ACAD"))) (SETQ cvpvno (ATOI (SUBSTR (CDR (ASSOC 8 cvpent)) 5 2))) (SETQ cvphgt (GETVAR "viewsize")) (SETQ cvpctr (GETVAR "viewctr")) (SETQ cvpa40 (CDR (ASSOC 40 cvpent))) (SETQ cvpa41 (CDR (ASSOC 41 cvpent))) (SETQ cvpwid (* (/ cvpa40 cvpa41) cvphgt)) ; (setq xvdata (cadr(assoc -3 cvpent))) (SETQ pt1 (POLAR (POLAR cvpctr cvputw (/ cvpwid 2)) (- cvputw (/ PI 2)) (/ cvphgt 2) ) ;_ end of polar pt2 (POLAR pt1 (+ cvputw (/ PI 2)) cvphgt) pt3 (POLAR pt2 (+ cvputw PI) cvpwid) pt4 (POLAR pt3 (- cvputw (/ PI 2)) cvphgt) ) ;_ end of setq (IF bnd_lst (SETQ bnd_lst (STRCAT bnd_lst (CHR 40) "\"" sht_# "\"" (CHR 40) (RTOS (CAR pt1) 2 2) " " (RTOS (CADR pt1) 2 2) (CHR 41) (CHR 40) (RTOS (CAR pt2) 2 2) " " (RTOS (CADR pt2) 2 2) (CHR 41) (CHR 40) (RTOS (CAR pt3) 2 2) " " (RTOS (CADR pt3) 2 2) (CHR 41) (CHR 40) (RTOS (CAR pt4) 2 2) " " (RTOS (CADR pt4) 2 2) (CHR 41) (CHR 41) ) ;_ end of strcat ) ;_ end of setq (SETQ bnd_lst (STRCAT (CHR 40) "\"" sht_# "\"" (CHR 40) (RTOS (CAR pt1) 2 2) " " (RTOS (CADR pt1) 2 2) (CHR 41) (CHR 40) (RTOS (CAR pt2) 2 2) " " (RTOS (CADR pt2) 2 2) (CHR 41) (CHR 40) (RTOS (CAR pt3) 2 2) " " (RTOS (CADR pt3) 2 2) (CHR 41) (CHR 40) (RTOS (CAR pt4) 2 2) " " (RTOS (CADR pt4) 2 2) (CHR 41) (CHR 41) ) ;_ end of strcat ) ;_ end of setq ) ;_ end of if ) ;_ end of foreach ; ) ;_ end of if (IF bnd_lst (SETQ bnd_lst (STRCAT (CHR 40) bnd_lst (CHR 41))) ) ;_ end of if (COMMAND ".pspace") (IF do_zoomp (COMMAND ".zoom" "p") ) ;_ end of if ) ;_ end of defun ;|«Visual LISP© Format Options» (72 2 40 2 T "end of " 60 9 2 0 0 T T nil T) ***Don't add text below the comment!***|;