Resorting lists by unique items

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

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

1 Like

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

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/

http://dynamobim.com/wp-content/uploads/forum-assets/dimiter_vmail-bg/07/26/2015-07-26_13-07-23.png

 

This image shows the final outcome I was looking for…

resorting by unique items 3