# Exclude equal Cordinates from a LIST

**URL:** <https://forum.dynamobim.com/t/exclude-equal-cordinates-from-a-list/40556>\
**Category:** Lists-Logic\
**Tags:** revit, dynamo, listfilter, list-filter\
**Created:** [September 11, 2019, 5:49pm UTC](https://forum.dynamobim.com/t/exclude-equal-cordinates-from-a-list/40556 "2019-09-11T17:49:52Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Merieli](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/merieli/32/34121_2.png) [@Merieli](https://forum.dynamobim.com/u/Merieli)\
**Post date:** [September 11, 2019, 5:49pm UTC](https://forum.dynamobim.com/t/exclude-equal-cordinates-from-a-list/40556/1 "2019-09-11T17:49:52Z")

</div>

Hello! I have a list of lines with coordinates, I want to compare all X coordinates with X check which are the same and delete leaving only one!

 ![Lista%20Cooerdenadas](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/1/d1051639d4ba9a56e1be59af6318f9e670c0ea31.jpeg)  
The problem is that I am trying to create “grids” from the axis of the walls, and when I have a wall cut in two, at the same X coordinate for example, it ends up creating 2 “gridlines” one over the other, hence the attempt to list the coordinates except for repetitions.  
I’ve tried it in various ways, with list get at index and others, but I didn’t get results, the closest I could get this was to list groups in equal X coordinates “but some equals end up going to another list”.  
I hope someone can help me! Thank you in advance.

---

<div class="post-metadata">

**Author:** ![cgartland](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cgartland/32/45378_2.png) [@cgartland](https://forum.dynamobim.com/u/cgartland)\
**Post date:** [September 11, 2019, 5:56pm UTC](https://forum.dynamobim.com/t/exclude-equal-cordinates-from-a-list/40556/2 "2019-09-11T17:56:36Z")

</div>

It looks like you should be able to just use a List.GetItemAtIndex node, with 0 as the index, using proper list levels.

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

---

<div class="post-metadata">

**Author:** ![Merieli](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/merieli/32/34121_2.png) [@Merieli](https://forum.dynamobim.com/u/Merieli)\
**Post date:** [September 11, 2019, 6:01pm UTC](https://forum.dynamobim.com/t/exclude-equal-cordinates-from-a-list/40556/3 "2019-09-11T18:01:04Z")

</div>

I tried that, but it’s more complex, because the list keeps returning equal X coordinates, like the ones in the image.

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

---

<div class="post-metadata">

**Author:** ![cgartland](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cgartland/32/45378_2.png) [@cgartland](https://forum.dynamobim.com/u/cgartland)\
**Post date:** [September 11, 2019, 6:43pm UTC](https://forum.dynamobim.com/t/exclude-equal-cordinates-from-a-list/40556/4 "2019-09-11T18:43:18Z")

</div>

The lines are grouped by the X coordinate of their start points, right? Theoretically, this should work then. Could you post the .dyn?

---

<div class="post-metadata">

**Author:** ![Merieli](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/merieli/32/34121_2.png) [@Merieli](https://forum.dynamobim.com/u/Merieli)\
**Post date:** [September 11, 2019, 6:51pm UTC](https://forum.dynamobim.com/t/exclude-equal-cordinates-from-a-list/40556/5 "2019-09-11T18:51:04Z")

</div>

Yes, it follows attached …  
[Eixos\_centros de paredes.dyn](https://forum.dynamobim.com/uploads/short-url/mEWERuqmoNsfRHFl1gaIMX1bv9f.dyn) (8.4 KB)

At the end of the list I have to apply Grid.Byline and everything has to work without creating overlapping lines as it happens in the attached image

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

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [September 11, 2019, 7:28pm UTC](https://forum.dynamobim.com/t/exclude-equal-cordinates-from-a-list/40556/6 "2019-09-11T19:28:47Z")

</div>

You could also try to extend the lines untill they intersect, filter the lines that do and make a new line from start point of the first line and the end point (or most far away) of the second line.

---

<div class="post-metadata">

**Author:** ![Merieli](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/merieli/32/34121_2.png) [@Merieli](https://forum.dynamobim.com/u/Merieli)\
**Post date:** [September 11, 2019, 7:37pm UTC](https://forum.dynamobim.com/t/exclude-equal-cordinates-from-a-list/40556/7 "2019-09-11T19:37:58Z")

</div>

ok, but I have no idea how to do that, because it’s pretty much my second attempt with Dynamo  
and what I have at the moment is a list with all the line coordinates, I think it would be more complex to do that than just filtering the coordinates that have the corresponding “x” and “y” coordinates, don’t you think? … I’m seeing if I can get any results with pythoncorrespondentes não acha?

---

<div class="post-metadata">

**Author:** ![cgartland](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cgartland/32/45378_2.png) [@cgartland](https://forum.dynamobim.com/u/cgartland)\
**Post date:** [September 11, 2019, 7:39pm UTC](https://forum.dynamobim.com/t/exclude-equal-cordinates-from-a-list/40556/8 "2019-09-11T19:39:36Z")

</div>

This looks to be an issue with the floating point accuracy of the X-coordinates. For example, one number might be 15.00000000000 and one might be 15.000000000001. In the watch node, it only shows 3 decimal places, so this isn’t immediately apparent.

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

If you round the numbers to a certain number of digits, it should work.

[Eixos\_centros de paredes\_atualizado.dyn](https://forum.dynamobim.com/uploads/short-url/rdIPYM5syp5hADewgKDu2XxyMBa.dyn) (25.9 KB)

---

<div class="post-metadata">

**Author:** ![Anton\_Huizinga](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/anton_huizinga/32/155377_2.png) [@Anton\_Huizinga](https://forum.dynamobim.com/u/Anton_Huizinga)\
**Post date:** [September 11, 2019, 7:40pm UTC](https://forum.dynamobim.com/t/exclude-equal-cordinates-from-a-list/40556/9 "2019-09-11T19:40:32Z")

</div>

Is rounding before comparing an option? Doubles are instable from nature.

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [September 11, 2019, 7:47pm UTC](https://forum.dynamobim.com/t/exclude-equal-cordinates-from-a-list/40556/10 "2019-09-11T19:47:21Z")

</div>

yes i think you are right, its more complex to do it like i suggested to solve this, but its more challenging.  
make it a game that you can enjoy  
🙂

---

<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:** [September 11, 2019, 10:08pm UTC](https://forum.dynamobim.com/t/exclude-equal-cordinates-from-a-list/40556/12 "2019-09-11T22:08:35Z")

</div>

Can always make it an integer. Multiply it by 10^# of decimal digits for accuracy and turn it into an int.

---

<div class="post-metadata">

**Author:** ![Merieli](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/merieli/32/34121_2.png) [@Merieli](https://forum.dynamobim.com/u/Merieli)\
**Post date:** [September 12, 2019, 1:20pm UTC](https://forum.dynamobim.com/t/exclude-equal-cordinates-from-a-list/40556/13 "2019-09-12T13:20:35Z")

</div>

Even though this code has something wrong, I finished it all, I generated the lists for the x and y start and end points, but now it doesn’t generate lines on all walls anymore, it skips several, I don’t know what’s wrong … I tried to change rounding the coordinates multiplying, but it didn’t work either …  
[Eixos\_centros\_paredes\_v02.dyn](https://forum.dynamobim.com/uploads/short-url/xNUTPxIoPyBL9byJOXmVs5lNVbB.dyn) (29.0 KB)  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/3/630cd5c0e1d4aab4a56333fbaf6550d69322a11c.png)  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/c/1c17adbc7487f854ab989aae816082ac6113d1c1.png)  
Maybe the way is wrong? I’m trying a new alternative using this topic [Join walls in intersecting / touching](https://forum.dynamobim.com/t/join-walls-in-intersecting-touching/12622/3), which starts selecting walls and identifying their python intersections, but then I get a list with true and false, and I couldn’t filter it to display only true … What do you think? Should I keep trying in the previous method or start selecting and filtering the intersecting walls would be the best way?
