i have 2 routines
1-draws a solid with top and base radius,number of polygon sides,height and insertion point
you can see how the first one works here:
(defun c:2 ()
(defun Radians->Degrees (rads)
(* rads (/ 180.0 pi))
)
(setq radius (getdist "\n top radius: "))
(setq baseradius (getdist "\n base radius: "))
(setq height (getdist "\n height: "))
(setq angRad (atan (- radius baseradius) height))
(setq angDeg (Radians->Degrees angRad))
(setq sides (getint "\n number of polygon sides: "))
(setq centerpt (getpoint "\n insertion point: "))
(setq osnaps (getvar "osmode"))
(setvar "osmode" 0)
(command "polygon"
sides
centerpt
"C"
(polar centerpt 0 radius)
)
(command "extrude" (entlast) "" height angDeg)
(setvar "osmode" osnaps)
)
now what i would like to do is to ask the user,after the solid is defined,if he wants to continue(c) or to exit(x) if he choses to continue a spiral is drawn accordind to the questions previously answered in the solid routine,at this point there are only 2 questions to ask:
1-number of turns
2-extrusion path
here's the spiral routine:
(defun C:spiral()
(command "erase" "all" "")
(command "osnap" "off")
(command "ortho" "off")
(command "ucsicon" "off")
(setq
segs (getreal "Number of segments: ")
spin -1
ri (getreal "Base radius: ")
rf (getreal "Top radius: ")
rt (getreal "Extrusion radius: "));setq
(setq h (getreal "Elevation: "))
(setq ns (getint "Number of spirals: "))
(setq
tu (getreal "Turns: ")
old (getvar "osmode")
fi1 (/ (* 2 PI) segs)
i 0
points (fix (* tu segs))
h1 (/ h points)
r1 (/ (- rf ri) points)
s (getpoint "Center of base: ")
end (list (car s) (cadr s) (+ h (caddr s))));setq
(setvar "osmode" 0 )
(command "line" s end "")
(command "chprop" "l" "" "c" 1 "")
(command "3dpoly")
(setq i 0)
(repeat (1+ points)
(setq
fi (* i fi1)
h (* i h1)
r (+ ri (* i r1))
x (* r (cos fi))
y (* spin r (sin fi)));setq
(command (list (+ (car s) x) (+ (cadr s) y) (+ (caddr s) h)))
(setq i (1+ i)));repeat
(command "")
(setvar "osmode" old)
(setq spiral (entlast))
(command "ucs" "n" "za" (polar s 0 ri)
(list
(+(car s) (* ri (cos fi1)))
(+(cadr s) (* spin ri (sin fi1)))h1))
(command "circle" "0,0,0" rt)
(command "extrude" (entlast) "" "p" spiral)
(setvar "osmode" old)
(command "ucs" "p")
(command "array" (entlast) "" "p" s ns 360 "y")
(command "view" "swiso")
(command "_zoom" "e")
(command "shademode" "g")
); defun
please help
thanks