# Filter list with condition

**URL:** <https://forum.dynamobim.com/t/filter-list-with-condition/24877>\
**Category:** Revit\
**Tags:** revit, dynamo\
**Created:** [August 16, 2018, 7:27am UTC](https://forum.dynamobim.com/t/filter-list-with-condition/24877 "2018-08-16T07:27:59Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![NaSha](https://avatars.discourse-cdn.com/v4/letter/n/8491ac/32.png) [@NaSha](https://forum.dynamobim.com/u/NaSha)\
**Post date:** [August 16, 2018, 7:27am UTC](https://forum.dynamobim.com/t/filter-list-with-condition/24877/1 "2018-08-16T07:27:59Z")

</div>

Hi Dynamo experts,

I’m writing a script to filter a list of parameter based on a condition to find all the parameters including the word “Plate”.  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/6/661ad48a287dfb2c3846cacd17d1cf380f690426.png)  
Unfortunately, the run never completes. I have tried it so many times and I tried the script on smaller Revit file and it works, but it doesn’t work on the main file which is a big file.  
Is there recommendation how to speed up the process or change the scrip? I would appreciate your help.  
I need to pick some items from the list with specific name in order to locate and find the length for the lines.

---

<div class="post-metadata">

**Author:** ![mellouze](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@mellouze](https://forum.dynamobim.com/u/mellouze)\
**Post date:** [August 16, 2018, 7:39am UTC](https://forum.dynamobim.com/t/filter-list-with-condition/24877/2 "2018-08-16T07:39:56Z")

</div>

Hi,

It happened to me before when I wanted to run graphs that required a lot of computation. One way I found to avoid that problem is to run the graph step by step, letting the first node compute and freezing the others, then unfreeze the second node and freezing the one after, etc., until you computed all your nodes.

If the List.Filter node still doesn’t compute, you can try dividing it into a **List.FilterByBoolMask** node and a **String.Contains** node, runnning them one by one.

Good luck !

PS: if some of you find a better solution, I would be 100% intrested !

---

<div class="post-metadata">

**Author:** ![NaSha](https://avatars.discourse-cdn.com/v4/letter/n/8491ac/32.png) [@NaSha](https://forum.dynamobim.com/u/NaSha)\
**Post date:** [August 16, 2018, 7:54am UTC](https://forum.dynamobim.com/t/filter-list-with-condition/24877/3 "2018-08-16T07:54:30Z")

</div>

Thanks @mellouze for your reply. I tried freezing but unfortunately when I freeze the first part, the next get frozen too. It doesn’t work for me.

---

<div class="post-metadata">

**Author:** ![mellouze](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@mellouze](https://forum.dynamobim.com/u/mellouze)\
**Post date:** [August 16, 2018, 8:04am UTC](https://forum.dynamobim.com/t/filter-list-with-condition/24877/4 "2018-08-16T08:04:25Z")

</div>

You are talking about the moment when you want to compute the second part ? In that case, you don’t need to freeze the first part, as Dynamo already evaluated the first node and will not try to compute it again (unless you change the input).

If you are talking about the graph you showed in your first post, I said earlier that you can decompose your two last nodes to make them independant, freezing the second and running just the test.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![Ewan\_Opie](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ewan_opie/32/77070_2.png) [@Ewan\_Opie](https://forum.dynamobim.com/u/Ewan_Opie)\
**Post date:** [August 17, 2018, 1:47am UTC](https://forum.dynamobim.com/t/filter-list-with-condition/24877/5 "2018-08-17T01:47:48Z")

</div>

@NaSha You could try using a design script solution and see if that freezes?  
This uses the logic @mellouze stated in the post above. 👍

![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/f/af0008e13f80dbcc8a8c210c44e810070f44430b.png)

---

<div class="post-metadata">

**Author:** ![salvatoredragotta](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/salvatoredragotta/32/10078_2.png) [@salvatoredragotta](https://forum.dynamobim.com/u/salvatoredragotta)\
**Post date:** [August 17, 2018, 2:29am UTC](https://forum.dynamobim.com/t/filter-list-with-condition/24877/6 "2018-08-17T02:29:34Z")

</div>

@Ewan_Opie Nice! I wonder why it’s not working for me 🙄

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

---

<div class="post-metadata">

**Author:** ![Ewan\_Opie](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ewan_opie/32/77070_2.png) [@Ewan\_Opie](https://forum.dynamobim.com/u/Ewan_Opie)\
**Post date:** [August 17, 2018, 2:53am UTC](https://forum.dynamobim.com/t/filter-list-with-condition/24877/7 "2018-08-17T02:53:20Z")

</div>

Can you break it out and see which side of the road the error occurs on?

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

Could be a conflicting package. Try specifying Revit?  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/7/b7650053d9bd6ff5e00eb86dc414a68349a9fbe0.png)

---

<div class="post-metadata">

**Author:** ![salvatoredragotta](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/salvatoredragotta/32/10078_2.png) [@salvatoredragotta](https://forum.dynamobim.com/u/salvatoredragotta)\
**Post date:** [August 17, 2018, 6:40am UTC](https://forum.dynamobim.com/t/filter-list-with-condition/24877/8 "2018-08-17T06:40:13Z")

</div>

@Ewan_Opie 🙄

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

---

<div class="post-metadata">

**Author:** ![j.krol](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/j.krol/32/68986_2.png) [@j.krol](https://forum.dynamobim.com/u/j.krol)\
**Post date:** [March 14, 2019, 10:29am UTC](https://forum.dynamobim.com/t/filter-list-with-condition/24877/9 "2019-03-14T10:29:04Z")

</div>

I know, it old topic, but did you find a solution?  
If you didn’t I have idea 🙂

Try by node: List.FilterByBoolMask.  
Below part of my script, which filter elements by word “BMV”  
 ![obraz](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/8/c85e89c2789a2df95888ec3140041079f6cdcb5e.png)

I hope it will be helpful.

---

<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:** [October 30, 2019, 10:22am UTC](https://forum.dynamobim.com/t/filter-list-with-condition/24877/10 "2019-10-30T10:22:53Z")

</div>

Hey you don’t need the boolean value set to false on the string.contains 🙂  
It is set to false as default.

---

<div class="post-metadata">

**Author:** ![MMM](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mmm/32/117972_2.png) [@MMM](https://forum.dynamobim.com/u/MMM)\
**Post date:** [November 22, 2022, 5:57am UTC](https://forum.dynamobim.com/t/filter-list-with-condition/24877/11 "2022-11-22T05:57:35Z")

</div>

Thanks for this. Its helpful to me.
