Thank you very much.
Lasitha
Lasitha
"LS" <lasithas...@sbcglobal.net> wrote in message
news:W%3Og.1560$7I1...@newssvr27.news.prodigy.net...
==============
You want an add-in program to generate the helix. Actually it
won't be a true smooth helix but a short line approximation of a
true helix.
Most versions of AutoCad and the clones have hooks for both stand
alone programming languages such as BASIC and C and built-in LISP
interpreters.
I did not write the following programs.
========= 3-d helix =========
(defun c:helix (/ revs divs cen rad rinc sta ht hinc revcnt r
x y a z)
;
; fuction to creat a 3d spiral
; in the form of a 3dpoly (a zero-width wire spring)
;
(graphscr)
(setq revs(getreal"\nnumber of revolutions? ")
divs(getint"\nnumber of divisions per revolution? ")
cen(getpoint"\ncenter of bottom loop? ")
rad(getdist"\nbeginning radius? ")
rinc(getdist"\nradius increment? ")
sta(getangle"\nstarting angle? ")
ht(getdist"\nbeginning height between loops? ")
hinc(getdist"\nheight increment? ")
sta (/(* sta pi)180.0) a sta z (caddr cen) r 0 revcnt 0)
(command "3dpoly")
(while(< r revs)
(setq x(+(car cen)(* rad(cos a)))
y(+(cadr cen)(* rad(sin a))))
(command (list x y z))
(setq a(+ a(/(* 2.0 pi)divs))
z(+ Z(/ ht divs))
r(+ r(/ 1.0 divs))
revcnt(1+ revcnt)
rad(+ rad(/ rinc divs)))
(if(equal revcnt divs)
(setq ht(+ ht hinc) revcnt 0))
)
(command "")
)
===================================
============ 2-d helix or spiral ===========
;
; Display spiral
;
; Designed and implemented by Kelvin R. Throop on 1985
January 85
;
; (cspiral <# rotations> <base point> <growth per rotation>
; <points per circle>)
;
(defun cspiral (ntimes bpoint cfac lppass / ang dist tp ainc dinc
circle bs cs)
(setq cs (getvar "cmdecho"))
(setq bs (getvar "blipmode"))
(setvar "blipmode" 0)
(setvar "cmdecho" 0)
(setq circle (* 3.141596235 2))
(setq ainc (/ circle lppass))
(setq dinc (/ cfac lppass))
(setq ang 0.0)
(setq dist 0.0)
(command "pline" bpoint)
(repeat ntimes
(repeat lppass
(setq tp (polar bpoint (setq ang (+ ang ainc))
(setq dist (+ dist dinc))))
(command tp)
)
)
(command)
(setvar "blipmode" bs)
(setvar "cmdecho" cs)
nil
)
;
; Interactive spiral generation
;
(defun C:SPIRAL ( / nt bp cf lp)
(prompt "\nCentre point: ")
(setq bp (getpoint))
(prompt "\nNumber of rotations: ")
(setq nt (getint))
(prompt "\nGrowth per rotation: ")
(setq cf (getdist bp))
(prompt "\nPoints per rotation: ")
(setq lp (getint))
(cond ((null lp) (setq lp 30)))
(cspiral nt bp cf lp)
)
=================================
For more details see you program documentation.
(1) cut and paste the above programs into seperate text files
with the extension .lsp using a text only ASCII editor like
notepad that does not add formatting or extra non-printing
characters.
(2) at your cad program command prompt type >load filename [with
drive and path as required]<
(3) to start the program you will need to type in the name of
the function, in this case <helix> or <cspiral> at your cad
system command prompt *NOT* the name of the file you created from
step (1) and that you loaded the program with.
FWIW -- This is controlled by the line < defun c:helix (/ revs
divs cen rad rinc sta ht hinc revcnt r x y a z) > so you can
change the name after the c: if you want/need to. If you load
two LISP programs with the same c: name the last one will
overwrite the first, even if the file names are different.
Good luck on your project. LISP and other program add-ins can
greatly expand the functionality and productivity of the basic
cad program. Google on <LISP OR lsp Autocad download> for an
enormous number of free and share ware add-ins.
Please let the group know if you found this helpful, and the
grade you get.
Unka George (George McDuffee)
.....................................................................
The arbitrary rule of a just and enlightened prince is always bad.
His virtues are the most dangerous and the surest form of seduction:
they lull a people imperceptibly into the habit of loving, respecting,
and serving his successor, whoever that successor may be,
no matter how wicked or stupid.
Denis Diderot (1713-84), French philosopher.
Refutation of Helvétius (written 1773-76;
first published 1875; repr. in Selected Writings,
ed. by Lester G. Crocker, 1966).
>(1) cut and paste the above programs into seperate text files
>with the extension .lsp using a text only ASCII editor like
>notepad that does not add formatting or extra non-printing
>characters.
>
>(2) at your cad program command prompt type >load filename [with
>drive and path as required]<
They seem to have some program called "CADMAX".
Perhaps we should ask jb to compare it with sliced bagels.
--
Cliff
================
Request was posted in the AutoCad/Intellicad/etal newsgroups.
Both the posted programs work for me with ICAD5.1PE+.