Solid.ByLoft operation failed

Hi, I have an issue creating Solid.ByLoft. It gives an error saying

LOFT_SURFACE_SELF_INTERSECT – Loft surface self intersects. I have a list of list containing 12 points for each cross-section.
In python script node can I use any Polycurve method to exclude those polycurves which are self intersecting. Or suggest any other method or technique to remove polycurve. I tried PolyCurve.DoesIntersect(geometry) method but it is finding out intersection with other geometry.
I am getting these cross-section points from Civil 3D, and I don’t want to change the frequency of cross-section.

Here is the Dynamo script file.

Create_TrackSlab_ByLoft_Test.dyn (44.7 KB)

Any help would be appreciated.
Thanks

Hi @ATTEL9DCS,

It’s hard to tell exactly what is going on since the source files aren’t available, but one thought is to create Polygons from the points instead of Polycurves. The reason is because the Polygon class has a method for checking for self-intersections. It returns the intersection points, so you could just check if the count of intersection points for each Polygon is greater than zero. You can still loft between Polygons because they inherit from the Curve base class, or if you want Polycurves you could convert the Polygons using Polycurve.ByJoinedCurves.