Jump to content

Get your Helix here!


CADTutor

Recommended Posts

I received some requests like:

"I wish to draw a helix. I find this forum with Lisp routines. How next?"

Here are more ways to load lisp routines. For beginners I recommend to fallow this few steps:

1. Open the Notepad on your computer

2. Select (highlight) the program lines in your browser. Press CTR+C to copy it to clipboard.

3. Return to Notepad and press CTR+V to insert the text.

4. Save the file as AnyName.LSP -extension is important

5. Close Notepad and open a new drawing in AutoCAD

6. To load the application in AutoCAD use any of the following methods:

- At the Command prompt, type APPLOAD. In the opened new window, navigate until you find the file you just saved. Select it, then press LOAD and CLOSE.

- On the TOOLS menu, choose LOAD APPLICATION. Than you continue like above.

- Drag the AnyName.LSP programs icon over the AutoCAD window

7. Check the command line (press F2 if necessaries). You will see something like

Command: (LOAD "C:/ My Documents/autolisp/AnyName.lsp") C:HELIX1

8. Retain the last word (HELIX1, in this case). It's the name of a new function you may call any time during this session, in this drawing

9. Type this name at the Command prompt. Enter the radius, height etc. as you are prompted.

 

And now it's my turn to ask: somebody please tells me why (almost) anybody wants to draw a helix?

Link to comment
Share on other sites

  • Replies 51
  • Created
  • Last Reply

Top Posters In This Topic

  • fuccaro

    13

  • CADTutor

    8

  • Mr T

    6

  • tlyall

    3

Top Posters In This Topic

Posted Images

spring.jpg.a5fdec81046efc0cf6cc402f511845ca.jpg

 

Here is a Lisp routine I wrote to draw a spring. The new thing is the possibility to control the diameter and the pitch in each point.

Before call the routine, you will need to make some preparations. So, draw the axis of the helix: a horizontal line from (0,0) to right, as long as the helix length is (the green line in the next image).

