;;;Checks manholes for adequate diameter to accomodate specified pipe sizes. ;;;Requires GPDGN alignment ;;; ;;; Author: ;;; Henry C. Francis ;;; 425 N. Ashe St. ;;; Southern Pines, NC 28387 ;;; ;;; http://paracadd.com ;;; All rights reserved. ;;; ;;; Copyright: 3/29/00 ;;; Edited: 3/29/00 (DEFUN c:sizemh (/ pp_sta p_siz pp_siz) (SETQ tag_cnt 0) (SETQ p_clear (IF m_units (/ (ureal 1 "" "Clearance around pipe in millimeters: " (IF p_clear (* p_clear 1000.0) 75 ) ;_ end of if ) ;_ end of ureal 1000.000 ) ;_ end of / (/ (ureal 1 "" "Clearance around pipe in inches: " (IF p_clear (* p_clear 12.0) 3 ) ;_ end of if ) ;_ end of ureal 12.0000 ) ;_ end of / ) ;_ end of if p_wall1 (IF m_units (/ (ureal 1 "" "Pipe wall thickness in millimeters: " (IF p_wall1 (* p_wall1 1000.0) 50 ) ;_ end of if ) ;_ end of ureal 1000.000 ) ;_ end of / (/ (ureal 1 "" "Pipe wall thickness in inches: " (IF p_wall1 (* p_wall1 12.0) 2 ) ;_ end of if ) ;_ end of ureal 12.0000 ) ;_ end of / ) ;_ end of if p_wall2 (IF m_units (/ (ureal 1 "" "Pipe wall thickness in millimeters: " (IF p_wall2 (* p_wall2 1000.0) 50 ) ;_ end of if ) ;_ end of ureal 1000.000 ) ;_ end of / (/ (ureal 1 "" "Pipe wall thickness in inches: " (IF p_wall2 (* p_wall2 12.0) 2 ) ;_ end of if ) ;_ end of ureal 12.0000 ) ;_ end of / ) ;_ end of if min_clr (IF m_units (/ (ureal 1 "" "Minimum clearance between openings in meters: " (IF min_clr min_clr 0.3048 ) ;_ end of if ) ;_ end of ureal ) ;_ end of / (/ (ureal 1 "" "Minimum clearance between openings in feet: " (IF min_clr min_clr 1.0 ) ;_ end of if ) ;_ end of ureal ) ;_ end of / ) ;_ end of if ) ;_ end of setq (IF (NOT clearance_only) (FOREACH n align_lst (SETQ sta (NTH 1 n) inv_out (NTH 3 n) mh_drop (NTH 4 n) mh_dia (NTH 5 n) p_siz (IF m_units (/ (NTH 7 n) 1000.000) (/ (NTH 7 n) 12.0000) ) ;_ end of if p_matl (NTH 8 n) point (NTH 9 n) ) ;_ end of SETQ (IF (AND pp_sta (< tag_cnt (1- (LENGTH align_lst)))(NOT(WCMATCH(NTH 0 n)"*MATCH LINE*"))) (PROGN (SETQ n_point (NTH 9 (NTH (1+ tag_cnt) align_lst))) (calc_size_mh) (prin_size_mh) (IF (< d_clear min_clr) (PROGN (SETQ mod_mh_dia (ukword 1 "Yes No" (STRCAT " Required MH dia=" (RTOS tst_mh_dia 2 2) (IF m_units "m" "ft" ) ;_ end of if ", Modify MH dia now? " ) ;_ end of strcat (IF mod_mh_dia mod_mh_dia "No" ) ;_ end of if ) ;_ end of ukword ) ;_ end of setq (IF (EQ mod_mh_dia "Yes") (PROGN (SETQ tst_mh_dia (ureal 1 "" "Accept required MH dia or enter new MH dia: " tst_mh_dia)) (SETQ align_lst (SUBST (LIST (NTH 0 n) (NTH 1 n) (NTH 2 n) (NTH 3 n) (NTH 4 n) tst_mh_dia (NTH 6 n) (NTH 7 n) (NTH 8 n) (NTH 9 n) ) ;_ end of list n align_lst ) ;_ end of subst ) ;_ end of setq ) ;_ end of progn ) ;_ end of if ) ;_ end of progn (PRINC (STRCAT " Required MH dia=" (RTOS tst_mh_dia 2 2) (IF m_units "m" "ft" ) ;_ end of if ) ;_ end of strcat ) ) ;_ end of if ) ;_ end of progn ) ;_ end of if (SETQ pp_sta p_sta p_sta sta p_out inv_out p_drop mh_drop pp_siz p_siz pp_matl p_matl p_point point tag_cnt (1+ tag_cnt) ) ;_ end of setq ) ;_ end of foreach (PROGN (SETQ inv_out (ureal 1 "" "Invert out" inv_out) mh_drop (ureal 1 "" "Drop through invert" mh_drop) mh_dia (ureal 1 "" "Manhole diameter" mh_dia) pp_siz (IF m_units (/ (ureal 1 "" "1st pipe size" pp_siz) 1000.000) (/ (ureal 1 "" "1st pipe size" pp_siz) 12.0000) ) ;_ end of if p_siz (IF m_units (/ (ureal 1 "" "2nd pipe size" p_siz) 1000.000) (/ (ureal 1 "" "2nd pipe size" p_siz) 12.0000) ) ;_ end of if point (upoint 1 "" "Manhole center" point nil) p_point (upoint 1 "" "Direction of 1st line" nil point) n_point (upoint 1 "" "Direction of 2nd line" nil point) ) ;_ end of SETQ (calc_size_mh) (prin_size_mh) ) ) ) ;_ end of defun (DEFUN calc_size_mh () (SETQ ang_in (ANGLE point n_point) ang_out (ANGLE point p_point) max_ang (MAX ang_in ang_out) min_ang (MIN ang_out ang_in) tmp_ang (- max_ang min_ang) delt_ang (IF (> tmp_ang PI) (- (* PI 2) tmp_ang) tmp_ang ) ;_ end of if ) ;_ end of setq (SETQ d_clear (- (SQRT (+ (* mh_drop mh_drop) (* (* delt_ang (/ mh_dia 2.000)) (* delt_ang (/ mh_dia 2.000))))) (/ (+ pp_siz p_siz) 2.000) (* p_clear 2.000) p_wall1 p_wall2 ) ;_ end of - ) ;_ end of setq (SETQ tst_clear d_clear tst_mh_dia mh_dia ) ;_ end of setq (WHILE (< tst_clear min_clr) (SETQ tst_clear (- (SQRT (+ (* mh_drop mh_drop) (* (* delt_ang (/ tst_mh_dia 2.000)) (* delt_ang (/ tst_mh_dia 2.000)))) ) ;_ end of sqrt (/ (+ pp_siz p_siz) 2.000) (* p_clear 2.000) p_wall1 p_wall2 ) ;_ end of - ) ;_ end of setq (SETQ tst_mh_dia (1+ tst_mh_dia)) ) ;_ end of while ) ;_ end of DEFUN (DEFUN prin_size_mh () (PRINC "\n") (PRINC (IF clearance_only (STRCAT "\nManhole Min dist: " (RTOS d_clear 2 2) (IF m_units "m" "ft" ) ;_ end of if ) ;_ end of strcat (STRCAT "\nMH #" (NTH 0 n) ", STA " (stait sta 2) ", Min dist: " (RTOS d_clear 2 2) (IF m_units "m" "ft" ) ;_ end of if ) ;_ end of strcat ) ) ;_ end of princ (PRINC (STRCAT ", MH dia=" (RTOS mh_dia 2 2) (IF m_units "m" "ft" ) ;_ end of if ", Incl ang=" (ANGTOS delt_ang 0 4) ",\n Pipe sizes: " (IF pp_siz (STRCAT (RTOS pp_siz 2 2) (IF m_units "m" "'" ) ;_ end of IF ) ;_ end of STRCAT " " ) ;_ end of IF ", " (STRCAT (RTOS p_siz 2 2) (IF m_units "m" "'" ) ;_ end of IF ) ;_ end of STRCAT ) ;_ end of strcat ) ;_ end of princ (PRINC) ) ;_ end of DEFUN ;|«Visual LISP© Format Options» (120 2 15 2 T "end of " 100 9 2 0 nil nil nil T T) ***Don't add text below the comment!***|;