Helo:
I would really appreciate someone's help on this,here it goes:
Do you know if it's possible to draw a solid in autocad such as a pyramid/cone only the
object doesn't end in a vertex as usual,the top radius is not zero but can be defined by
the user creating something like a distort prismatic solid.There's a command in autocad
called solids in the draw bar.
After the user defines the top and base radius ,
the height of the "pyramid" and the number of segments that define both bases(top and base)
i would like the user to be able to create a spiral revolving arround the solid.
the idea is to attach this code to the solid that the user would define first.
Then the user could define how many spirals and how many turns they would give arround the solid.
What do you think?
Thank you for your help
here's the code:
(alert "to initiate type spiral")
(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 (getreal "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