;;;Formats and places individualized construction notes. ;;; ;;;Requirements: ;;; (A) Insert(s) of a block named B_TAG w/ one ATTRIB who's value is a no. ;;; both CNL.LSP and CNTAG.LSP insert this block.; ;;; (B) Text file named CONOTE.TXT with ALL of the construction notes. ;;; 1st line of file contains a number, ;;; 2nd line of file contains that number's note, ;;; 3rd line of file contains another number, ;;; 4th line of file contains that number's note, ;;; etc. ;;; ;;; Use only one line for each entire note text. Line wrapping is ;;; handled by the program. ;;; ;;;> Author: Henry C. Francis ;;;> 425 N. Ashe St. ;;;> Southern Pines, NC 28387 ;;;> http://paracadd.com ;;;> All rights reserved. ;;; ;;;> COPYRIGHT: 8-31-98 ;;;> EDITED: 10-06-2005 ;;; (DEFUN c:conote (/ 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 ) (SETQ oldattreq (GETVAR "attreq") oldosmode (GETVAR "osmode") ) ;_ end of setq (SETVAR "attreq" 1) (SETVAR "osmode" 0) (SETQ wraplen (uint 1 "" "Note word wrap length" (IF wraplen wraplen 50.0 ) ;_ end of if ) ;_ end of uint ) ;_ end of setq (IF dimscl nil (LOAD "dimscl") ) ;_ end of if (dimscl) (IF c:mklayr nil (LOAD "mklayr") ) ;_ end of if (c:svlayr) (SETQ tagss (SSGET '((-4 . "")) ) ;_ end of ssget ) ;_ end of setq (SETQ cnt 0 tagsslen (SSLENGTH tagss) ) ;_ end of setq (WHILE (< cnt tagsslen) (SETQ tag_data (ENTGET (SSNAME tagss cnt))) (WHILE (/= (CDR (ASSOC 0 tag_data)) "ATTRIB") (SETQ tag_data (ENTGET (ENTNEXT (CDR (ASSOC -1 tag_data))))) ) ;_ end of while (IF (EQ (STRLEN (CDR (ASSOC 1 tag_data))) 1) (SETQ tag_no (STRCAT "0" (CDR (ASSOC 1 tag_data)))) (SETQ tag_no (CDR (ASSOC 1 tag_data))) ) ;_ end of if (IF tag_lst (IF (MEMBER tag_no tag_lst) nil (SETQ tag_lst (APPEND tag_lst (LIST tag_no))) ) ;_ end of if (SETQ tag_lst (LIST tag_no)) ) ;_ end of if (SETQ cnt (1+ cnt)) ) ;_ end of while (SETQ tag_lst (ACAD_STRLSORT tag_lst)) (SETQ tag_lst (MAPCAR 'ITOA (MAPCAR 'ATOI tag_lst))) (SETQ start_pt (upoint 1 "" "Pick point for upper left corner of Construction Notes" nil nil ) ;_ end of upoint ) ;_ end of setq (SETQ cnpt1 (POLAR (POLAR start_pt (- 0 (GETVAR "viewtwist")) (* dimsc 0.4)) (- 0 (GETVAR "viewtwist") (* PI 0.5)) (* dimsc 0.65) ) ;_ end of polar cnpt1a (POLAR cnpt1 (- 0 (GETVAR "viewtwist")) (* dimsc 0.5375)) 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 0.5375)) ) ;_ end of setq (SETQ cnt 2) (FOREACH n tag_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 foreach (SETQ note_ofil (OPEN (STRCAT (GETVAR "dwgprefix") "CONOTE.TXT") "r")) (WHILE (AND (SETQ ndx_line (READ-LINE note_ofil)) (SETQ red_line (READ-LINE note_ofil)) ) ;_ end of and (IF (MEMBER ndx_line tag_lst) (IF note_lst (SETQ note_lst (APPEND note_lst (LIST (CONS (ATOI ndx_line) (STRCASE red_line))) ) ;_ end of append ) ;_ end of setq (SETQ note_lst (LIST (CONS (ATOI ndx_line) (STRCASE red_line)))) ) ;_ end of if ) ;_ end of if ) ;_ end of while (IF note_ofil (PROGN (CLOSE note_ofil) (SETQ cnt 1) (SETQ llt "-" colr "2" modf "NOTE" ) ;_ end of setq (c:mklayr) (COMMAND ".text" "j" "mc" hdrpt1 (* 0.110 dimsc) (* (/ (- 0 (GETVAR "viewtwist")) PI) 180) "ITEM NO." ) ;_ end of command (COMMAND ".text" "j" "ml" hdrpt1a (* 0.110 dimsc) (* (/ (- 0 (GETVAR "viewtwist")) PI) 180) "DESCRIPTION" ) ;_ end of command (FOREACH n note_lst (COMMAND ".insert" "b_tag" (POLAR (LIST (CAR (EVAL (READ (STRCAT "cnpt" (ITOA cnt))))) (CADR (EVAL (READ (STRCAT "cnpt" (ITOA cnt))))) (* dimsc 1002.5) ) ;_ end of list (- 0 (GETVAR "viewtwist") (* PI 0.5)) (IF note_offd note_offd 0 ) ;_ end of if ) ;_ end of polar dimsc dimsc (* (/ (- 0 (GETVAR "viewtwist")) PI) 180) (CAR n) ) ;_ end of command (SETQ note_txt (CDR n)) (IF abrkstr nil (LOAD "abrkstr") ) ;_ end of if (abrkstr note_txt wraplen) (SETQ str_cnt 1) (REPEAT var_indx (SETQ str_offd (* (1- str_cnt) (* 1.5 0.125 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 (* 0.110 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 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 0.125 1.5) ) ;_ end of polar ) ;_ end of setq ) ;_ end of foreach (SETQ cbpt2 (POLAR start_pt (- 0 (GETVAR "viewtwist")) (+ (* dimsc 1.0875) 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.0875) 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.2 dimsc) ) ;_ end of polar ) ;_ end of setq (SETQ colr "4") (c:mklayr) (COMMAND ".text" "j" "mc" ttl_pt (* 0.140 dimsc) (* (/ (- 0 (GETVAR "viewtwist")) PI) 180) "%%uCONSTRUCTION NOTES" ) ;_ end of command (SETQ colr "6") (c:mklayr) (COMMAND ".pline" (LIST (CAR start_pt) (CADR start_pt) (* dimsc 1001)) (LIST (CAR cbpt2) (CADR cbpt2) (* dimsc 1001)) (LIST (CAR cbpt3) (CADR cbpt3) (* dimsc 1001)) (LIST (CAR cbpt4) (CADR cbpt4) (* dimsc 1001)) "c" ) ;_ end of command (SETQ colr "1" modf "NPLT" ) ;_ end of setq (c:mklayr) (COMMAND ".3dface" (LIST (CAR start_pt) (CADR start_pt) (* dimsc 1000)) (LIST (CAR cbpt2) (CADR cbpt2) (* dimsc 1000)) (LIST (CAR cbpt3) (CADR cbpt3) (* dimsc 1000)) (LIST (CAR cbpt4) (CADR cbpt4) (* dimsc 1000)) "" ) ;_ end of command ) ;_ end of progn (PRINC (STRCAT "\nRequired file " (GETVAR "dwgprefix") "CONOTE.TXT not found! " ) ;_ end of strcat ) ;_ end of princ ) ;_ end of if (c:rslayr) (clr_txt) (SETVAR "attreq" oldattreq) (SETVAR "osmode" oldosmode) (PRINC) ) ;_ 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!***|;