# Filter Loop

**URL:** <https://forum.dynamobim.com/t/filter-loop/5047>\
**Category:** DesignScript\
**Tags:** revit\
**Created:** [July 15, 2016, 11:02am UTC](https://forum.dynamobim.com/t/filter-loop/5047 "2016-07-15T11:02:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jan\_Secnik](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jan_secnik/32/55692_2.png) [@Jan\_Secnik](https://forum.dynamobim.com/u/Jan_Secnik)\
**Post date:** [July 15, 2016, 11:02am UTC](https://forum.dynamobim.com/t/filter-loop/5047/1 "2016-07-15T11:02:00Z")

</div>

hi,  
I am trying to make filter loop for surface perimeter curves, but when i define function, it doesnt work like i imagined.  
My idea was, that loop would filter every sublist and its elements, with curve max curve length in that sublist, but all i get is filter for 1 curve in every sublist. I have already tried static method, but it would be great if it is possible to make function, that is not limited by number of list elements.

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/1/167585a862851743b4e52f072d5b12dffe80f65b.JPG)

I am attaching revit file and my dynamo definitions.  
Thank you for your help.

link to .rvt and .dyn file: [https://www.dropbox.com/sh/9wy7u561c14qrby/AAC7dnmUHQ\_AI3S7puwM\_vMsa?dl=0](https://www.dropbox.com/sh/9wy7u561c14qrby/AAC7dnmUHQ_AI3S7puwM_vMsa?dl=0)

---

<div class="post-metadata">

**Author:** ![Vikram\_Subbaiah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vikram_subbaiah/32/50797_2.png) [@Vikram\_Subbaiah](https://forum.dynamobim.com/u/Vikram_Subbaiah)\
**Post date:** [July 15, 2016, 12:06pm UTC](https://forum.dynamobim.com/t/filter-loop/5047/2 "2016-07-15T12:06:50Z")

</div>

I don’t think you need Imperative Blocks, Loops or Functions

`List.FilterByBoolMask(lst,lst.X==lst.Y)["in"]`

You’re tryimg to obtain something on these lines?..  
 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/c/c897db346d09752c9826fd23046304ee330905da.png)

---

<div class="post-metadata">

**Author:** ![Jan\_Secnik](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jan_secnik/32/55692_2.png) [@Jan\_Secnik](https://forum.dynamobim.com/u/Jan_Secnik)\
**Post date:** [July 15, 2016, 3:57pm UTC](https://forum.dynamobim.com/t/filter-loop/5047/3 "2016-07-15T15:57:53Z")

</div>

yes, that works perfectly :),  
thank you,
