DYNAMO Civil3d convert all features lines on a site to alignment

Hello everyone, I am trying to create a dynamo in which I want to convert all the featurelines of a site into alignment. I imported the site into dynamo and extracted the polycurves. I’m stuck at this step. I attach the dynamo file. Thank you all.


I think you might be having issues with the PolylineExtensions.ObjectByGeometry node. When I tried using that node, the error says that node uses Autocad.Object and not an Autocad.Polyline.

Try using the out of the box node Polyline.ByPoints and using the Featureline.GetPIPoints node to get the points rather than the Featureline.Polycurve node.

Lastly, I think you’ll also need to use a string for the site name input when creating the alignment rather than the actual site object itself. That should create the alignments you’re looking for.

May this it help you

Thanks, does this work with featurelines containing arcs?

No, unfortunately that method doesn’t work if the feature lines contain arcs.

I did find a workaround to get the PolylineExtensions.ObjectByGeometry node to work as shown in the image below. For some reason, when the polyline is created in dynamo, it’s seen as an object but if the same polyline is then selected in the document, it’s then read as a polyline and works as expected in the create alignment from polyline node. If there are other polylines in your drawing, you may need to filter the newly created polylines further (i.e. create the polylines on their own layer and select by layer).

Also I don’t think this method would work if the feature lines have elevations to them. I think it would create 3Dpolylines rather than polylines.

Everything works on the first run. But if I want to use another site, the program crashes. I have to rerun civili and dynamo. Do you have an idea.