; PARK.LSP Copyright 1989,90,91,92 Tony Tanzillo All Rights Reserved. ; ; This program automates the layout of rows of right-angle parking spaces ; (or more accurately, the striping for parking spaces). Great for site ; planning/layout work. Automatically calculates the reqired stall width ; above a specified minimum, to fit the maximum number of stalls into the ; specified area. ; ; No further documentation available, just follow the prompts. (defun C:STALL90 ( / +pi/2 -pi/2 sc sw sl sxw st p1 p2 p3 p4 a d l hi bm) (setq +pi/2 '((a) (+ a (/ pi 2.0))) -pi/2 '((a) (- a (/ pi 2.0)))) (initget 7) (setq sw (getdist "\nMinimum stall width: ")) (setq sl (getdist "\nStall depth: ")) (initget "Single Double") (setq st (cond ((getkword "Single- or Double-loaded : ")) (t "Double"))) (initget "Entity") (setq p1 (cond ((getpoint "\nFirst alignment point/: ")) (t "Entity"))) (cond ( (eq p1 "Entity") (setq l (entsel "\nSelect line: ")) (setq l (entget (car l))) (setq p1 (cdr (assoc 10 l)) p2 (cdr (assoc 11 l)))) (t (setq p2 (getpoint p1 "\nSecond alignment point: ")))) (cond ( (eq st "Single") (setq p3 (getpoint "\nWhich side of alignment: ")))) (setq d (distance p1 p2)) (setq a (angle p1 p2)) (setq sc (fix (/ d sw))) (setq sxw (/ d sc)) (if p3 (setq p4 (inters p1 p2 p3 (polar p3 (+pi/2 a) 1.0) nil))) (princ (strcat "\nDrawing " (cond (p3 "") (t "2 x ")) (itoa sc) " stalls @ " (rtos sxw) " wide x " (rtos sl) " deep.")) (setvar "cmdecho" 0) (setq hi (getvar "highlight")) (setq bm (getvar "blipmode")) (setvar "highlight" 0) (setvar "blipmode" 0) (command ".line" p1 p2 "") (cond (p3 (command ".line" p1 (polar p1 (angle p4 p3) sl) "")) (t (command ".line" (polar p1 (+pi/2 a) sl) (polar p1 (-pi/2 a) sl) ""))) (command ".UCS" "Z" (* a (/ 180.0 pi)) ".array" (entlast) "" "R" "1" (1+ sc) sxw ".UCS" "P" ) (setvar "highlight" hi) (setvar "blipmode" bm) (princ) ) ; --------------------------------eof park.lsp-------------------------