I'm trying to split a polyline that have some intersection points at its intersection points. So, if a polyline have two self intersection point, then it will become three different polyline. I attach the example of a polyline that I want to split. I wonder, does the get split curve method can help me to do this ? or any other idea how can I do this ?
I'm new to .net programming so I still don't know how some methods works
Yes, GetSplitCurves() could be useful as it can split the polyline, however you have to provide the additional logic that will be able to turn the polyline you attached into 3 closed loop polylines. Depending on which vertex is the start/end point of the polyline you'll get different results.
Another thing that might be useful for you to know is that there is a boundary tracing function available since AutoCAD 2011. In AutoCAD 2011 only in the ARX API (I think), but in 2012 it is also available under Editor.TraceBoundary(). If you specify a point that fals inside a loop then it will give you the poly loop around that point. In previous versions you could use the -BOUNDARY command instead.
In both cases though first you'd probably have to figure out the intersection points. So you would need to iterate through each segment of the poly and try to intersect it with all the other segments. Depending on the return value of Polyline.GetSegmentType() you would need to call either GetLineSegmentAt or GetArcSegmentAt. These segments then provide an IntersectWith function that you can use.
I hope this helps.
Autodesk Developer Network
yes, I found out that there is no simple way to do that, that I have to provide the additional logic to split the polyline
I'm still working on it
thanks for your answer !
Access a broad range of knowledge to help get the most out of your products and services.