Resorting lists by unique items


#1

I have a list of 11 sublists, each containing 5 points. Sublists 0-4 each contain the same exact 5 points and sublist 5-10 each contain the same exact 5 points (image, left). I want to regroup the sublists into separate lists based on matching points. In this case, the result would be sublists 0-4 in List 1 and siblists 5-10 in List 2.

The List.UniqueItems node succesfully identifies the unique conditions (image, right) but I cannot figure out how to use this to resort the sublists. I tried the GroupByKey node with List.UniqueItems in the keyProjector port but it only managed to bump each individual point deeper into an additional sublist.

Any suggestions?

resorting by unique items


#2

I’m not too sure if this is it. But have you used list.map with unique items in the function?

2015-08-12_08h10_48


#3

I tried the exact same approach, no luck. The below image shows the output of GroupByKey and List.Map node approaches…

resorting by unique items 2


#4

Figured it out by sheer luck and trial-and-error…

I found the following post which isolates the X coordinate from one of the points in the first sublist and uses that to drive the GroupByKey node:

http://dynamobim.com/forums/topic/deconstructing-points-into-their-coordinates-function/

 

This image shows the final outcome I was looking for…

resorting by unique items 3