# Grouping points from list according to the closet points

**URL:** <https://forum.dynamobim.com/t/grouping-points-from-list-according-to-the-closet-points/66013>\
**Category:** Geometry\
**Created:** [July 9, 2021, 10:55pm UTC](https://forum.dynamobim.com/t/grouping-points-from-list-according-to-the-closet-points/66013 "2021-07-09T22:55:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mkq\_1993](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mkq_1993/32/120089_2.png) [@Mkq\_1993](https://forum.dynamobim.com/u/Mkq_1993)\
**Post date:** [July 9, 2021, 10:55pm UTC](https://forum.dynamobim.com/t/grouping-points-from-list-according-to-the-closet-points/66013/1 "2021-07-09T22:55:49Z")

</div>

how to make Grouping for points from the same list according to the closet points as sub list using daynamo i spend a lot of time trying

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/3/93010f481abed7acbfc520d783319dde3baba87b.png)

---

<div class="post-metadata">

**Author:** ![Daan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/daan/32/82246_2.png) [@Daan](https://forum.dynamobim.com/u/Daan)\
**Post date:** [July 11, 2021, 1:24pm UTC](https://forum.dynamobim.com/t/grouping-points-from-list-according-to-the-closet-points/66013/2 "2021-07-11T13:24:54Z")

</div>

Hi @Mkq_1993 ,

Could you maybe elaborate a little bit more about what your in- & (desired) output?

---

<div class="post-metadata">

**Author:** ![GavinNicholls](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gavinnicholls/32/190442_2.png) [@GavinNicholls](https://forum.dynamobim.com/u/GavinNicholls)\
**Post date:** [July 11, 2021, 11:35pm UTC](https://forum.dynamobim.com/t/grouping-points-from-list-according-to-the-closet-points/66013/3 "2021-07-11T23:35:00Z")

</div>

[closest sort.dyn](https://forum.dynamobim.com/uploads/short-url/kEOEsCydUIxn290zAblPhdm101B.dyn) (37.4 KB)

The above might help. It may need to be applied one level deeper (looks like you’re working with sublists), but it’s the general principle.

 ![sort by closes](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/e/de320781c7b3c6bd8e8ffad4c8c0b706766b86ee.png)

---

<div class="post-metadata">

**Author:** ![Mkq\_1993](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mkq_1993/32/120089_2.png) [@Mkq\_1993](https://forum.dynamobim.com/u/Mkq_1993)\
**Post date:** [July 12, 2021, 4:51am UTC](https://forum.dynamobim.com/t/grouping-points-from-list-according-to-the-closet-points/66013/4 "2021-07-12T04:51:11Z")

</div>

I have Cable tray like in the pic Below I want to Group the trays next to each other and have same level in one list

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/5/4566b13caa5945917fc59d44c475fecd61914b5a.png)

---

<div class="post-metadata">

**Author:** ![Mkq\_1993](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mkq_1993/32/120089_2.png) [@Mkq\_1993](https://forum.dynamobim.com/u/Mkq_1993)\
**Post date:** [July 12, 2021, 5:47am UTC](https://forum.dynamobim.com/t/grouping-points-from-list-according-to-the-closet-points/66013/5 "2021-07-12T05:47:50Z")

</div>

thanks for your respond  
I want to sort the points according to the closest to each other and have the same level  
so i don’t have another point to use them to compare

---

<div class="post-metadata">

**Author:** ![GavinNicholls](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gavinnicholls/32/190442_2.png) [@GavinNicholls](https://forum.dynamobim.com/u/GavinNicholls)\
**Post date:** [July 12, 2021, 8:13am UTC](https://forum.dynamobim.com/t/grouping-points-from-list-according-to-the-closet-points/66013/6 "2021-07-12T08:13:48Z")

</div>

Try Points.pairbydistance from the Sparrow package.
