Thanks guys.
I did not see problem with the code & it worked for me in ACAD2000.
Here are some changes I would make though. Mostly the use of getdist to
replace getreal. Also localized the functions
(defun c:2 (/ usercmd useros radius height angDeg sides centerpt baseradius
dtr rtd)
(defun dtr (a) (* pi (/ a 180.0)))
(defun rtd (a) (* 180.0 (/ a pi)))
(command "._undo" "_begin")
(setq usercmd (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
(setq useros (getvar "osmode"))
(if (and
(setq radius (getdist "\n larger radius: "))
(setq baseradius (getdist "\n smaller radius: "))
(setq height (getdist "\n height: "))
(setq angDeg (- 90.0 (rtd (atan height (- radius baseradius)))))
(setq sides (getint "\n number of polygon sides: "))
(setq centerpt (getpoint "\n insertion point: "))
)
(progn
(setvar "osmode" 0)
(command "._polygon" sides centerpt "_C" radius)
(command "._extrude" (entlast) "" height angDeg)
)
)
(setvar "osmode" useros)
(setvar "CMDECHO" usercmd)
(command "._undo" "_end")
(princ)
)
(prompt "\nRoutine 2 Loaded, Enter 2 to run.")
(princ)