# Group points by xy

**URL:** <https://forum.dynamobim.com/t/group-points-by-xy/60238>\
**Category:** Uncategorized\
**Tags:** dynamo\
**Created:** [February 8, 2021, 12:50pm UTC](https://forum.dynamobim.com/t/group-points-by-xy/60238 "2021-02-08T12:50:01Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![preetesh.magadum](https://avatars.discourse-cdn.com/v4/letter/p/b4bc9f/32.png) [@preetesh.magadum](https://forum.dynamobim.com/u/preetesh.magadum)\
**Post date:** [February 8, 2021, 12:50pm UTC](https://forum.dynamobim.com/t/group-points-by-xy/60238/1 "2021-02-08T12:50:01Z")

</div>

Hi,

I have been trying to Group set of points by x coordiante and also near by points (with tolerance)

I could able to make somthing like this , yet not happy with the results , it still miss some points(groups them seperate)

If anybody has done something similar or any ideas pls share

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

thank you

---

<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:** [February 8, 2021, 1:50pm UTC](https://forum.dynamobim.com/t/group-points-by-xy/60238/2 "2021-02-08T13:50:03Z")

</div>

Hi @preetesh.magadum ,

The Springs package has a node to group points by distance.

---

<div class="post-metadata">

**Author:** ![Robert\_Younger](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/robert_younger/32/205603_2.png) [@Robert\_Younger](https://forum.dynamobim.com/u/Robert_Younger)\
**Post date:** [February 8, 2021, 8:56pm UTC](https://forum.dynamobim.com/t/group-points-by-xy/60238/3 "2021-02-08T20:56:12Z")

</div>

Could you elaborate what you mean by the current setup missing some points?

You have 7-digit numbers and appear to be rounding to the third digit. The node you are using gives you Floor and Ceiling rounding methods, it looks like you chose to use RoundUp (or Ceiling).

This means that:  
001 → 100  
050 → 100  
099 → 100  
101 → 200

Is that what you had in mind?

---

<div class="post-metadata">

**Author:** ![preetesh.magadum](https://avatars.discourse-cdn.com/v4/letter/p/b4bc9f/32.png) [@preetesh.magadum](https://forum.dynamobim.com/u/preetesh.magadum)\
**Post date:** [February 9, 2021, 4:10am UTC](https://forum.dynamobim.com/t/group-points-by-xy/60238/4 "2021-02-09T04:10:47Z")

</div>

Hi, Robert

Thank you for your response - Examples which you gave are quite correct.  
i want only x points of each point to be rounded so that i have proper groups,

The above points are centroids of Surfaces - i am taking the centroids so that i can pick the elements row by row like in groups

---

<div class="post-metadata">

**Author:** ![preetesh.magadum](https://avatars.discourse-cdn.com/v4/letter/p/b4bc9f/32.png) [@preetesh.magadum](https://forum.dynamobim.com/u/preetesh.magadum)\
**Post date:** [February 9, 2021, 4:12am UTC](https://forum.dynamobim.com/t/group-points-by-xy/60238/5 "2021-02-09T04:12:27Z")

</div>

since the points are layed in a grid , not random - i cannot used group by distance  
I needs the groups by rows of near by x values

---

<div class="post-metadata">

**Author:** ![\_Vijay](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/_vijay/32/91307_2.png) [@\_Vijay](https://forum.dynamobim.com/u/_Vijay)\
**Post date:** [February 9, 2021, 5:44am UTC](https://forum.dynamobim.com/t/group-points-by-xy/60238/6 "2021-02-09T05:44:32Z")

</div>

I think you can group by direction with vectors.

---

<div class="post-metadata">

**Author:** ![khuzaimah.ElecEng](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/khuzaimah.eleceng/32/92768_2.png) [@khuzaimah.ElecEng](https://forum.dynamobim.com/u/khuzaimah.ElecEng)\
**Post date:** [February 9, 2021, 6:40am UTC](https://forum.dynamobim.com/t/group-points-by-xy/60238/7 "2021-02-09T06:40:54Z")

</div>

you can create a circle that it’s center in the desired point  
the radius is the tolerance  
and see what point is intersecting with it and group them

---

<div class="post-metadata">

**Author:** ![preetesh.magadum](https://avatars.discourse-cdn.com/v4/letter/p/b4bc9f/32.png) [@preetesh.magadum](https://forum.dynamobim.com/u/preetesh.magadum)\
**Post date:** [February 9, 2021, 7:10am UTC](https://forum.dynamobim.com/t/group-points-by-xy/60238/8 "2021-02-09T07:10:02Z")

</div>

group points something like this

points are center points of each tile

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/d/6db4f17cf7535b9c875978d90d2c66fc543f0b0c.png)

thank you

---

<div class="post-metadata">

**Author:** ![preetesh.magadum](https://avatars.discourse-cdn.com/v4/letter/p/b4bc9f/32.png) [@preetesh.magadum](https://forum.dynamobim.com/u/preetesh.magadum)\
**Post date:** [February 9, 2021, 7:14am UTC](https://forum.dynamobim.com/t/group-points-by-xy/60238/9 "2021-02-09T07:14:01Z")

</div>

points needs to be sorted with x values and then grouped , as you see not all rows have center points same , tiles in the edges have center points with x diierence in x values,

i was trying to round them up and then group as per the image shown above ,  
My solution above works , yet does not hold good for all conditions

looking for better solution
