# Iterate a list with itself

**URL:** <https://forum.dynamobim.com/t/iterate-a-list-with-itself/34227>\
**Category:** Revit\
**Tags:** dynamo\
**Created:** [April 1, 2019, 10:43am UTC](https://forum.dynamobim.com/t/iterate-a-list-with-itself/34227 "2019-04-01T10:43:30Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![Mark.Ackerley](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mark.ackerley/32/79310_2.png) [@Mark.Ackerley](https://forum.dynamobim.com/u/Mark.Ackerley)\
**Post date:** [April 9, 2019, 8:29am UTC](https://forum.dynamobim.com/t/iterate-a-list-with-itself/34227/22 "2019-04-09T08:29:12Z")

</div>

Try just downloading my dyn… 😃

I mistakenly put Chynamo where I should have labelled the node Synthesize…

Here’s an Rvt you can use to see it work…[Test.rvt](https://forum.dynamobim.com/uploads/short-url/id776QbB22cOLrHI2Ri9MNxTS0x.rvt) (1.2 MB)

Interestingly, it seems like your error is due to your trying to create very very small shapes…

> **[DirectShape Performance and Minimum Size](https://thebuildingcoder.typepad.com/blog/2014/05/directshape-performance-and-minimum-size.html)**
>
> One of the exciting API enhancements in Revit 2015 is the Import API functionality providing the new DirectShape and TessellatedShapeBuilder classes. These enable significant performance enhancements and powerful new possibilities for generating...

  
Presumably if your shapes only just touch… Perhaps you can filter them out using a Curve Length node? Or replace them with some sort of comment?

---

<div class="post-metadata">

**Author:** ![edward1234](https://avatars.discourse-cdn.com/v4/letter/e/8c91f0/32.png) [@edward1234](https://forum.dynamobim.com/u/edward1234)\
**Post date:** [April 9, 2019, 8:54am UTC](https://forum.dynamobim.com/t/iterate-a-list-with-itself/34227/23 "2019-04-09T08:54:03Z")

</div>

@Mark.Ackerley I think it is happening because it is clashing against itself and therefore cancelling out. I need a method that once it gets to geometry that are the same as eachother its stops looping. But I imagine this is hard without using Python?

---

<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:** [April 9, 2019, 9:01am UTC](https://forum.dynamobim.com/t/iterate-a-list-with-itself/34227/24 "2019-04-09T09:01:43Z")

</div>

Conditional looping (like stopping a loop based on if statement) in Dynamo is only possible with either Python or Imperative functions in DesignScript codeblocks. Personally, I prefer Python as there is more documentation and has been around longer/more robust.

---

<div class="post-metadata">

**Author:** ![Mark.Ackerley](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mark.ackerley/32/79310_2.png) [@Mark.Ackerley](https://forum.dynamobim.com/u/Mark.Ackerley)\
**Post date:** [April 9, 2019, 9:20am UTC](https://forum.dynamobim.com/t/iterate-a-list-with-itself/34227/25 "2019-04-09T09:20:29Z")

</div>

Hey,

Well, I created a simple working file, so I’d suggest that the node is smart enough to avoid that problem. It works. Perhaps you could try it and see that it works? 🙂

Your file is obviously more complex, I’ve found for you the opinion of Jeremy Tammik that it is due to overlapping by tiny amounts. I’m inclined to trust him. Perhaps try avoiding the problem as I suggested? Then if that doesn’t work we can look again? 🙂

Cheers,

Mark

[Previous page](https://forum.dynamobim.com/t/iterate-a-list-with-itself/34227.md?page=1)
