Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

3D CYLINDER LISP

19 REPLIES 19
Reply
Message 1 of 20
Anonymous
2137 Views, 19 Replies

3D CYLINDER LISP

Hi,

Hoping someone could point out a lisp that will draw a 3d solid cylinder
based on selecting endpoints and specifying a diameter. Of course it has to
be able to do it regardless of ucs settings. Anybody know where to find one?

PS. tried www.cadalog.com already, no luck.

Thx.
19 REPLIES 19
Message 2 of 20
Anonymous
in reply to: Anonymous

Try 1)www.autosolids.com 2)do it without lisp by drawing a
circle, extrude the circle and use vpoint to whatever ucs
you want and 3)wait till someone post or send you the lisp.
Message 3 of 20
Anonymous
in reply to: Anonymous

What's wrong with the CYLINDER command? ...or just drawing a circle and
EXTRUDEing it?
___

"The real JD" wrote in message
news:A3F53D567651B54C49B54C453451B3C7@in.WebX.maYIadrTaRb...
>
> Hoping someone could point out a lisp that will draw a 3d solid cylinder
> based on selecting endpoints and specifying a diameter. Of course it has
to
> be able to do it regardless of ucs settings. Anybody know where to find
one?
Message 4 of 20
old-cadaver
in reply to: Anonymous

Gee Paul, beat me to it. CYLINDER->(pick center)->(enter radius)->C (for center other end)->(pick enter other end). Of course you can write a script or lisp to add the "C" I guess.
Message 5 of 20
Anonymous
in reply to: Anonymous

I just want it to work regardless of ucs. I know
about the Cylinder command. But when you use it, it extrudes based on your
current ucs. then i have to rotate or align the cylinder to have it match
up.

So...

Looking for

pick endpoint of cylinder

pick other enpoint

specify dia.

 

that's it.

Try to do a cylinder by picking two points with the
z value of zero, you'll see what i mean.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Gee
Paul, beat me to it. CYLINDER->(pick center)->(enter radius)->C (for
center other end)->(pick enter other end). Of course you can write a script
or lisp to add the "C" I guess.
Message 6 of 20
old-cadaver
in reply to: Anonymous

What version of ACAD are you using? In R14+ the CYLINDER command will create cylinders in any direction regardless of UCS orientation. Read the prompts, after entering the radius it asks "Specify height of cylinder or [Center of other end]:" Enter a C (for Center other end) then pick something.
Message 7 of 20
Anonymous
in reply to: Anonymous

Using A2ki. Seems to extrude based on my current
UCS. Maybe there's a system variable for this?

 

Have you tried creating a cylinder
with:

UCS world,

and picking to points with the same z and have it
work. If so, it's not working for me. it always creates the cylinder extruded,
based on UCS.

 

Really, i tried picking center for both endpoints,
but it doesn't work right. I have to rotate the cylinder and align it to the
points i originally selected.

 

Thx for the feedback.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
What
version of ACAD are you using? In R14+ the CYLINDER command will create
cylinders in any direction regardless of UCS orientation. Read the prompts,
after entering the radius it asks "Specify height of cylinder or [Center of
other end]:" Enter a C (for Center other end) then pick
something.
Message 8 of 20
Anonymous
in reply to: Anonymous

Well ... if you insist:

(defun C:CYL (/ p1 p2 dia)
(setq p1 (getpoint "\nStarting point: ")
p2 (getpoint "\nEnding point: ")
dia (getdist "\nDiameter: "))
(command "_.cylinder" p1 (/ dia 2.0) "_c" p2)
(princ)
)
___

"The real JD" wrote in message
news:E1A9F924DF7061B63E56E27ADF757116@in.WebX.maYIadrTaRb...
> I just want it to work regardless of ucs.
Message 9 of 20
old-cadaver
in reply to: Anonymous

Key-in CYLINDER, it prompts "Specify center point for base of cylinder or [Elliptical] <0,0,0>:" you pick a point, any point. It prompts "Specify radius for base of cylinder or [Diameter]:" key-in a radius. It prompts "Specify height of cylinder or [Center of other end]:" See the "CENTER OF OTHER END" part? ENTER a C, then pick a point on the other side of the drawing. What do you get?
Message 10 of 20
old-cadaver
in reply to: Anonymous

Thanks Paul, sometimes ir's just easier, eh?
Message 11 of 20
Anonymous
in reply to: Anonymous

Sure ... why do it the easy way, when you can complicate it with a little
LISP? 8-))
___

"OLD-CADaver" wrote in message
news:f15906e.8@WebX.maYIadrTaRb...
> Thanks Paul, sometimes ir's just easier, eh?
Message 12 of 20
Anonymous
in reply to: Anonymous

Very nice lispy Paul,
I learn something new today 😉

from an old cad but not -aver...

"Paul Turvill" wrote in message
news:0AD02A8FF6B032D01833C748FCC3EC36@in.WebX.maYIadrTaRb...
> Sure ... why do it the easy way, when you can complicate it with a little
> LISP? 8-))
> ___
>
> "OLD-CADaver" wrote in message
> news:f15906e.8@WebX.maYIadrTaRb...
> > Thanks Paul, sometimes ir's just easier, eh?
>
>
Message 13 of 20
old-cadaver
in reply to: Anonymous

snicker
Message 14 of 20
Anonymous
in reply to: Anonymous

This is the result of 3 hours of sleep a night for the past 3 nights.
I kept forgeting the bloody "c" for other centerpoint.

So I'm glad, i could provide some fun for all of you.

Paul, thanks for the lisp. I've changed it a bit:

(defun C:Duh (/ p1 p2 dia)
(prompt "\nThis will draw a cylinder for those who can't read the command
line!!")
(setq p1 (getpoint "\nStarting point: ")
p2 (getpoint "\nEnding point: ")
dia (getdist "\nDiameter: "))
(command "_.cylinder" p1 (/ dia 2.0) "_c" p2)
(princ)
)



"Paul Turvill" wrote in message
news:0AD02A8FF6B032D01833C748FCC3EC36@in.WebX.maYIadrTaRb...
> Sure ... why do it the easy way, when you can complicate it with a little
> LISP? 8-))
> ___
>
> "OLD-CADaver" wrote in message
> news:f15906e.8@WebX.maYIadrTaRb...
> > Thanks Paul, sometimes ir's just easier, eh?
>
>
Message 15 of 20
Anonymous
in reply to: Anonymous

Can you translate that word into plain English or Spanish, please?

snicker
Message 16 of 20
old-cadaver
in reply to: Anonymous

A slightly stifled, sarcastic laugh. Sorry, can't help with the Spanish.
Message 17 of 20
old-cadaver
in reply to: Anonymous

Go home, take a nap, tomorrow comes anyway. 😉
Message 18 of 20
shanesparks
in reply to: Anonymous

Hi,

Could write you one for a small fee.

Shane
ssparks@northlandenergy.com
Message 19 of 20
old-cadaver
in reply to: Anonymous

Paul provided a free one about ten posts up.
Message 20 of 20
Dorecore
in reply to: Anonymous

Is it possible to make a lisp command that find two points of the same X & Y coordinates and creates a cylinder between them given a certain radius? I have several hundred cylinders to create and thought there would be a way to streamline the process.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost