;;; ;;; ;;; Author: ;;; Henry C. Francis ;;; 425 N. Ashe St. ;;; Southern Pines, NC 28387 ;;; ;;; http://paracadd.com ;;; All rights reserved. ;;; ;;; Copyright: ;;; Edited: (DEFUN c:stairpl () (SETQ old_osmode (GETVAR "osmode")) (SETVAR "osmode" 0) (IF c:mklayr nil (LOAD "mklayr") ) ;_ end of if (c:svlayr) (SETQ mjrg "A" llt "-" prod "METL" colr "6" modf "STEP" usrd nil ) ;_ end of setq (c:mklayr) (IF ureal NIL (LOAD "ureal" "\nFile UREAL.LSP not loaded! ") ) ;_ end of if (IF upoint NIL (LOAD "upoint" "\nFile UPOINT.LSP not loaded! ") ) ;_ end of if (IF ukword NIL (LOAD "ukword" "\nFile UKWORD.LSP not loaded! ") ) ;_ end of if (SETQ str_wid (ureal 1 "" "Stair tread width" (IF str_wid str_wid 36.0 ) ;_ end of if ) ;_ end of ureal ) ;_ end of setq (SETQ strflg_wid (ureal 1 "" "Stringer flange width" (IF strflg_wid strflg_wid 3.0 ) ;_ end of if ) ;_ end of ureal ) ;_ end of setq (SETQ trd_dpt (ureal 1 "" "Tread depth (nose to nose)" (IF trd_dpt trd_dpt 11.0 ) ;_ end of if ) ;_ end of ureal ) ;_ end of setq (SETQ str_hgt (ureal 1 "" "Height of stair from bottom landing to top landing" (IF str_hgt str_hgt nil ) ;_ end of if ) ;_ end of ureal ) ;_ end of setq (SETQ trgtris (ureal 1 "" "Target riser height" (IF trgtris trgtris 7.0 ) ;_ end of if ) ;_ end of ureal ) ;_ end of setq (SETQ top_stp (ukword 1 "Yes No" "Is top step level with top landing?" (IF top_stp top_stp "Yes" ) ;_ end of if ) ;_ end of ukword ) ;_ end of setq (SETQ bot_stp (ukword 1 "Yes No" "Is bottom step level with bottom landing?" (IF bot_stp bot_stp "No" ) ;_ end of if ) ;_ end of ukword ) ;_ end of setq (SETQ strp_01 (IF (EQ top_stp "Yes") (upoint 1 "" "Middle of top step at back of tread" nil nil ) ;_ end of upoint (upoint 1 "" "Middle of top landing nose" nil nil) ) ;_ end of if ) ;_ end of setq (SETQ strp_02 (upoint 1 "" "Direction of stair" nil strp_01)) (SETQ str_ang (ANGLE strp_01 strp_02) num_ris (ATOF (RTOS (/ str_hgt trgtris) 2 0)) ris_hgt (/ str_hgt num_ris) num_trd (COND ((AND (EQ top_stp "Yes") (EQ bot_stp "Yes")) (1+ num_ris) ) ((OR (EQ top_stp "Yes") (EQ bot_stp "Yes")) num_ris) ((AND (EQ top_stp "No") (EQ bot_stp "No")) (1- num_ris)) ) ;_ end of cond ) ;_ end of setq (SETQ str_len (* trd_dpt num_trd)) (SETQ strp_03 (POLAR strp_01 (+ str_ang (* PI 0.5)) (/ str_wid 2.0)) strp_04 (POLAR strp_01 (+ str_ang (* PI 0.5)) (+ (/ str_wid 2.0) strflg_wid) ) ;_ end of polar strp_05 (POLAR strp_01 (+ str_ang (* PI 1.5)) (/ str_wid 2.0)) strp_06 (POLAR strp_01 (+ str_ang (* PI 1.5)) (+ (/ str_wid 2.0) strflg_wid) ) ;_ end of polar strp_07 (POLAR strp_03 str_ang (COND ((EQ bot_stp "Yes") (+ str_len 1.0)) (T (+ str_len 2.5)) ) ;_ end of cond ) ;_ end of polar strp_08 (POLAR strp_04 str_ang (COND ((EQ bot_stp "Yes") (+ str_len 1.0)) (T (+ str_len 2.5)) ) ;_ end of cond ) ;_ end of polar strp_09 (POLAR strp_05 str_ang (COND ((EQ bot_stp "Yes") (+ str_len 1.0)) (T (+ str_len 2.5)) ) ;_ end of cond ) ;_ end of polar strp_10 (POLAR strp_06 str_ang (COND ((EQ bot_stp "Yes") (+ str_len 1.0)) (T (+ str_len 2.5)) ) ;_ end of cond ) ;_ end of polar ) ;_ end of setq (COMMAND "_.undo" "begin") (SETQ stair_parts (SSADD)) (make_strhids "HDBOX" strp_03 str_ang (COND ((EQ bot_stp "Yes") (+ str_len 1.0)) (T (+ str_len 2.5)) ) ;_ end of cond strflg_wid ) ;_ end of make_strhids (make_strhids "HDBOX" strp_06 str_ang (COND ((EQ bot_stp "Yes") (+ str_len 1.0)) (T (+ str_len 2.5)) ) ;_ end of cond strflg_wid ) ;_ end of make_strhids (make_strhids "HDBOX" strp_05 str_ang (+ str_len 1.0) str_wid ) ;_ end of make_strhids (COMMAND "_.line" strp_04 strp_06 "") (SSADD (ENTLAST) stair_parts) (IF (EQ bot_stp "Yes") (PROGN (COMMAND "_.line" strp_08 strp_10 "") (SSADD (ENTLAST) stair_parts) ) ;_ end of progn (PROGN (COMMAND "_.line" strp_07 strp_08 "") (SSADD (ENTLAST) stair_parts) (COMMAND "_.line" strp_09 strp_10 "") (SSADD (ENTLAST) stair_parts) ) ;_ end of PROGN ) ;_ end of if (COMMAND "_.line" strp_04 strp_08 "") (SSADD (ENTLAST) stair_parts) (COMMAND "_.line" strp_03 strp_07 "") (SSADD (ENTLAST) stair_parts) (COMMAND "_.line" strp_05 strp_09 "") (SSADD (ENTLAST) stair_parts) (COMMAND "_.line" strp_06 strp_10 "") (SSADD (ENTLAST) stair_parts) (IF (EQ top_stp "Yes") (SETQ cumulen (1+ trd_dpt)) (SETQ cumulen 1.0) ) ;_ end of if (COMMAND "_.line" (POLAR strp_03 str_ang cumulen) (POLAR strp_05 str_ang cumulen) "" ) ;_ end of command (SSADD (ENTLAST) stair_parts) (SETQ cumulen (+ cumulen trd_dpt)) (WHILE (<= cumulen (COND ((AND (EQ top_stp "Yes") (EQ bot_stp "Yes")) (+ str_len 1.0) ) (T (+ str_len 2.5)) ) ;_ end of cond ) ;_ end of <= (COMMAND "_.line" (POLAR strp_03 str_ang cumulen) (POLAR strp_05 str_ang cumulen) "" ) ;_ end of command (SSADD (ENTLAST) stair_parts) (SETQ cumulen (+ cumulen trd_dpt)) ) ;_ end of while (SETQ grp_name_a (RTOS (FIX (GETVAR "cdate")) 2 0) grp_name_b (SUBSTR (RTOS (REM (GETVAR "cdate") 1) 2 8) 3) grp_name_c (STRCAT "STAIR_" (RTOS str_wid 2 0) "X" (RTOS str_hgt 2 0) ) ;_ end of STRCAT bang_str (STRCAT "STAIR") ) ;_ end of setq (COMMAND "-group" "create" (STRCAT grp_name_a grp_name_b grp_name_c) bang_str stair_parts "" ) ;_ end of COMMAND (COMMAND "_.undo" "end") (SETVAR "osmode" old_osmode) (c:rslayr) (PRINC) ) ;_ end of defun (DEFUN make_strhids (hidname hidpnt hidang hid_x hid_y /) (IF stair_parts NIL (SETQ stair_parts (SSADD)) ) ;_ end of IF (PROGN (IF (TBLOBJNAME "block" "hdbox") nil (PROGN (COMMAND "-insert" "hdbox") (COMMAND) ) ;_ end of progn ) ;_ end of IF (IF (TBLOBJNAME "block" "hdang") nil (PROGN (COMMAND "-insert" "hdang") (COMMAND) ) ;_ end of progn ) ;_ end of IF (IF (TBLOBJNAME "block" "hdcirc") nil (PROGN (COMMAND "-insert" "hdcirc") (COMMAND) ) ;_ end of progn ) ;_ end of IF ) ;_ end of PROGN (SETQ hdboxlst (LIST (CONS 0 "INSERT") (CONS 100 "AcDbBlockReference") (CONS 2 hidname) (CONS 10 hidpnt) (CONS 41 hid_x) (CONS 42 hid_y) (CONS 43 1.0) (CONS 50 hidang) ) ;_ end of LIST ) ;_ end of SETQ (ENTMAKE hdboxlst) (SSADD (ENTLAST) stair_parts) ) ;_ end of defun (DEFUN c:stairels () (SETQ trd_elf NIL) (SETQ old_osmode (GETVAR "osmode")) (SETVAR "osmode" 0) (IF (OR (EQ (STRCASE (getvar "loginname")) "COOPER")(EQ (STRCASE (getvar "loginname")) "ME")) (SETQ old_plinetype 0) (SETQ old_plinetype (GETVAR "plinetype")) ) (SETVAR "plinetype" 2) (IF c:mklayr nil (LOAD "mklayr") ) ;_ end of if (c:svlayr) (SETQ mjrg "A" llt "-" prod "METL" colr "6" modf "STEP" usrd nil ) ;_ end of setq (c:mklayr) (IF (AND upoint ureal ukword ustr uint uangle) NIL (FOREACH n (LIST "upoint" "ureal" "ukword" "ustr" "uint" "uangle") (LOAD n) ) ;_ end of foreach ) ;_ end of if (SETQ trd_dpt (ureal 1 "" "Tread depth (nose to nose)?" (IF trd_dpt trd_dpt 11.0 ) ;_ end of if ) ;_ end of ureal ) ;_ end of setq (SETQ trd_thk (ureal 1 "" "Tread thickness?" (IF trd_thk trd_thk 1.5 ) ;_ end of if ) ;_ end of ureal ) ;_ end of setq (SETVAR "osmode" 1) (SETQ str_top (upoint 1 "" "Top of stair (landing) at face of mounting surface" nil nil ) ;_ end of upoint ) ;_ end of setq (SETVAR "osmode" 129) (SETQ str_bot (upoint 1 "" "Bottom of stair (landing)" nil str_top)) (SETVAR "osmode" 0) (SETQ str_hgt (- (CADR str_top) (CADR str_bot))) (SETQ trgtris (ureal 1 "Number" "Target riser height? or umber of risers" (IF trgtris trgtris 7.0 ) ;_ end of if ) ;_ end of ureal ) ;_ end of setq (IF (EQ trgtris "Number") (SETQ numberris (uint 1 "" "Number of risers?" (IF numberris numberris (FIX (/ str_hgt 7.0)) ) ) trgtris (/ str_hgt numberris) ) ) (SETQ top_stp (ukword 1 "Yes No" "Is top step level with top landing?" (IF top_stp top_stp "Yes" ) ;_ end of if ) ;_ end of ukword ) ;_ end of setq (SETQ bot_stp (ukword 1 "Yes No" "Is bottom step level with bottom landing?" (IF bot_stp bot_stp "No" ) ;_ end of if ) ;_ end of ukword ) ;_ end of setq (SETQ str_dir (upoint 1 "" "Direction of stair" nil str_top)) (IF (> (CAR str_dir) (CAR str_top)) (SETQ str_dang 0) (SETQ str_dang PI) ) ;_ end of if (SETQ num_ris (ATOF (RTOS (/ str_hgt trgtris) 2 0)) ris_hgt (/ str_hgt num_ris) num_trd (COND ((AND (EQ top_stp "Yes") (EQ bot_stp "Yes")) (1+ num_ris) ) ((OR (EQ top_stp "Yes") (EQ bot_stp "Yes")) num_ris) ((AND (EQ top_stp "No") (EQ bot_stp "No")) (1- num_ris)) ) ;_ end of cond ) ;_ end of setq (SETQ str_len (* trd_dpt num_trd)) (SETQ firstp_01 (IF (EQ top_stp "Yes") (POLAR str_top str_dang 12.0) (POLAR str_top str_dang (- 12.0 trd_dpt)) ) ;_ end of if ) ;_ end of setq (COMMAND ".undo" "end") (COMMAND "_.undo" "begin") (SETQ treads (SSADD)) (IF (EQ top_stp "Yes") (SETQ trdcnt 2) (SETQ trdcnt 1) ) ;_ end of if (SETQ strp_01 firstp_01) (WHILE (<= trdcnt num_trd) (maketread strp_01 str_dang) (SSADD (ENTLAST) treads) (IF (<= (DISTANCE str_top strp_01) 12.0) nil (SETQ trdcnt (1+ trdcnt)) ) ;_ end of if (SETQ strnnang (ATAN (/ (- 0 ris_hgt) (IF (EQ str_dang 0) trd_dpt (- 0 trd_dpt) ) ;_ end of if ) ;_ end of / ) ;_ end of atan ) ;_ end of setq (IF (AND (> strnnang 0) (< strnnang (* PI 0.5))) (SETQ strnnang (+ strnnang PI)) ) ;_ end of if (SETQ strp_01 (POLAR strp_01 strnnang (SQRT (+ (* trd_dpt trd_dpt) (* ris_hgt ris_hgt))) ) ;_ end of polar ) ;_ end of setq ) ;_ end of while (SETQ stair_parts (SSADD)) (SETQ lastp_01 strp_01) (IF strflg_wid NIL (SETQ strflg_wid 3.0)) (SETQ flg_pt1 (POLAR firstp_01 (+ (ATAN (/ (- 0 ris_hgt) (IF (EQ str_dang 0) trd_dpt (- 0 trd_dpt) ) ;_ end of if ) ;_ end of / ) ;_ end of atan (* PI 0.5) ) ;_ end of + strflg_wid ) ;_ end of polar flg_pt2 (POLAR lastp_01 (+ (ATAN (/ (- 0 ris_hgt) (IF (EQ str_dang 0) trd_dpt (- 0 trd_dpt) ) ;_ end of if ) ;_ end of / ) ;_ end of atan (* PI 0.5) ) ;_ end of + strflg_wid ) ;_ end of polar flg_pt3 (POLAR flg_pt1 (+ (ATAN (/ (- 0 ris_hgt) (IF (EQ str_dang 0) trd_dpt (- 0 trd_dpt) ) ;_ end of if ) ;_ end of / ) ;_ end of atan (* PI 1.5) ) ;_ end of + 12.0 ) ;_ end of polar flg_pt4 (POLAR flg_pt2 (+ (ATAN (/ (- 0 ris_hgt) (IF (EQ str_dang 0) trd_dpt (- 0 trd_dpt) ) ;_ end of if ) ;_ end of / ) ;_ end of atan (* PI 1.5) ) ;_ end of + 12.0 ) ;_ end of polar top_pt1 (POLAR str_top (* PI 0.5) (IF (EQ top_stp "Yes") ris_hgt 0.0 ) ;_ end of if ) ;_ end of polar bot_pt1 (COND ((EQ bot_stp "Yes") (POLAR strp_01 (+ str_dang PI) trd_dpt) ) (T (POLAR strp_01 (+ str_dang PI) (- trd_dpt strflg_wid))) ) ;_ end of cond str_pt1 (INTERS top_pt1 (POLAR top_pt1 0 10) str_top (POLAR str_top (* PI 0.5) 10) nil ) ;_ end of inters str_pt2 (INTERS flg_pt1 flg_pt2 top_pt1 (POLAR top_pt1 0 10) nil) str_pt3 (INTERS flg_pt1 flg_pt2 bot_pt1 (POLAR bot_pt1 (* PI 0.5) 10) nil ) ;_ end of inters str_pt4 (INTERS bot_pt1 (POLAR bot_pt1 (* PI 0.5) 10) lastp_01 (POLAR lastp_01 0 10) nil ) ;_ end of inters str_pt5 (INTERS flg_pt3 flg_pt4 lastp_01 (POLAR lastp_01 0 10) nil) str_pt6 (INTERS flg_pt3 flg_pt4 str_top (POLAR str_top (* PI 0.5) 10) nil ) ;_ end of inters ) ;_ end of setq (SETQ x_dist (IF (EQ str_dang 0) (- (CADR str_pt1) (CADR str_pt6)) (- (CAR str_pt1) (CAR str_pt2)) ) ;_ end of if y_dist (IF (EQ str_dang 0) (- (CAR str_pt2) (CAR str_pt1)) (- (CADR str_pt1) (CADR str_pt6)) ) ;_ end of if ) ;_ end of setq (make_strhids "HDANG" str_pt1 (ANGLE str_pt1 (IF (EQ str_dang 0) str_pt6 str_pt2 ) ;_ end of if ) ;_ end of angle x_dist y_dist ) ;_ end of make_strhids (SSADD (ENTLAST) stair_parts) (SETQ x_dist (IF (EQ str_dang 0) (- (CADR str_pt3) (CADR str_pt4)) (- (CAR str_pt5) (CAR str_pt4)) ) ;_ end of if y_dist (IF (EQ str_dang 0) (- (CAR str_pt4) (CAR str_pt5)) (- (CADR str_pt3) (CADR str_pt4)) ) ;_ end of if ) ;_ end of setq (make_strhids "HDANG" str_pt4 (ANGLE str_pt4 (IF (EQ str_dang 0) str_pt3 str_pt5 ) ;_ end of if ) ;_ end of angle x_dist y_dist ) ;_ end of make_strhids (SSADD (ENTLAST) stair_parts) (COND ((SETQ top_vtx (INTERS str_pt2 (POLAR str_pt2 (+ (ANGLE str_pt3 str_pt2) (* PI 0.5)) 12.0 ) ;_ end of polar str_pt5 str_pt6 T ) ;_ end of inters ) ;_ end of setq (SETQ x_dist (DISTANCE top_vtx str_pt2) y_dist (DISTANCE top_vtx str_pt6) hidang (ANGLE top_vtx str_pt2) ) ;_ end of setq (IF (AND (> x_dist 0) (> y_dist 0)) (PROGN (make_strhids "HDANG" top_vtx hidang x_dist y_dist) (SSADD (ENTLAST) stair_parts) ) ;_ end of PROGN ) ;_ end of IF ) ((SETQ top_vtx (INTERS str_pt6 (POLAR str_pt6 (+ (ANGLE str_pt6 str_pt5) (* PI 0.5)) 12.0 ) ;_ end of polar str_pt2 str_pt3 T ) ;_ end of inters ) ;_ end of setq (SETQ x_dist (DISTANCE top_vtx str_pt2) y_dist (DISTANCE top_vtx str_pt6) hidang (ANGLE top_vtx str_pt2) ) ;_ end of setq (IF (AND (> x_dist 0) (> y_dist 0)) (PROGN (make_strhids "HDANG" top_vtx hidang x_dist y_dist) (SSADD (ENTLAST) stair_parts) ) ;_ end of PROGN ) ;_ end of IF ) ((SETQ top_vtx (INTERS str_pt2 (POLAR str_pt2 (- (ANGLE str_pt3 str_pt2) (* PI 0.5)) 12.0 ) ;_ end of polar str_pt5 str_pt6 T ) ;_ end of inters ) ;_ end of setq (SETQ x_dist (DISTANCE top_vtx str_pt6) y_dist (DISTANCE top_vtx str_pt2) hidang (ANGLE top_vtx str_pt6) ) ;_ end of setq (IF (AND (> x_dist 0) (> y_dist 0)) (PROGN (make_strhids "HDANG" top_vtx hidang x_dist y_dist) (SSADD (ENTLAST) stair_parts) ) ;_ end of PROGN ) ;_ end of IF ) ((SETQ top_vtx (INTERS str_pt6 (POLAR str_pt6 (- (ANGLE str_pt6 str_pt5) (* PI 0.5)) 12.0 ) ;_ end of polar str_pt2 str_pt3 T ) ;_ end of inters ) ;_ end of setq (SETQ x_dist (DISTANCE top_vtx str_pt6) y_dist (DISTANCE top_vtx str_pt2) hidang (ANGLE top_vtx str_pt6) ) ;_ end of setq (IF (AND (> x_dist 0) (> y_dist 0)) (PROGN (make_strhids "HDANG" top_vtx hidang x_dist y_dist) (SSADD (ENTLAST) stair_parts) ) ;_ end of PROGN ) ;_ end of IF ) ) ;_ end of cond (COND ((SETQ bot_vtx (INTERS str_pt3 (POLAR str_pt3 (+ (ANGLE str_pt3 str_pt2) (* PI 0.5)) 12.0 ) ;_ end of polar str_pt5 str_pt6 T ) ;_ end of inters ) ;_ end of setq (SETQ x_dist (DISTANCE bot_vtx str_pt5) y_dist (DISTANCE bot_vtx str_pt3) hidang (ANGLE bot_vtx str_pt5) ) ;_ end of setq (IF (AND (> x_dist 0) (> y_dist 0)) (PROGN (make_strhids "HDANG" bot_vtx hidang x_dist y_dist) (SSADD (ENTLAST) stair_parts) ) ;_ end of PROGN ) ;_ end of IF ) ((SETQ bot_vtx (INTERS str_pt5 (POLAR str_pt5 (+ (ANGLE str_pt6 str_pt5) (* PI 0.5)) 12.0 ) ;_ end of polar str_pt2 str_pt3 T ) ;_ end of inters ) ;_ end of setq (SETQ x_dist (DISTANCE bot_vtx str_pt5) y_dist (DISTANCE bot_vtx str_pt3) hidang (ANGLE bot_vtx str_pt5) ) ;_ end of setq (IF (AND (> x_dist 0) (> y_dist 0)) (PROGN (make_strhids "HDANG" bot_vtx hidang x_dist y_dist) (SSADD (ENTLAST) stair_parts) ) ;_ end of PROGN ) ;_ end of IF ) ((SETQ bot_vtx (INTERS str_pt3 (POLAR str_pt3 (- (ANGLE str_pt3 str_pt2) (* PI 0.5)) 12.0 ) ;_ end of polar str_pt5 str_pt6 T ) ;_ end of inters ) ;_ end of setq (SETQ x_dist (DISTANCE bot_vtx str_pt3) y_dist (DISTANCE bot_vtx str_pt5) hidang (ANGLE bot_vtx str_pt3) ) ;_ end of setq (IF (AND (> x_dist 0) (> y_dist 0)) (PROGN (make_strhids "HDANG" bot_vtx hidang x_dist y_dist) (SSADD (ENTLAST) stair_parts) ) ;_ end of PROGN ) ;_ end of IF ) ((SETQ bot_vtx (INTERS str_pt5 (POLAR str_pt5 (- (ANGLE str_pt6 str_pt5) (* PI 0.5)) 12.0 ) ;_ end of polar str_pt2 str_pt3 T ) ;_ end of inters ) ;_ end of setq (SETQ x_dist (DISTANCE bot_vtx str_pt3) y_dist (DISTANCE bot_vtx str_pt5) hidang (ANGLE bot_vtx str_pt3) ) ;_ end of setq (IF (AND (> x_dist 0) (> y_dist 0)) (PROGN (make_strhids "HDANG" bot_vtx hidang x_dist y_dist) (SSADD (ENTLAST) stair_parts) ) ;_ end of PROGN ) ;_ end of IF ) ) ;_ end of cond (COND ((AND (EQUAL (ANGLE str_pt2 str_pt3) (ANGLE str_pt2 top_vtx) 0.001 ) ;_ end of EQUAL (EQ str_dang 0) ) ;_ end of AND (SETQ str_vtx str_pt6 box_ang (ANGLE str_pt2 str_pt3) ) ;_ end of SETQ ) ((AND (EQUAL (ANGLE str_pt6 str_pt5) (ANGLE str_pt6 top_vtx) 0.001 ) ;_ end of EQUAL (EQ str_dang 0) ) ;_ end of AND (SETQ str_vtx top_vtx box_ang (ANGLE str_pt2 str_pt3) ) ;_ end of SETQ ) ((AND (EQUAL (ANGLE str_pt2 str_pt3) (ANGLE str_pt2 top_vtx) 0.001 ) ;_ end of EQUAL ) ;_ end of AND (SETQ str_vtx top_vtx box_ang (ANGLE str_pt2 str_pt3) ) ;_ end of SETQ ) ((AND (EQUAL (ANGLE str_pt6 str_pt5) (ANGLE str_pt6 top_vtx) 0.001 ) ;_ end of EQUAL ) ;_ end of AND (SETQ str_vtx str_pt2 box_ang (ANGLE str_pt2 str_pt3) ) ;_ end of SETQ ) ) ;_ end of COND (COND ((AND (EQUAL (ANGLE str_pt2 str_pt3) (ANGLE bot_vtx str_pt3) 0.001 ) ;_ end of EQUAL (EQ str_dang 0) ) ;_ end of AND (SETQ box_xpt str_pt5) ) ((AND (EQUAL (ANGLE str_pt6 str_pt5) (ANGLE bot_vtx str_pt5) 0.001 ) ;_ end of EQUAL (EQ str_dang 0) ) ;_ end of AND (SETQ box_xpt bot_vtx) ) ((AND (EQUAL (ANGLE str_pt2 str_pt3) (ANGLE bot_vtx str_pt3) 0.001 ) ;_ end of EQUAL ) ;_ end of AND (SETQ box_xpt bot_vtx) ) ((AND (EQUAL (ANGLE str_pt6 str_pt5) (ANGLE bot_vtx str_pt5) 0.001 ) ;_ end of EQUAL ) ;_ end of AND (SETQ box_xpt str_pt3) ) ) ;_ end of COND (SETQ x_dist (DISTANCE str_vtx box_xpt) y_dist 12.0 hidang (ANGLE str_vtx box_xpt) ) ;_ end of setq (IF (AND (> x_dist 0) (> y_dist 0)) (PROGN (make_strhids "HDBOX" str_vtx hidang x_dist y_dist) (SSADD (ENTLAST) stair_parts) ) ;_ end of PROGN ) ;_ end of IF (SETQ tread_sscnt 0) (WHILE (SETQ trdename (SSNAME treads tread_sscnt)) (SETQ trdent (ENTGET trdename)) (ENTMAKE (CDR trdent)) (SSADD (ENTLAST) stair_parts) (ENTDEL trdename) (SETQ tread_sscnt (1+ tread_sscnt)) ) ;_ end of while (COMMAND "_.pline" str_pt1 str_pt2 str_pt3 str_pt4 str_pt5 str_pt6 "c") ;_ end of command (SSADD (ENTLAST) stair_parts) (SETQ mjrg "S" prod "CONC" colr "4" modf "SLAB" ) ;_ end of SETQ (c:mklayr) (IF (EQ bot_stp "Yes") (PROGN (SETQ bot_lc1 (POLAR trdpt4 (* PI 0.5) trd_thk) bot_lf1 (POLAR bot_lp1 (* PI 1.5) 12.0) bot_lt1 (POLAR str_dang 36.0) ) ;_ end of setq (COMMAND "_.pline" bot_lf1 bot_lc1 bot_lt1 "") (SSADD (ENTLAST) stair_parts) ) ;_ end of progn (PROGN (SETQ bot_lc1 str_pt5 bot_lc2 (POLAR str_pt4 str_dang 48.0) bot_lc3 (POLAR bot_lc2 (* PI 1.5) 6.0) bot_lc4 (POLAR bot_lc1 (* PI 1.5) 6.0) ) ;_ end of setq (IF (EQ str_dang 0) (make_strhids "HDBOX" bot_lc4 (ANGLE bot_lc1 bot_lc2) (DISTANCE bot_lc1 bot_lc2) (DISTANCE bot_lc1 bot_lc4) ) ;_ end of make_strhids (make_strhids "HDBOX" bot_lc3 (ANGLE bot_lc3 bot_lc4) (DISTANCE bot_lc1 bot_lc2) (DISTANCE bot_lc1 bot_lc4) ) ;_ end of make_strhids ) ;_ end of if (COMMAND "_.pline" bot_lc1 bot_lc2 bot_lc3 bot_lc4 bot_lc1 "c") ;_ end of command (SSADD (ENTLAST) stair_parts) ) ;_ end of progn ) ;_ end of if (SETQ grp_name_a (RTOS (FIX (GETVAR "cdate")) 2 0) grp_name_b (SUBSTR (RTOS (REM (GETVAR "cdate") 1) 2 8) 3) grp_name_c (STRCAT "STAIR_" (RTOS str_hgt 2 0)) bang_str (STRCAT "STAIR") ) ;_ end of setq (COMMAND "-group" "create" (STRCAT grp_name_a grp_name_b grp_name_c) bang_str stair_parts "" ) ;_ end of COMMAND (COMMAND "_.undo" "end") (SETVAR "osmode" old_osmode) (IF (OR (EQ (STRCASE (getvar "loginname")) "COOPER")(EQ (STRCASE (getvar "loginname")) "ME")) (PROGN (SETVAR "plinetype" 0) (SETQ old_plinetype NIL) ) (IF old_plinetype (PROGN (SETVAR "plinetype" old_plinetype) (SETQ old_plinetype NIL) ) ) ) (c:rslayr) (PRINC) ) ;_ end of defun (DEFUN c:stairelf () (SETQ trd_elf t) (SETQ old_osmode (GETVAR "osmode")) (SETVAR "osmode" 0) (SETQ old_plinetype (GETVAR "plinetype")) (SETVAR "plinetype" 2) (IF c:mklayr nil (LOAD "mklayr") ) ;_ end of if (c:svlayr) (SETQ mjrg "A" llt "-" prod "METL" colr "6" modf "STEP" usrd nil ) ;_ end of setq (c:mklayr) (IF (AND upoint ureal ukword ustr uint uangle) NIL (FOREACH n (LIST "upoint" "ureal" "ukword" "ustr" "uint" "uangle") (LOAD n (STRCAT "\nFile " (STRCASE n) ".LSP not loaded! ")) ) ;_ end of foreach ) ;_ end of if (SETQ trd_wid (ureal 1 "" "Tread width?" (IF trd_wid trd_wid 36.0 ) ;_ end of if ) ;_ end of ureal ) ;_ end of setq (SETQ strflg_wid (ureal 1 "" "Stringer flange width" (IF strflg_wid strflg_wid 3.0 ) ;_ end of if ) ;_ end of ureal ) ;_ end of setq (SETQ trd_thk (ureal 1 "" "Tread thickness?" (IF trd_thk trd_thk 1.5 ) ;_ end of if ) ;_ end of ureal ) ;_ end of setq (SETVAR "osmode" 1) (SETQ str_top (upoint 1 "" "Top landing surface at midpoint of stair" nil nil ) ;_ end of upoint ) ;_ end of setq (SETVAR "osmode" 129) (SETQ str_bot (upoint 1 "" "Bottom of stair (landing)" nil str_top)) (SETVAR "osmode" 0) (SETQ str_hgt (- (CADR str_top) (CADR str_bot))) (SETQ trgtris (ureal 1 "" "Target riser height?" (IF trgtris trgtris 8.0 ) ;_ end of if ) ;_ end of ureal ) ;_ end of setq (SETQ top_stp (ukword 1 "Yes No" "Is top step level with top landing?" (IF top_stp top_stp "Yes" ) ;_ end of if ) ;_ end of ukword ) ;_ end of setq (SETQ bot_stp (ukword 1 "Yes No" "Is bottom step level with bottom landing?" (IF bot_stp bot_stp "No" ) ;_ end of if ) ;_ end of ukword ) ;_ end of setq (SETQ num_ris (ATOF (RTOS (/ str_hgt trgtris) 2 0)) ris_hgt (/ str_hgt num_ris) num_trd (COND ((AND (EQ top_stp "Yes") (EQ bot_stp "Yes")) (1+ num_ris) ) ((OR (EQ top_stp "Yes") (EQ bot_stp "Yes")) num_ris) ((AND (EQ top_stp "No") (EQ bot_stp "No")) (1- num_ris)) ) ;_ end of cond ) ;_ end of setq (IF (EQ top_stp "Yes") (SETQ firstp_01 (POLAR str_top PI (* trd_wid 0.5))) (SETQ firstp_01 (POLAR (POLAR str_top PI (* trd_wid 0.5)) (* PI 1.5) ris_hgt)) ) (COMMAND "_.undo" "begin") (SETQ treads (SSADD)) (COND ((AND (EQ top_stp "No")(EQ bot_stp "No")) (SETQ trdcnt 1 tl_str_pt (POLAR str_top PI (+(* trd_wid 0.5) strflg_wid)) tr_str_pt (POLAR tl_str_pt 0 (+ trd_wid strflg_wid)) bl_str_pt (POLAR tl_str_pt (* PI 1.5) str_hgt) br_str_pt (POLAR bl_str_pt 0 (+ trd_wid strflg_wid)) )) ((AND (EQ top_stp "Yes")(EQ bot_stp "Yes")) (SETQ trdcnt 2 tl_str_pt (POLAR (POLAR str_top PI (+(* trd_wid 0.5) strflg_wid)) (* PI 0.5) 4.0) tr_str_pt (POLAR tl_str_pt 0 (+ trd_wid strflg_wid)) bl_str_pt (POLAR tl_str_pt (* PI 1.5) (+ str_hgt 12.0));4" at top and 8" at bottom br_str_pt (POLAR bl_str_pt 0 (+ trd_wid strflg_wid)) )) ((EQ top_stp "Yes") (SETQ trdcnt 1 tl_str_pt (POLAR (POLAR str_top PI (+(* trd_wid 0.5) strflg_wid)) (* PI 0.5) 4.0) tr_str_pt (POLAR tl_str_pt 0 (+ trd_wid strflg_wid)) bl_str_pt (POLAR tl_str_pt (* PI 1.5) (+ str_hgt 4.0));4" at top br_str_pt (POLAR bl_str_pt 0 (+ trd_wid strflg_wid)) )) ((EQ bot_stp "Yes") (SETQ trdcnt 2 tl_str_pt (POLAR str_top PI (+(* trd_wid 0.5) strflg_wid)) tr_str_pt (POLAR tl_str_pt 0 (+ trd_wid strflg_wid)) bl_str_pt (POLAR tl_str_pt (* PI 1.5) (+ str_hgt 8.0));8" at bottom br_str_pt (POLAR bl_str_pt 0 (+ trd_wid strflg_wid)) )) ) ;_ end of COND (SETQ strp_01 firstp_01) (SETQ trd_elf T) (SETQ stair_parts (SSADD)) (WHILE (<= trdcnt num_trd) (maketread strp_01 PI) (SSADD (ENTLAST) treads) (SETQ trdcnt (1+ trdcnt)) (make_strhids "HDBOX" (POLAR strp_01 (* PI 1.5) trd_thk) 0 trd_wid trd_thk ) ;_ end of make_strhids (SETQ strp_01 (POLAR strp_01 (* PI 1.5) ris_hgt)) ) ;_ end of while (SETQ trd_elf NIL) (SETQ tread_sscnt 0) (WHILE (SETQ trdename (SSNAME treads tread_sscnt)) (SETQ trdent (ENTGET trdename)) (ENTMAKE (CDR trdent)) (SSADD (ENTLAST) stair_parts) (ENTDEL trdename) (SETQ tread_sscnt (1+ tread_sscnt)) ) ;_ end of while (SETQ tl_str_pta (POLAR tl_str_pt 0 strflg_wid) bl_str_pta (POLAR bl_str_pt 0 strflg_wid) tr_str_pta (POLAR tr_str_pt 0 strflg_wid) br_str_pta (POLAR br_str_pt 0 strflg_wid) ) (make_strhids "HDBOX" bl_str_pt 0 strflg_wid (DISTANCE tl_str_pt bl_str_pt) ) ;_ end of make_strhids (make_strhids "HDBOX" br_str_pt 0 strflg_wid (DISTANCE tr_str_pt br_str_pt) ) (COMMAND "_.pline" tl_str_pt tl_str_pta bl_str_pta bl_str_pt tl_str_pt "c") ;Stair stringer outline (SSADD (ENTLAST) stair_parts) (COMMAND "_.pline" tr_str_pt tr_str_pta br_str_pta br_str_pt tr_str_pt "c") ;Stair stringer outline (SSADD (ENTLAST) stair_parts) (SETQ mjrg "S" prod "CONC" colr "4" modf "SLAB" ) ;_ end of SETQ (c:mklayr) (COND ((OR (AND (EQ top_stp "No")(EQ bot_stp "No"))(AND (EQ top_stp "Yes")(EQ bot_stp "Yes"))) (SETQ bot_lc1 (POLAR strp_01 PI 6.0))) ((EQ top_stp "Yes") (SETQ bot_lc1 (POLAR strp_01 PI 6.0))) ((EQ bot_stp "Yes") (SETQ bot_lc1 (POLAR strp_01 PI 6.0))) ) (SETQ bot_lc2 (POLAR bot_lc1 0 (+ trd_wid 12.0)) bot_lc3 (POLAR bot_lc2 (* PI 1.5) 4.0) bot_lc4 (POLAR bot_lc1 (* PI 1.5) 4.0) ) ;_ end of setq (make_strhids "HDBOX" bot_lc4 (ANGLE bot_lc1 bot_lc2) (DISTANCE bot_lc1 bot_lc2) (DISTANCE bot_lc1 bot_lc4) ) ;_ end of make_strhids ;;; (make_strhids ;;; "HDBOX" ;;; bot_lc3 ;;; (ANGLE bot_lc3 bot_lc4) ;;; (DISTANCE bot_lc1 bot_lc2) ;;; (DISTANCE bot_lc1 bot_lc4) ;;; ) ;_ end of make_strhids ;;; ) ;_ end of if (COMMAND "_.pline" bot_lc1 bot_lc2 bot_lc3 bot_lc4 bot_lc1 "c") ;Base landing concrete stoop (SSADD (ENTLAST) stair_parts) (SETQ grp_name_a (RTOS (FIX (GETVAR "cdate")) 2 0) grp_name_b (SUBSTR (RTOS (REM (GETVAR "cdate") 1) 2 8) 3) grp_name_c (STRCAT "STAIR_" (RTOS str_hgt 2 0)) bang_str (STRCAT "STAIR") ) ;_ end of setq (COMMAND "-group" "create" (STRCAT grp_name_a grp_name_b grp_name_c) bang_str stair_parts "" ) ;_ end of COMMAND (COMMAND "_.undo" "end") (SETVAR "osmode" old_osmode) ;;; (SETVAR "pprotx_ptlst" old_plinetype) (c:rslayr) (PRINC) ) ;_ end of defun (DEFUN maketread (pt ang /) (SETQ trdpt2 (POLAR pt (+ ang PI) (IF (AND (NOT trd_elf)(<= (DISTANCE pt str_top) (1+ trd_dpt))) (DISTANCE pt str_top) (IF trd_elf trd_wid (1+ trd_dpt) ) ) ;_ end of if ) ;_ end of polar trdpt3 (POLAR trdpt2 (+ ang (* PI (IF (EQ ang PI) 0.5 1.5 ) ;_ end of if ) ;_ end of * ) ;_ end of + trd_thk ) ;_ end of polar trdpt4 (POLAR pt (+ ang (* PI (IF (EQ ang PI) 0.5 1.5 ) ;_ end of if ) ;_ end of * ) ;_ end of + trd_thk ) ;_ end of polar ) ;_ end of setq (COMMAND "_.pline" pt trdpt2 trdpt3 trdpt4 "c") (PRINC) ) ;_ end of defun ;|«Visual LISP© Format Options» (72 2 40 2 T "end of " 60 9 2 0 0 nil T nil T) ;*** DO NOT add text below the comment! ***|;