;for room with flat ceiling and walls perpendicular to ground ONLY
(defun c:wa ( / p1 p2 height) ;erects walls by clicking on ground points
(command "layer" "make" "walls" "color" "white" "walls" "set" "walls" "") ;makes layer for walls and makes it yellow
(setq height 30)
; (setq height (getreal "enter height of wall: "))
(if (< height 0)
(setq height (get_dist)))
(setq p1 (getpoint "pick first point from ground: ")) ;start with 2 points and height
(setq p2 (getpoint "pick second point from ground: "))
(while (not (or (eq p1 nil) (eq p2 nil))) ;keep on making one wall at a time from selected points until no more points are selected
(print p1) ;for testing purposes
(print p2) ;for testing purposes
(make_one_wall p1 p2 height)
(setq p1 p2)
(setq p2 (getpoint "pick next point from ground: ")))) ;to stop making walls, hit enter without selecting a point
(defun make_one_wall (p1 p2 height / ) ;draws one wall given 2 ground points and the height
(command "3dface" p1 p2 (extruded_pt p2 height) (extruded_pt p1 height) ""))
(defun extruded_pt (p height / ) ;given a ground point, finds its corresponding ceiling point
(list (x p) (y p) (+ height (z p)))) ; need abstractions
(defun get_dist ( / dist)
(getdist "how far? "))