;;; ;;; ;;;> Author: Henry C. Francis ;;;> 425 N. Ashe St. ;;;> Southern Pines, NC 28387 ;;;> http://paracadd.com ;;;> All rights reserved. ;;; ;;;> COPYRIGHT: ;;;> EDITED: 07-12-2006 ;;; (DEFUN c:sdlbl () (IF llt (SETQ old_llt llt)) (WHILE (AND (SETQ culv_ent1 (NENTSEL "\nSelect Culvert symbol at one end of culvert. " ) ;_ end of NENTSEL ) ;_ end of SETQ (IF (AND (EQ (TYPE (CAR culv_ent1)) 'ENAME) (EQ (CDR (ASSOC 0 (ENTGET (CAR culv_ent1)))) "LINE") ) (SETQ use_1_line T) (SETQ culv_ent2 (NENTSEL "\nSelect Culvert symbol at opposite end. ") use_1_line NIL ) ;_ end of SETQ ) (IF (EQ (TYPE (CAR culv_ent1)) 'ENAME) (SETQ culv_ent1 (ENTGET (CAR culv_ent1))) (SETQ culv_ent1 (ENTGET (CAAR (REVERSE culv_ent1 ) ;_ end of reverse ) ;_ end of caar ) ;_ end of entget ) ;_ end of setq ) (IF use_1_line (SETQ culv_ent2_10 (CDR (ASSOC 11 culv_ent1)) culv_ent2 (SUBST (CONS 11 (LIST 0 0 0))(ASSOC 11 culv_ent1) culv_ent1) culv_ent2 (SUBST (CONS 10 culv_ent2_10)(ASSOC 10 culv_ent2) culv_ent2) ) (IF (EQ (TYPE (CAR culv_ent2)) 'ENAME) (SETQ culv_ent2 (ENTGET (CAR culv_ent2))) (SETQ culv_ent2 (ENTGET (CAAR (REVERSE culv_ent2 ) ;_ end of reverse ) ;_ end of caar ) ;_ end of entget ) ;_ end of setq ) ) (OR (EQ (CDR (ASSOC 0 culv_ent1)) "LINE") (AND (WCMATCH (STRCASE (CDR (ASSOC 2 culv_ent1))) "*CULV") (WCMATCH (STRCASE (CDR (ASSOC 2 culv_ent2))) "*CULV") ) ) ) ;_ end of and (COND ((>= (CADDDR (ASSOC 10 culv_ent1)) (CADDDR (ASSOC 10 culv_ent2)) ) ;_ end of > (SETQ culv_inv_in (CADDDR (ASSOC 10 culv_ent1)) culv_in_pt (CDR (ASSOC 10 culv_ent1)) culv_inv_out (CADDDR (ASSOC 10 culv_ent2)) culv_out_pt (CDR (ASSOC 10 culv_ent2)) ) ;_ end of setq ) ((< (CADDDR (ASSOC 10 culv_ent1)) (CADDDR (ASSOC 10 culv_ent2)) ) ;_ end of < (SETQ culv_inv_in (CADDDR (ASSOC 10 culv_ent2)) culv_in_pt (CDR (ASSOC 10 culv_ent2)) culv_inv_out (CADDDR (ASSOC 10 culv_ent1)) culv_out_pt (CDR (ASSOC 10 culv_ent1)) ) ;_ end of setq ) ) ;_ end of cond (SETQ txt_1 "EXISTING CULVERT" txt_2 (STRCAT "INV IN EL= " (RTOS culv_inv_in 2 2)) txt_3 (STRCAT "INV OUT EL= " (RTOS culv_inv_out 2 2)) ) ;_ end of setq (IF do_cmud (PROGN (COMMAND "-style" "ROMAND" "romand" 0 1.5 15 "N" "N" "N") (SETQ text_style "STANDARD") ) ;_ end of PROGN (SETQ text_style "STANDARD") ) ;_ end of IF (IF (AND (OR do_cmud do_char) (NOT (WCMATCH (STRCASE txt_1) "EXIST*")) ) ;_ end of AND (SETQ ldrc_no "2") (SETQ ldrc_no "1") ) ;_ end of IF (IF (AND do_char (NOT (WCMATCH (STRCASE txt_1) "EXIST*"))) (SETQ txtc_no "3") (IF (WCMATCH (STRCASE txt_1) "EXIST*") (SETQ txtc_no "1") (SETQ txtc_no "3") ) ;_ end of IF ) ;_ end of if (IF gvpno nil (LOAD "gvpno") ) ;_ end of if (gvpno) (SETQ colr txtc_no) (SETQ mjrg "C" llt "E" colra nil colri nil textlay (STRCAT mjrg llt prod txtc_no "NOTE" ) ;_ end of strcat ldrlay (STRCAT mjrg llt prod ldrc_no "NOTE" ) ;_ end of strcat ) ;_ end of setq (IF dimscl nil (LOAD "dimscl") ) ;_ end of if (dimscl) (SETQ ss_line "" thts (IF do_cmud "100" "110" ) ;_ end of IF ) ;_ end of SETQ (IF (OR (EQ (SUBSTR thts 1 1) "S") (EQ (SUBSTR thts 1 1) "s")) (SETQ text_ht (* 0.110 dimsc)) (SETQ text_ht (* (* (ATOI thts) 0.001) dimsc)) ) ;_ end of IF (SETVAR "TEXTSIZE" text_ht) (SETQ v_twst (GETVAR "viewtwist") text_pin1 culv_in_pt text_pin2 (POLAR text_pin1 (- 0 (+ v_twst (/ PI 2))) (* text_ht 1.5) ) ;_ end of POLAR text_pout1 culv_out_pt text_pout2 (POLAR text_pout1 (- 0 (+ v_twst (/ PI 2))) (* text_ht 1.5) ) ;_ end of POLAR ) ;_ end of SETQ (SETQ text_ent1 (LIST (CONS 0 "TEXT") (CONS 1 txt_1) (CONS 7 text_style) (CONS 8 textlay) (CONS 10 text_pin1) (CONS 40 text_ht) (CONS 50 (- 0 v_twst)) (IF (AND do_cmud txt_1 (NOT (WCMATCH (STRCASE txt_1) "EXIST*")) ) ;_ end of AND (CONS 51 0.26179939) (IF (NOT (WCMATCH (STRCASE txt_1) "EXIST*")) (CONS 51 0) (CONS 51 0.26179939) ) ;_ end of IF ) ;_ end of IF (CONS 62 (IF (AND txt_1 do_cmud (WCMATCH (STRCASE txt_1) "EXIST*") ) ;_ end of AND 1 256 ) ;_ end of IF ) ;_ end of CONS ) ;_ end of LIST ) ;_ end of SETQ (SETQ text_ent2 (LIST (CONS 0 "TEXT") (CONS 1 txt_2) (CONS 7 text_style) (CONS 8 textlay) (CONS 10 text_pin2) (CONS 40 text_ht) (CONS 50 (- 0 v_twst)) (IF (AND do_cmud txt_1 (NOT (WCMATCH (STRCASE txt_1) "EXIST*")) ) ;_ end of AND (CONS 51 0.26179939) (IF (NOT (WCMATCH (STRCASE txt_1) "EXIST*")) (CONS 51 0) (CONS 51 0.26179939) ) ;_ end of IF ) ;_ end of IF (CONS 62 (IF (AND txt_2 do_cmud (WCMATCH (STRCASE txt_1) "EXIST*") ) ;_ end of AND 1 256 ) ;_ end of IF ) ;_ end of CONS ) ;_ end of LIST ) ;_ end of SETQ (SETQ text_ss (SSADD)) (IF (AND txt_1 (/= (CDR (ASSOC 1 text_ent1)) " ")) (PROGN (ENTMAKE text_ent1) (SETQ text_ss (SSADD (ENTLAST) text_ss)) ) ;_ end of progn ) ;_ end of if (IF (AND txt_2 (/= (CDR (ASSOC 1 text_ent2)) " ")) (PROGN (ENTMAKE text_ent2) (SETQ text_ss (SSADD (ENTLAST) text_ss)) ) ;_ end of progn ) ;_ end of if (COMMAND ".layer" "c" txtc_no textlay "") (SETQ max_tl (MAX (IF txt_1 (DISTANCE (CAR (TEXTBOX text_ent1)) (CADR (TEXTBOX text_ent1)) ) ;_ end of DISTANCE 0 ) ;_ end of IF (IF txt_2 (DISTANCE (CAR (TEXTBOX text_ent2)) (CADR (TEXTBOX text_ent2)) ) ;_ end of DISTANCE 0 ) ;_ end of IF ) ;_ end of MAX ) ;_ end of SETQ (IF (AND (OR (> (/ (DISTANCE (GETVAR "viewctr") culv_in_pt) (GETVAR "viewsize") ) ;_ end of / 0.475 ) ;_ end of > (> (GETVAR "viewsize") 500) (< (GETVAR "viewsize") 300) ) ;_ end of and (EQ (GETVAR "tilemode") 1) ) ;_ end of AND (COMMAND ".zoom" "c" (TRANS culv_in_pt 0 1) (* dimsc 10) ) ;_ end of COMMAND ) ;_ end of if (PRINC "\nPick Note Location. ") ;_ end of PRINC (COMMAND "._move" text_ss "" (TRANS culv_in_pt 0 1) ;text_ptj pause (SETQ new_text_pt (TRANS (POLAR (POLAR (CADR (GRREAD T 4 1)) (+ (- 0 v_twst) (/ PI 2)) (* text_ht 0.5) ) ;_ end of POLAR (- 0 (+ v_twst PI)) (/ text_ht 2.000) ) ;_ end of POLAR 1 0 ) ;_ end of trans ) ;_ end of SETQ ) ;_ end of COMMAND (SETQ colr ldrc_no modf "NOTE" ) ;_ end of SETQ (COMMAND ".layer" "c" ldrc_no ldrlay "") (SETQ new_text_rt (POLAR new_text_pt (- 0 v_twst) (+ max_tl (* 1.25 text_ht)) ) ;_ end of polar ) ;_ end of setq (IF (> (DISTANCE new_text_pt culv_in_pt) (DISTANCE new_text_rt culv_in_pt) ) ;_ end of > (SETQ tmp_new_pt new_text_pt new_text_pt (POLAR new_text_rt (- 0 v_twst (/ PI 2)) (* text_ht 1.5) ) ;_ end of polar new_text_rt (POLAR tmp_new_pt (- 0 v_twst (/ PI 2)) (* text_ht 1.5) ) ;_ end of polar old_v_twst v_twst v_twst (+ v_twst PI) twst_flpd T ) ;_ end of setq ) ;_ end of if (SETQ ldr_pt2 (POLAR new_text_pt (- 0 (+ v_twst PI)) (* text_ht 2)) ;_ end of polar ldr_pt3 (POLAR ldr_pt2 (ANGLE ldr_pt2 new_text_rt) (* text_ht 2)) ldr_ang (ANGLE culv_in_pt ldr_pt2) ldr_ang_d (* (/ ldr_ang PI) 180.00) ldr_pt (POLAR culv_in_pt ldr_ang (* dimsc 0.0625)) fin_bpt (POLAR new_text_pt (- 0 (+ v_twst (/ PI 2))) (* 2.0 text_ht) ) ;_ end of polar fin_tpt (POLAR fin_bpt (- 0 (- v_twst (/ PI 2))) (* 4.0 text_ht) ) ;_ end of polar ) ;_ end of setq (ENTMAKE (LIST (CONS 0 "POLYLINE") (CONS 66 1) (CONS 8 ldrlay) (CONS 10 (TRANS culv_in_pt 0 1)) ) ;_ end of list ) ;_ end of entmake (ENTMAKE (LIST (CONS 0 "VERTEX") (CONS 8 ldrlay) (CONS 10 (TRANS culv_in_pt 0 1)) ) ;_ end of list ) ;_ end of entmake (ENTMAKE (LIST (CONS 0 "VERTEX") (CONS 8 ldrlay) (CONS 10 (TRANS ldr_pt2 0 1)) ) ;_ end of list ) ;_ end of entmake (ENTMAKE (LIST (CONS 0 "VERTEX") (CONS 8 ldrlay) (CONS 10 (TRANS ldr_pt3 0 1)) ) ;_ end of list ) ;_ end of entmake (ENTMAKE (LIST (CONS 0 "SEQEND") (CONS 8 ldrlay) ) ;_ end of LIST ) ;_ end of ENTMAKE (IF twst_flpd (SETQ test_flpd nil v_twst old_v_twst ) ;_ end of setq ) ;_ end of if (SETQ text_ent1 (LIST (CONS 0 "TEXT") (CONS 1 txt_1) (CONS 7 text_style) (CONS 8 textlay) (CONS 10 text_pout1) (CONS 40 text_ht) (CONS 50 (- 0 v_twst)) (IF (NOT (WCMATCH (STRCASE txt_1) "EXIST*")) (IF do_cmud (CONS 51 0.26179939) (CONS 51 0) ) ;_ end of IF (CONS 51 0.26179939) ) ;_ end of IF (CONS 62 256) ) ;_ end of LIST ) ;_ end of SETQ (SETQ text_ent2 (LIST (CONS 0 "TEXT") (CONS 1 txt_3) (CONS 7 text_style) (CONS 8 textlay) (CONS 10 text_pout2) (CONS 40 text_ht) (CONS 50 (- 0 v_twst)) (IF (NOT (WCMATCH (STRCASE txt_1) "EXIST*")) (IF do_cmud (CONS 51 0.26179939) (CONS 51 0) ) ;_ end of IF (CONS 51 0.26179939) ) ;_ end of IF (CONS 62 256) ) ;_ end of LIST ) ;_ end of SETQ (SETQ text_ss (SSADD)) (IF (AND txt_1 (/= (CDR (ASSOC 1 text_ent1)) " ")) (PROGN (ENTMAKE text_ent1) (SETQ text_ss (SSADD (ENTLAST) text_ss)) ) ;_ end of progn ) ;_ end of if (IF (AND txt_3 (/= (CDR (ASSOC 1 text_ent2)) " ")) (PROGN (ENTMAKE text_ent2) (SETQ text_ss (SSADD (ENTLAST) text_ss)) ) ;_ end of progn ) ;_ end of if (COMMAND ".layer" "c" txtc_no textlay "") (SETQ max_tl (MAX (IF txt_1 (DISTANCE (CAR (TEXTBOX text_ent1)) (CADR (TEXTBOX text_ent1)) ) ;_ end of DISTANCE 0 ) ;_ end of IF (IF txt_3 (DISTANCE (CAR (TEXTBOX text_ent2)) (CADR (TEXTBOX text_ent2)) ) ;_ end of DISTANCE 0 ) ;_ end of IF ) ;_ end of MAX ) ;_ end of SETQ (IF (AND (OR (> (/ (DISTANCE (GETVAR "viewctr") culv_in_pt) (GETVAR "viewsize") ) ;_ end of / 0.475 ) ;_ end of > (> (GETVAR "viewsize") 500) (< (GETVAR "viewsize") 300) ) ;_ end of and (EQ (GETVAR "tilemode") 1) ) ;_ end of AND (COMMAND ".zoom" "c" (TRANS culv_in_pt 0 1) (* dimsc 10) ) ;_ end of COMMAND ) ;_ end of if (PRINC "\nPick Note Location. ") (COMMAND "._move" text_ss "" (TRANS culv_out_pt 0 1) pause (SETQ new_text_pt (TRANS (POLAR (POLAR (CADR (GRREAD T 4 1)) (+ (- 0 v_twst) (/ PI 2)) (* text_ht 0.5) ) ;_ end of POLAR (- 0 (+ v_twst PI)) (/ text_ht 2.000) ) ;_ end of POLAR 1 0 ) ;_ end of trans ) ;_ end of SETQ ) ;_ end of COMMAND (SETQ colr ldrc_no modf "NOTE" ) ;_ end of SETQ (COMMAND ".layer" "c" ldrc_no ldrlay "") (SETQ new_text_rt (POLAR new_text_pt (- 0 v_twst) (+ max_tl (* 1.25 text_ht)) ) ;_ end of polar ) ;_ end of setq (IF (> (DISTANCE new_text_pt culv_out_pt) (DISTANCE new_text_rt culv_out_pt) ) ;_ end of > (SETQ tmp_new_pt new_text_pt new_text_pt (POLAR new_text_rt (- 0 v_twst (/ PI 2)) (* text_ht 1.5) ) ;_ end of polar new_text_rt (POLAR tmp_new_pt (- 0 v_twst (/ PI 2)) (* text_ht 1.5) ) ;_ end of polar v_twst (+ v_twst PI) test_flpd T ) ;_ end of setq ) ;_ end of if (SETQ ldr_pt2 (POLAR new_text_pt (- 0 (+ v_twst PI)) (* text_ht 2)) ldr_pt3 (POLAR ldr_pt2 (ANGLE ldr_pt2 new_text_rt) (* text_ht 2)) ldr_ang (ANGLE culv_out_pt ldr_pt2) ldr_ang_d (* (/ ldr_ang PI) 180.00) ldr_pt (POLAR culv_out_pt ldr_ang (* dimsc 0.0625)) fin_bpt (POLAR new_text_pt (- 0 (+ v_twst (/ PI 2))) (* 2.0 text_ht) ) ;_ end of polar fin_tpt (POLAR fin_bpt (- 0 (- v_twst (/ PI 2))) (* 4.0 text_ht) ) ;_ end of polar ) ;_ end of setq (ENTMAKE (LIST (CONS 0 "POLYLINE") (CONS 66 1) (CONS 8 ldrlay) (CONS 10 (TRANS culv_out_pt 0 1)) ) ;_ end of list ) ;_ end of entmake (ENTMAKE (LIST (CONS 0 "VERTEX") (CONS 8 ldrlay) (CONS 10 (TRANS culv_out_pt 0 1)) ) ;_ end of list ) ;_ end of entmake (ENTMAKE (LIST (CONS 0 "VERTEX") (CONS 8 ldrlay) (CONS 10 (TRANS ldr_pt2 0 1)) ) ;_ end of list ) ;_ end of entmake (ENTMAKE (LIST (CONS 0 "VERTEX") (CONS 8 ldrlay) (CONS 10 (TRANS ldr_pt3 0 1)) ) ;_ end of list ) ;_ end of entmake (ENTMAKE (LIST (CONS 0 "SEQEND") (CONS 8 ldrlay) ) ;_ end of LIST ) ;_ end of ENTMAKE (IF twst_flpd (SETQ test_flpd nil v_twst old_v_twst ) ;_ end of setq ) ;_ end of if (SETQ culv_ent1 nil culv_ent2 nil ) ;_ end of setq ) ;_ end of while (IF old_llt (SETQ llt old_llt)) (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!***|;