;;; ;;; ;;;> Author: Henry C. Francis ;;;> 425 N. Ashe St. ;;;> Southern Pines, NC 28387 ;;;> http://paracadd.com ;;;> All rights reserved. ;;; ;;;> COPYRIGHT: 3-14-97 ;;;> EDITED: 05-10-2004 ;;; (defun c:lstbl ( / str_list tset sslen count dimsc tent tstr tbl_tl tbl_tr tbl_bl tbl_br y_val ttl_pt hll_0 hlr_0 hll_1 hlr_1 lbl_ml lbl_1 lbl_2 lbl_3 lbl_4 lbl_5 vlt_1 vlt_2 vlt_3 vlt_4 vlb_1 vlb_2 vlb_3 vlb_4) (setvar "cmdecho" 0) (setq tset (ssget '((0 . "TEXT"))) sslen (sslength tset) count 0 dimsc (getvar"dimscale")) (if txtht nil (SETQ txtht (* 0.110 dimsc)) ) (setq col1_hd (list(cons 0 "TEXT")(cons 1 "Qty:")(cons 40 txtht))) (setq col2_hd (list(cons 0 "TEXT")(cons 1 "Common Name")(cons 40 txtht))) (setq col3_hd (list(cons 0 "TEXT")(cons 1 "Plant Type")(cons 40 txtht))) (setq col4_hd (list(cons 0 "TEXT")(cons 1 "Growing Habit")(cons 40 txtht))) (setq col5_hd (list(cons 0 "TEXT")(cons 1 "Height")(cons 40 txtht))) (setq col1_wid (+ (distance(car(textbox col1_hd))(cadr(textbox col1_hd))) (* 2.0 txtht) ) ) (setq col2_wid (+ (distance(car(textbox col2_hd))(cadr(textbox col2_hd))) (* 2.0 txtht) ) ) (setq col3_wid (+ (distance(car(textbox col3_hd))(cadr(textbox col3_hd))) (* 2.0 txtht) ) ) (setq col4_wid (+ (distance(car(textbox col4_hd))(cadr(textbox col4_hd))) (* 2.0 txtht) ) ) (setq col5_wid (+ (distance(car(textbox col5_hd))(cadr(textbox col5_hd))) (* 2.0 txtht) ) ) (while (not(>= count sslen)) (setq tname (ssname tset count)) (setq tent (entget tname (list "PLANTING_NOTE"))) (setq xtent (cadr(assoc -3(entget (cdar tent) (list "planting_note"))))) (setq tstr (cdr(assoc 1 tent))) (if (wcmatch tstr "(#) *") (if str_list (setq str_list (append str_list (list (list (setq col1_txt (substr tstr 1 3)) (setq col2_txt (substr tstr 5)) (setq col3_txt (cdr(nth 2 xtent))) (setq col4_txt (cdr(nth 3 xtent))) (setq col5_txt (cdr(nth 4 xtent))) ) ) ) ) (setq str_list (list (list (setq col1_txt (substr tstr 1 3)) (setq col2_txt (substr tstr 5)) (setq col3_txt (cdr(nth 2 xtent))) (setq col4_txt (cdr(nth 3 xtent))) (setq col5_txt (cdr(nth 4 xtent))) ) ) ) );if (if (wcmatch tstr "(##) *") (if str_list (setq str_list (append str_list (list (list (setq col1_txt (substr tstr 1 4)) (setq col2_txt (substr tstr 6)) (setq col3_txt (cdr(nth 2 xtent))) (setq col4_txt (cdr(nth 3 xtent))) (setq col5_txt (cdr(nth 4 xtent))) ) ) ) ) (setq str_list (list (list (setq col1_txt (substr tstr 1 4)) (setq col2_txt (substr tstr 6)) (setq col3_txt (cdr(nth 2 xtent))) (setq col4_txt (cdr(nth 3 xtent))) (setq col5_txt (cdr(nth 4 xtent))) ) ) ) ) );if );if (setq col1_txt (list(cons 0 "TEXT")(cons 1 col1_txt)(cons 40 txtht))) (setq col2_txt (list(cons 0 "TEXT")(cons 1 col2_txt)(cons 40 txtht))) (setq col3_txt (list(cons 0 "TEXT")(cons 1 col3_txt)(cons 40 txtht))) (setq col4_txt (list(cons 0 "TEXT")(cons 1 col4_txt)(cons 40 txtht))) (setq col5_txt (list(cons 0 "TEXT")(cons 1 col5_txt)(cons 40 txtht))) (if (> (setq n1_wid (+ (distance(car(textbox col1_txt))(cadr(textbox col1_txt))) (* 2.0 txtht) ) ) col1_wid ) (setq col1_wid n1_wid) ) (if (> (setq n2_wid (+ (distance(car(textbox col2_txt))(cadr(textbox col2_txt))) (* 2.0 txtht) ) ) col2_wid ) (setq col2_wid n2_wid) ) (if (> (setq n3_wid (+ (distance(car(textbox col3_txt))(cadr(textbox col3_txt))) (* 2.0 txtht) ) ) col3_wid ) (setq col3_wid n3_wid) ) (if (> (setq n4_wid (+ (distance(car(textbox col4_txt))(cadr(textbox col4_txt))) (* 2.0 txtht) ) ) col4_wid ) (setq col4_wid n4_wid) ) (if (> (setq n5_wid (+ (distance(car(textbox col5_txt))(cadr(textbox col5_txt))) (* 2.0 txtht) ) ) col5_wid ) (setq col5_wid n5_wid) ) (setq count (1+ count)) );while (setq tbl_tl (upoint 1 "" "Top left corner of Table" nil nil) ; tbl_tr (polar tbl_tl 0 (* txtht 60)) tbl_tr (polar tbl_tl 0 (+ col1_wid col2_wid col3_wid col4_wid col5_wid)) tbl_bl (polar tbl_tl (* pi 1.5)(* txtht 2.0 (+(length str_list)3))) y_val (cadr tbl_bl) ; tbl_br (polar tbl_bl 0 (* txtht 60)) tbl_br (polar tbl_bl 0 (+ col1_wid col2_wid col3_wid col4_wid col5_wid)) ; ttl_pt (polar(polar tbl_tl 0 (* txtht 30))(* pi 1.5)(* txtht 2.0)) ttl_pt (polar (polar tbl_tl 0 (/(+ col1_wid col2_wid col3_wid col4_wid col5_wid)2)) (* pi 1.5)(* txtht 2.0) ) hll_0 (polar tbl_tl (* pi 1.5)(* txtht 2.0 2)) ; hlr_0 (polar hll_0 0 (* txtht 60)) hlr_0 (polar hll_0 0 (+ col1_wid col2_wid col3_wid col4_wid col5_wid)) lbl_ml (polar hll_0 (* pi 1.5)(* txtht 1.0)) lbl_1 (polar lbl_ml 0 (/ col1_wid 2)) lbl_2 (polar lbl_ml 0 (+ col1_wid (/ col2_wid 2))) lbl_3 (polar lbl_ml 0 (+ col1_wid col2_wid (/ col3_wid 2))) lbl_4 (polar lbl_ml 0 (+ col1_wid col2_wid col3_wid (/ col4_wid 2))) lbl_5 (polar lbl_ml 0 (+ col1_wid col2_wid col3_wid col4_wid (/ col5_wid 2))) hll_1 (polar tbl_tl (* pi 1.5)(* txtht 2.0 3)) hlr_1 (polar hll_1 0 (+ col1_wid col2_wid col3_wid col4_wid col5_wid)) count 2 ) (while (<= count (length str_list)) (set (read(strcat "hll_"(itoa count))) (polar hll_1 (* pi 1.5)(* txtht 2.0 (1- count)))) (setq count (1+ count)) ) (setq count 2) (while (<= count (length str_list)) (set (read(strcat "hlr_"(itoa count))) (polar hlr_1 (* pi 1.5)(* txtht 2.0 (1- count)))) (setq count (1+ count)) ) (load"mklayr") (c:svlayr) (setq count 2 mjrg "L" llt "-" colr "4" prod "TEXT" modf "SCHD" ) (c:mklayr) (setq vlt_1 (polar hll_0 0 col1_wid)) (setq vlt_2 (polar hll_0 0 (+ col1_wid col2_wid))) (setq vlt_3 (polar hll_0 0 (+ col1_wid col2_wid col3_wid))) (setq vlt_4 (polar hll_0 0 (+ col1_wid col2_wid col3_wid col4_wid))) (setq vlb_1 (list(car vlt_1) y_val (caddr vlt_1))) (setq vlb_2 (list(car vlt_2) y_val (caddr vlt_2))) (setq vlb_3 (list(car vlt_3) y_val (caddr vlt_3))) (setq vlb_4 (list(car vlt_4) y_val (caddr vlt_4))) (command ".text" "j" "mc" ttl_pt (* 0.175 dimsc) 0 "PLANTING TABLE") (command ".pline" tbl_tl tbl_tr tbl_br tbl_bl tbl_tl "c") (command ".line" hll_0 hlr_0 "") (command ".line" hll_1 hlr_1 "") (setq mjrg "L" llt "-" colr "6" prod "TEXT" modf "SCHD" ) (c:mklayr) (while (<= count (length str_list)) (command ".line" (eval(read(strcat "hll_"(itoa count))))(eval(read(strcat "hlr_"(itoa count))))"") (setq count (1+ count)) ) (command ".line" vlt_1 vlb_1 "") (command ".line" vlt_2 vlb_2 "") (command ".line" vlt_3 vlb_3 "") (command ".line" vlt_4 vlb_4 "") (command ".text" "j" "mc" lbl_1 txtht 0 "Qty:") (command ".text" "j" "mc" lbl_2 txtht 0 "Common Name") (command ".text" "j" "mc" lbl_3 txtht 0 "Plant Type") (command ".text" "j" "mc" lbl_4 txtht 0 "Growing Habit") (command ".text" "j" "mc" lbl_5 txtht 0 "Height") (setq count 1) (foreach n str_list (progn (setq tbl_t1 (nth 0 n) tbl_t2 (nth 1 n) tbl_t3 (nth 2 n) tbl_t4 (nth 3 n) tbl_t5 (nth 4 n) ) (setq lbl_ml (polar (eval(read(strcat "hll_"(itoa count))))(* pi 1.5)(* txtht 1.0)) lbl_1 (polar lbl_ml 0 (/ col1_wid 2)) ; lbl_2 (polar lbl_ml 0 (+ col1_wid (/ col2_wid 2))) lbl_2 (polar lbl_ml 0 (+ col1_wid (* txtht 1.0))) ; lbl_3 (polar lbl_ml 0 (+ col1_wid col2_wid (/ col3_wid 2))) lbl_3 (polar lbl_ml 0 (+ col1_wid col2_wid (* txtht 1.0))) ; lbl_4 (polar lbl_ml 0 (+ col1_wid col2_wid col3_wid (/ col4_wid 2))) lbl_4 (polar lbl_ml 0 (+ col1_wid col2_wid col3_wid (* txtht 1.0))) lbl_5 (polar lbl_ml 0 (+ col1_wid col2_wid col3_wid col4_wid (/ col5_wid 2))) ) (command ".text" "j" "mc" lbl_1 txtht 0 tbl_t1) (command ".text" "j" "ml" lbl_2 txtht 0 tbl_t2) (command ".text" "j" "ml" lbl_3 txtht 0 tbl_t3) (command ".text" "j" "ml" lbl_4 txtht 0 tbl_t4) (command ".text" "j" "mc" lbl_5 txtht 0 tbl_t5) ) (setq count (1+ count)) );foreach (princ) );defun