Cylinder Guts

Cylinder Guts

Anonymous
Not applicable
554 Views
7 Replies
Message 1 of 8

Cylinder Guts

Anonymous
Not applicable
Hi Megastars,

Has anyone got any code that can extract the endpoints of the line that runs through the middle of a cylinder?

That is, pick a cylinder in the drawing and return the centre of the circle at one end to the centre of the circle at the other?

You guys rock.
0 Likes
555 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable
Look at "Centroid" property
and nothing else
Hth

~'J'~
0 Likes
Message 3 of 8

Anonymous
Not applicable
Hi Fatty,

Thanks for that, I've been playing around with the centroid property (after seeing some stuff in the history) but can't seem to work out how to get from that to the endpoints of the cylinder... I'm probably being really thick.
0 Likes
Message 4 of 8

Anonymous
Not applicable
SpaceWombat, you appear to be putting together the ingredients of quite a cocktail. Are you doing development work for the extrusion industry?

Working backward from a cylinder will probably be more problematic than it's creation. As Fatty said, you'll need to get the centroid for each end of the cylinder (regions). However, getting at those regions may require a "SendCommand" as there is no explode method for 3DSolids (unless that has changed since 2004).

It's unfortunate that BREPAuto and GEAuto libraries are not available through vanilla AutoCAD.
0 Likes
Message 5 of 8

Anonymous
Not applicable
Hi Sean,

Nah, I'm just a simple lighting designer who's started to use a fancy new lighting software package that can't import Autocad cylinders for some reason. Plus it's modelling is crap, so I import my models as .dwg

So I'm writing a VBA routine that can convert any line or cylinder into an extruded polygon. I'm 99% there, I just need to be able to get this "line through the middle of the cylinder" that I'm talking about. But I have so little experience coding with solids, I wouldn't even know how to explode one or how to go about retrieving the ends of an exploded one. Not able to give me a (coding) kick in the right direction, are you? Cheers.
0 Likes
Message 6 of 8

Anonymous
Not applicable
I have posted a possible solution for you here,
http://www.theswamp.org/index.php?topic=16754.0
0 Likes
Message 7 of 8

Anonymous
Not applicable
Bryco,
You are champ!
Regards,

~'J'~
0 Likes
Message 8 of 8

Anonymous
Not applicable
Hi Bryco,

Thanks for that, it works really well. Would have taken me quite a while to figure that out, I'm sure. I did notice that it sometimes makes a line across the cylinder in the centre. And then I noticed that SeanT noticed the same thing...

But that's a tremendous leg up, cheers!
0 Likes