# Resorting lists by unique items

**URL:** <https://forum.dynamobim.com/t/resorting-lists-by-unique-items/1982>\
**Category:** Packages\
**Created:** [August 12, 2015, 8:17am UTC](https://forum.dynamobim.com/t/resorting-lists-by-unique-items/1982 "2015-08-12T08:17:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kyle\_Martin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kyle_martin/32/15927_2.png) [@Kyle\_Martin](https://forum.dynamobim.com/u/Kyle_Martin)\
**Post date:** [August 12, 2015, 8:17am UTC](https://forum.dynamobim.com/t/resorting-lists-by-unique-items/1982/1 "2015-08-12T08:17:40Z")

</div>

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](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/8/8711c0af405ddd34267bdf065aa9ce940372560d.png)

---

<div class="post-metadata">

**Author:** ![john\_pierson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/john_pierson/32/191977_2.png) [@john\_pierson](https://forum.dynamobim.com/u/john_pierson)\
**Post date:** [August 12, 2015, 8:43am UTC](https://forum.dynamobim.com/t/resorting-lists-by-unique-items/1982/2 "2015-08-12T08:43:58Z")

</div>

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](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/0/0fa83d9774046b0e9926f055933e080a958804af.png)

---

<div class="post-metadata">

**Author:** ![Kyle\_Martin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kyle_martin/32/15927_2.png) [@Kyle\_Martin](https://forum.dynamobim.com/u/Kyle_Martin)\
**Post date:** [August 12, 2015, 9:10am UTC](https://forum.dynamobim.com/t/resorting-lists-by-unique-items/1982/3 "2015-08-12T09:10:17Z")

</div>

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](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/4/421586e794947152a64e79c44f0c3779e0205355.png)

---

<div class="post-metadata">

**Author:** ![Kyle\_Martin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kyle_martin/32/15927_2.png) [@Kyle\_Martin](https://forum.dynamobim.com/u/Kyle_Martin)\
**Post date:** [August 12, 2015, 9:59am UTC](https://forum.dynamobim.com/t/resorting-lists-by-unique-items/1982/4 "2015-08-12T09:59:50Z")

</div>

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/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](http://dynamobim.com/wp-content/uploads/forum-assets/dimiter_vmail-bg/07/26/2015-07-26_13-07-23.png)

&nbsp;

This image shows the final outcome I was looking for…

![resorting by unique items 3](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/b/bf9252a5db15bd3593d8d060e1fba1b791346ef7.png)
