# Find Matching Points by XY and filter out without pair, Z is different

**URL:** <https://forum.dynamobim.com/t/find-matching-points-by-xy-and-filter-out-without-pair-z-is-different/7217>\
**Category:** Lists-Logic\
**Created:** [November 2, 2016, 7:37am UTC](https://forum.dynamobim.com/t/find-matching-points-by-xy-and-filter-out-without-pair-z-is-different/7217 "2016-11-02T07:37:22Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michal\_Dengusiak](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/michal_dengusiak/32/92831_2.png) [@Michal\_Dengusiak](https://forum.dynamobim.com/u/Michal_Dengusiak)\
**Post date:** [November 2, 2016, 7:37am UTC](https://forum.dynamobim.com/t/find-matching-points-by-xy-and-filter-out-without-pair-z-is-different/7217/1 "2016-11-02T07:37:22Z")

</div>

Hi  
I am looking for a way to find matching points pairs by XY, ignore Z because is different

I used List.GropByeKey also List.SortByKey but does not work for me  
as it is OK when sorted by X for some point and then is not when sorted by Y,  
also not sure how to filter out Point without any pair?

thanks for help,

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/8/984f4918ff44e63a132e700faf29b734ecb3a071.png)

---

<div class="post-metadata">

**Author:** ![Michal\_Dengusiak](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/michal_dengusiak/32/92831_2.png) [@Michal\_Dengusiak](https://forum.dynamobim.com/u/Michal_Dengusiak)\
**Post date:** [November 2, 2016, 11:40am UTC](https://forum.dynamobim.com/t/find-matching-points-by-xy-and-filter-out-without-pair-z-is-different/7217/2 "2016-11-02T11:40:29Z")

</div>

I had to use Python, I manage to get XY sorted and matched by pairs,  
However not sure how to export now two main list lists: first will be pairs and second ids.

see attched script

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/2/3288382b235a82a81381a8fbcac709add38883c1.png)

[Code.txt](https://forum.dynamobim.com/uploads/short-url/amLH1XTfCquM0FMvoLf5LdQqyJ7.txt) (703 Bytes)

---

<div class="post-metadata">

**Author:** ![Mostafa\_El\_Ayoubi](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mostafa_el_ayoubi/32/7815_2.png) [@Mostafa\_El\_Ayoubi](https://forum.dynamobim.com/u/Mostafa_El_Ayoubi)\
**Post date:** [November 2, 2016, 11:42am UTC](https://forum.dynamobim.com/t/find-matching-points-by-xy-and-filter-out-without-pair-z-is-different/7217/3 "2016-11-02T11:42:18Z")

</div>

`OUT = pairs , ids`

---

<div class="post-metadata">

**Author:** ![Michal\_Dengusiak](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/michal_dengusiak/32/92831_2.png) [@Michal\_Dengusiak](https://forum.dynamobim.com/u/Michal_Dengusiak)\
**Post date:** [November 2, 2016, 12:14pm UTC](https://forum.dynamobim.com/t/find-matching-points-by-xy-and-filter-out-without-pair-z-is-different/7217/4 "2016-11-02T12:14:17Z")

</div>

Thanks… so simple

---

<div class="post-metadata">

**Author:** ![Ke2king](https://avatars.discourse-cdn.com/v4/letter/k/6f9a4e/32.png) [@Ke2king](https://forum.dynamobim.com/u/Ke2king)\
**Post date:** [August 16, 2018, 9:37am UTC](https://forum.dynamobim.com/t/find-matching-points-by-xy-and-filter-out-without-pair-z-is-different/7217/5 "2018-08-16T09:37:00Z")

</div>

Sorry, may i ask you?  
I tried to use this Python, but it’s not working…  
Could you check the attachment?  
Thank you.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/e/ce68fe241fad8132eef69518eea6f1543ba4d6ba.png)

---

<div class="post-metadata">

**Author:** ![DynamoCanDo](https://avatars.discourse-cdn.com/v4/letter/d/b782af/32.png) [@DynamoCanDo](https://forum.dynamobim.com/u/DynamoCanDo)\
**Post date:** [August 24, 2018, 3:19am UTC](https://forum.dynamobim.com/t/find-matching-points-by-xy-and-filter-out-without-pair-z-is-different/7217/7 "2018-08-24T03:19:23Z")

</div>

Hi, i also tried the python code and it never worked for me either.  
Also I’m trying to include the Z value. I’m using dynamo 2.0 which is probably the reason why the code isn’t working.

---

<div class="post-metadata">

**Author:** ![kennyb6](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kennyb6](https://forum.dynamobim.com/u/kennyb6)\
**Post date:** [August 24, 2018, 3:24am UTC](https://forum.dynamobim.com/t/find-matching-points-by-xy-and-filter-out-without-pair-z-is-different/7217/8 "2018-08-24T03:24:35Z")

</div>

Can @DynamoCanDo and @Ke2king make a new post with your questions? This post has already been solved and is 2 years old, so Dynamo and Revit versions may differ.

In your posts, be sure to include what the error is, as that is how we can actually figure out what is wrong. Also add your code and maybe the Dynamo graph as well.

Your guys’ errors are probably due to level issues, as the OP used list of lists and specifically found the first point in every list, where, at least from Ke2king’s picture, he is using a single list of points.

---

<div class="post-metadata">

**Author:** ![DynamoCanDo](https://avatars.discourse-cdn.com/v4/letter/d/b782af/32.png) [@DynamoCanDo](https://forum.dynamobim.com/u/DynamoCanDo)\
**Post date:** [August 24, 2018, 3:28am UTC](https://forum.dynamobim.com/t/find-matching-points-by-xy-and-filter-out-without-pair-z-is-different/7217/9 "2018-08-24T03:28:29Z")

</div>

fair enough. Will do. Thanks
