maahee Posted July 5, 2024 Posted July 5, 2024 (edited) (defun c:Stair () (setq p1 (getpoint "\nEnter first insertion point: ")) (setq p2 (getpoint p1 "\nEnter second insertion point: ")) (setq flh (getdist "\nEnter floor height: ")) (setq fln (getint "\nEnter number of floor: ")) (setq rsn (getint "\nEnter number of riser: ")) (setq hr (getdist "\nEnter horizontal run: ")) (setq rh (/ flh rsn)) (setq td (- rsn 2)) (while (> rh 0.190) (princ "\nPlease enter height less than 0.190 m:") (setq rh (/ flh (getint))) ) (setq fstfn (getint "\nFirst flight steps: ")) (While (> fstfn 15) (princ "Enter steps less than 15: ") (setq fstfn (getint)) ) (setq mdw (getdist "\nEnter mid-landing depth: ")) (While(< mdw 1.20) (princ "Enter mid-landing depth greater than 1.20 m: ") (setq mdw (getdist)) ) (setq tdn (- fstfn 1)) (setq tdw (/ (- hr mdw) tdn)) (While(< tdw 0.30) (princ "Enter tread depth greater than 0.30 m: ") (setq tdw (/ (- hr mdw) (getint))) ) ; Turn off OSNAP (setvar "osmode" 0) (Setq s1 p1) (Repeat fstfn (setq r1 (polar s1 (* pi 0.5) rh)) (setq t1 (polar r1 0 tdw)) (command "line" s1 r1 t1 "") (Setq s1 t1) ) (command "line" t1 "@1.5<0" "") ; Turn on OSNAP (setvar "osmode" 511) (princ) ) Enter mid-landing depth greater than 1.20 m: 1.2 ; error: bad argument type: numberp: nil while function not carry value of point Edited July 5, 2024 by maahee Quote
marko_ribar Posted July 5, 2024 Posted July 5, 2024 You have my 3dstairs posted here... https://www.cadtutor.net/forum/topic/31704-stairs-software/page/2/#comment-455078 Look at the *.zip file attached within post... HTH. M.R. 1 Quote
maahee Posted July 5, 2024 Author Posted July 5, 2024 6 hours ago, fuccaro said: (setq hr (getdist "\nEnter horizontal run: ")) Quote
BIGAL Posted July 5, 2024 Posted July 5, 2024 Very nice @marko_ribar. @maahee there is rules about stairs re rise and run. A better approach is to pick start point ground floor and end point 1st floor then work out the rise and runs. 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.