Message 1 of 1
Point3d Array Orderby
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi
I need help in sorting my pos1[] array and saving to the sortedList[] array.
pos1 is a Point3d array,
Point3d[] pos1 = new Point3d[blockCount * 6];
My code after my pos1[] array are generated is,
var sortedList = pos1.OrderBy(p => p.X).ThenBy(p => p.Y).ToArray();
for (int ff = 0; ff < nodeCount; ff++)
{
ed.WriteMessage("\nsortedList[" + ff + "] = " + sortedList[ff]);
}
Here are the sample of my results
(0,0,0) must not appear, sometime the sorting is good, like the last picture.
The sort must be like:
X values (lowest to highest) - PRIMARY
Y values (lowest to highest) - SECONDARY
Thanks