;;;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.; ;;; (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. ;;; ;;;> 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 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 (setq var_indx 3) (setq typ_t1 (cdr n)) (setq typ_t2 (cdr n)) (setq typ_t3 (cdr n)) ; (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.0875 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) (princ) ) ;_ end of defun ;|«Visual LISP© Format Options» (72 2 40 2 T "end of " 60 9 1 0 0 T T nil T) ***Don't add text below the comment!***|;