Draw a polyline over this axis (over means greater Y coords). I named this pline "radius poly", is the envelope of the helix (the red pline). Under the axis (Y

Now you may type SPR and answer as you are prompted. In the next image I marked with p1...p5 the answers I give to generate the example in the image above.

A final advice: the drawing area used by this routine must be clean, work on a new layer and turn off the others.

 

poly.gif.b5a7ae9902f2e3a1a95f4d0e942351d5.gif

 

(if the images are missing from here, you may find them on my web page

http://fuccaro.netfirms.com

Sorry, problems with my web host)

 

(defun distance (r pol) 
(setvar "osmode" 0) 
(command "._line" (list z 0) (list z r) "") 
(setvar "osmode" 1) 
(command "._trim" pol "" (list z r) "") 
(setq ent (entget (entlast))) 
(entdel (entlast)) 
(abs (caddr (assoc 11 ent))) 
) 

(defun C:Spr() 
(setvar "cmdecho" 0) 
(setq hm (getdist (list 0 0 0) "\nhelix axis endpoint")) 
(setq rpol (entsel "\nselect radius polyline")) 
(setq rm (* 1.1 (cadr (getpoint "\ntop of radius poly")))) 
(setq dpol (entsel "\nselect axial pitch polyline")) 
(setq pm (* 1.1 (cadr (getpoint "\nbottom of pitch poly")))) 
(command "._plan" "") 
(setq poi (getreal "\nsegments/turn? (3...100)")) 
(command "._zoom" "w" (list -1 pm) (list (+ 2 hm) rm)) 
(setq coords nil) 
(setq alpha1 (/ (* 2 PI) poi)) 
(setq z 0 alp 0) 
(setq old (getvar "osmode")) 
(while (<= z hm) 
 (setq r0 (distance rm rpol) 
 d0 (distance pm dpol) 
 x (* r0 (sin alp)) 
 y (* r0 (cos alp)) 
 z (+ z (/ d0 poi))) 
 (setq point (list z y x)) 
 (setq coords (cons point coords)) 
 (setq alp (+ alp alpha1)) 
) ;while 
(setvar "osmode" 0) 
(command "._3dpoly") 
(foreach point coords (command point)) 
(command "") 
(command "._zoom" "w" (list 0 (- 0 rm)) (list hm rm)) 
(setvar "osmode" old) 
(setvar "cmdecho" 1) 
) 
 
Link to comment
Share on other sites

  • 1 month later...

Here I go again. I have a dream about a spiral and am struggling to make it reality. So far, unsuccesful.

Resumee:

 

Using: autocad 2002

Target: spiral

Experience:- with Fuccaros help I taught how to use lisp rutines.

- used few lisps for spring/ spiral, including the Fuccaros, Davids and Nicks suggestions ( ref. to sites).

- i could see that in all the cases my spiral is flat ( in the same plan and the possiblity to extrude an object on it is not available, of course).

 

Rolling eyes:- what am I doing wrong or what am I missing? For sure I am missing something important. :idea:

 

Thank you for your support and advice

Link to comment
Share on other sites

  • 1 year later...

Hey Fuccaro.. O' wise lisp GURU...lol

 

Excellent routine this is... here THE ORIGINAL HELIX very useful...

 

Problem is I do alot of 3- solid mechanicals and I always have to fudge the threads so that they look somewhat correct.

I know there are some other great lisps out there for threads, but I was wondering if this one can be altered to accept other shape.

 

Can the initial HELIX routine be altered so that more than a circle can be used to extrude along the path? If so.. this would make creating threads a snap!

 

YOU DO GREAT WORK MAN :!: :!:

Link to comment
Share on other sites

Try the HELSURF... or maybe the SPIREX?

 

Thanks Fuccaro... I tried the helsurf, not bad I must say... Problem is it is a mesh... really need a solid lisp. I am still searching the web for the spirex lisp... not much luck yet though.

 

Thannks again for your time.

Link to comment
Share on other sites

  • 2 weeks later...
Guest sada nada

thank u for every thing it was avery nice descation & helpful Im sorry that Im impoor in that descation one more Q. whats the deffrince between code and commend?

 

 

 

 

thnks to all

Link to comment
Share on other sites

  • 9 months later...
  • 4 months later...
Guest alanie88

hi all,

 

i already uploaded the helix.lisp and it works, thanks!

this is to mr. fucarro, how do you make a screw, like the one you posted in this forum. i already made a sample screw but its thread doesn't look like the one you posted...

 

thanks

alanie o:)

Link to comment
Share on other sites

  • 4 weeks later...

I am not welll versed in Lisp and I have a specific need to make an equiangular conical spiral. All of the Lisp scripts I've found are made to generate Archimedean conical spirals but not the logarithmic ones. :(

 

Is there a simple way to rewrite helix.lsp to produce equiangular conical spirals? :huh:

Link to comment
Share on other sites

Hi.

I am a bit new to all this so i hope this is the correct way to post. I am very interested in the helsurf lisp, i have managed to copy/save etc but when i try to load and run it i get this message in the text window.

 

 

 

Command: _appload helsurf.lsp successfully loaded.

 

 

Command: ; error: bad character read (octal): 21

 

 

 

 

any help would be much appreciated.

 

thanks

 

Neil

Link to comment
Share on other sites

@fuccaro

 

I am doing a work on equiangular spiral conical antennas. I need a lisp routine pretty much simillar to the existing helix routines except that it should calculate points for equiangular helix and not for archimedean one. All of the input parameters can be pretty much the same except that one should not specify pitch since it will be variable because of the fixed angle.

 

 

Now as you may have known there are a two most common types of spirals Archimedean and logarithmic.

 

 

The logarithmic spiral can be distinguished from the Archimedean spiral by the fact that the distances between the arms of a logarithmic spiral increase in geometric progression, while in an Archimedean spiral these distances are constant.

 

So, the main difference between those two are in the way points are calculated. You can find more info on logarithmic spirals here:

 

http://en.wikipedia.org/wiki/Logarithmic_spiral

 

and on logarithmic conical helixes

 

http://www.mathematische-basteleien.de/spiral.htm

 

 

As for example of the commercial conical log spiral antennas

 

http://www.ets-lindgren.com/pdf/Ant8.pdf

 

 

 

 

TIA for any help. :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...