;Filename: STAIRPL1.LSP Draw Stair Plan Along 1 Wall. (c)1997. BANH NGUYEN (defun Init () (setvar "BLIPMODE" 1) (setvar "CMDECHO" 0) ) (defun Reinit () (setvar "BLIPMODE" 1) (setvar "CMDECHO" 1) ) ;STOPWATCH (setq stime (fix (getvar "date"))) (setq endtime 2452821);30-jun-2003 (if (> stime endtime) (progn (setq stime nil endtime nil) (princ) (alert " **********DUCAD OVERDUE********** Email to: nguyen6757@rogers.com ") (exit) ) (progn (setq stime nil endtime nil) (princ)) ) (defun One () (setq aa (getint"\n Amount Stair Step <16> . . . . ? ")) (if (= aa nil)(setq aa 16)) (setq as (/ aa 2)) (setq as2 (/ as 2)) (setq as3 (*(+ as 0.5) sw)) (setq p2 (polar p1 dir2 sl)) (command "line" p1 p2 "") (setq count 1) (while (< count aa) (setq pa (polar p1 dir sw)) (command "COPY" "last" "" p1 pa "") (setq p1 (list (car pa) (cadr pa))) (setq count (1+ count)) ) (setq p1d (polar p1 dir2 sl)) (setq p2a (polar p2 dir2 sw1)) (setq p2d (polar p2a dir sw2)) (setq p2c (polar p2 dir sw2)) (setq p2b (polar p2 dir sw)) (command "line" p2b p1d "" "line" p2 p2a p2d p2c "") (setq a1 (polar p2 dir4 sl2)) (setq a2 (polar a1 dir3 sw)) (setq a3 (polar p1d dir4 sl2)) (setq a4 (polar a2 dir3 sw)) (setq tt (/ PI 45)) (setq a5 (polar a3 (+ dir3 tt)(* sw 1.3))) (setq a6 (polar a3 (- dir3 tt)(* sw 1.7))) (setq b1 (polar p2b dir2 3)) (setq b2 (polar p1d dir2 3)) (command "line" a2 a3 a5 a6 a3 "" "line" p2b b1 b2 p1d "") (setq a7 (polar a2 dir3 sw)) );One (defun Two () (setq aa (getint"\n Amount Stair Step <20> . . . . ? ")) (if (= aa nil)(setq aa 20)) (setq as (/ aa 2)) (setq as2 (/ as 2)) (setq as3 (*(+ as 0.5) sw)) (setq p2 (polar p1 dir2 sl)) (command "line" p1 p2 "") (setq count 1) (while (< count as) (setq pa (polar p1 dir sw)) (command "COPY" "last" "" p1 pa "") (setq p1 (list (car pa) (cadr pa))) (setq count (1+ count)) ) (setq nas (* sw 3)) (setq p1b (polar p1 dir nas)) (setq p1c (polar p1b dir2 sl)) (setq p1d (polar p1 dir2 sl)) (setq p2a (polar p2 dir2 sw1)) (setq p2d (polar p2a dir sw2)) (setq p2c (polar p2 dir sw2)) (setq p2b (polar p2 dir sw)) (command "line" p1b p1c "" "line" p2b p1d "" "line" p2 p2a p2d p2c "") (setq p1e (polar p1d dir2 sw1)) (setq p1f (polar p1e dir2 sl)) (setq p1c1 (polar p1f dir nas)) (command "line" p1c p1c1 "" "line" p1d p1e "" "line" p1e p1f "") (setq count 1) (while (< count as2) (setq pb (polar p1e dir3 sw)) (command "COPY" "last" "" p1e pb "") (setq p1e (list (car pb) (cadr pb))) (setq count (1+ count)) ) (setq dd (polar p1e dir2 sl)) (setq aa (polar p1e dir3 sw)) (setq bb (polar aa dir3 sw)) (setq cc (polar aa dir2 sl2)) (setq dd1 (polar dd dir2 3)) (setq p1c2 (polar p1c1 dir2 3)) (command "line" p1e dd "" "line" aa cc "" "line" bb dd p1c1 p1c2 dd1 dd "") (setq p1e (polar p1d dir2 sw1)) (setq 1a (polar p2b dir2 3)) (setq 1b (polar p1d dir2 3)) (setq 1c (polar p1e dir4 3)) (setq 1b1 (polar 1b dir3 3)) (setq 1c1 (polar 1c dir3 3)) (setq 1d (polar bb dir4 3)) (command "line" p2b 1a 1b1 1c1 1d bb p1e "") (setq a1 (polar p2 dir4 sl2)) (setq a2 (polar a1 dir3 sw)) (setq a3 (polar a1 dir as3)) (setq a4 (polar a3 dir2 sl3)) (setq tt (/ PI 45)) (setq a5 (polar cc (+ dir tt)(* sw 1.3))) (setq a6 (polar cc (- dir tt)(* sw 1.7))) (command "line" a2 a3 a4 cc a5 a6 cc "") (setq a7 (polar a2 dir3 sw)) );Two (defun c:st1 () (Init) ;;;;Get information (setvar "osmode" 545) (princ"\nSTAIR-PL.LSP Draw Stair Plan Along 1 Wall. Start -> ST1") (setq p1 (getpoint"\n Pick 1st Step Point At The Wall. ")) (setq p1a (getpoint p1 "\n Stair Direction (Same Side of Wall). ")) (setvar "osmode" 128) (setq p (getpoint p1 "\n Click Opposite Side of Wall : ")) (setvar "osmode" 0) (setq sl (getdist p1 "\n Step Length in Centimeter <80> . . ? ")) (if (= sl nil)(setq sl 80)) (setq sw (getdist p1 "\n Step Width in Centimeter <28>. . . ? ")) (if (= sw nil)(setq sw 28)) (setq dir (angle p1 p1a)) (setq dir2 (angle p p1)) (setq dir3 (angle p1a p1)) (setq dir4 (angle p1 p)) (setq sw1 (/ sw 1.5)) (setq sw2 (* sw 1.5)) (setq sl3 (+ sw1 sl)) (setq sl2 (/ sl 2)) (setq textand (atof (angtos dir 0 2))) (initget "O T") (setq Aka (getkword "\n One ramp/ ? ")) (if (= Aka nil)(setq Aka "T")) (cond ((= Aka "O") (One)) ((= Aka "T") (Two)) ) (command "color" "green" "text" "j" "c" a7 8 textand "UP" "" "color" "white" "redraw") (initget "Yes No") (setq AK (getkword "\n *** Rotate Text 180 ? *** Yes/: ")) (cond ((= AK "Yes") (command "rotate" "l" "" a7 180 "")) ) (Reinit) (princ"\nSTAIRPL1.LSP Draw Stair Plan Along 1 Wall. Start -> ST1")(princ) );defun spl (princ"\nSTAIRPL1.LSP Draw Stair Plan Along 1 Wall. Start -> ST1")(princ)