My final goal is to measure the lengths of segments of a polygon. If you think there is no need to explode the polygon it’s perfect!
What syntax should be applied to achieve this ?
Polygons are fairly easy because they are polylines, and polylines are made up of line segments, and those have a Length property. It’s also easy to figure out how many segments a polyline consists of: polygoncomponent.cs (2.1 KB)
It’s to add a new component to a plugin. So I can’t use grasshopper component. I have to use C# and visual studio.
Sorry my english is not really good…
Curve[] segments = inputCurve.DuplicateSegments();
// calculate the length of each segment and add it to a list
List<double> segmentLengths = new List<double>();
foreach (Curve segment in segments)
{
segmentLengths.Add(segment.GetLength());
}