Split Solid into Segments

I have a whole bunch of solids (mostly cylinders) in a .dwg that I want to now create a 3d polyline from each of the centers of the circle at each end. I would get really close if I could split the solid into many slices along a plane, get the centroid of the first and last slice, and connect those two dots, or something similar.

Any other ideas of what I could do to get a line at the centerline of the utility that the solid is representing?

The unfortunate piece to add is that the solids were originally created using Dynamo, I just didn’t realise I would now want a line to feed into survey equipment instead of just viewing the solid in Navisworks. I’ll edit my other script to now also draw a line while creating the solid. Since creating the solids, some editing of the rotation did occur, so I don’t really want to rerun the original script if I can avoid it.

Topology.Vertices > Vertex.PointGeometry > Line.ByBestFitThroughPoints

That should work for the cylinders and cones. For non-uniform shapes such as if you edited the end of a cylinder via union, you would want to create a bounding box via minimum volume, extract it’s context coordinate system, draw a line on the long dimension, and shift that line by 1/2 of the box’s two remaining dimensions. Likely solving the first will cover most cases though.

1 Like

Brilliant. I got it to work using both methods. When just using the solid as the input for topology the output linework was on the outer surface of the solid, but if I created a minimum volume bounding box and used that as the input for the topology the output linework was thru the center of the solid.

1 Like