# Filter elements not working

**URL:** <https://forum.dynamobim.com/t/filter-elements-not-working/16748>\
**Category:** Revit\
**Created:** [November 22, 2017, 3:10pm UTC](https://forum.dynamobim.com/t/filter-elements-not-working/16748 "2017-11-22T15:10:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![robertobatista](https://avatars.discourse-cdn.com/v4/letter/r/f08c70/32.png) [@robertobatista](https://forum.dynamobim.com/u/robertobatista)\
**Post date:** [November 22, 2017, 3:10pm UTC](https://forum.dynamobim.com/t/filter-elements-not-working/16748/1 "2017-11-22T15:10:15Z")

</div>

I’m trying to filter elements, which should be a simple straight forward process. Unfortunately, I’ve tried different methods but none of them seemed to work. First of all I tried filtering elements on a certain level, however the equal node returned all false.

 ![Dynamo level](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/1/3188fb0253a110af96f86d3f891d21b7d80feec4.JPG)

next, I tried adding a string in the type comments parameter to make the elements that I want to select unique. Also here, the element get parameter value by name node returned blank.

 ![Dynamo comments](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/3/339dde9b03b1380e7b408b03be0fd96df2ef0234.JPG)

Finally I tried to filter by family type. In this case the get parameter value by name does return the family types, but when I try to extract the proper filter using the equal node, it returned everything as false.

 ![Dynamo equal](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/8/9848f0edcf351bae4e7833003695bca8c949cc53.JPG)

I’m a newbie so I must be doing something wrong.

---

<div class="post-metadata">

**Author:** ![MJB-online](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mjb-online/32/24884_2.png) [@MJB-online](https://forum.dynamobim.com/u/MJB-online)\
**Post date:** [November 22, 2017, 3:36pm UTC](https://forum.dynamobim.com/t/filter-elements-not-working/16748/2 "2017-11-22T15:36:45Z")

</div>

Hi @robertobatista,

If you use the “ **==** ” node the text in your **codeblock** has to be the same as the output of the “ **Element.GetParameterValue** ” node if you want a true value.  
An other option would be to use for example the **String.Contains** node (instead of **==** ).

Kind regards,  
Mark

---

<div class="post-metadata">

**Author:** ![cydkab](https://avatars.discourse-cdn.com/v4/letter/c/8e7dd6/32.png) [@cydkab](https://forum.dynamobim.com/u/cydkab)\
**Post date:** [November 22, 2017, 4:15pm UTC](https://forum.dynamobim.com/t/filter-elements-not-working/16748/3 "2017-11-22T16:15:41Z")

</div>

I used also the get.parameter with the comment section. I think you should get rid of the “Type” word and just use comments. If you mark them, then you can Get.Parameter and filter them with the FilterBoolean using an empty string. What I mean is going the other way, instead of filtering the elements with comments, filter the elements WITHOUT comments and get the list from the “out” input.

[[Album] Imgur ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/8/084e9b24b9cb613d5d57fdf31f075e8dee7687ff.jpg "Imgur") ](https://imgur.com/a/a6c0X)
  
Hope it helps

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [November 22, 2017, 4:39pm UTC](https://forum.dynamobim.com/t/filter-elements-not-working/16748/4 "2017-11-22T16:39:01Z")

</div>

Level and Type will both return the actual Level and Family Type elements, not a string. You need to get the name of those elements before using == to check for values.

If Type Comments is a type parameter, you won’t be able to use the standard GetParameterValue node with the family instances. You’ll either have to get the Family Type of each instance or use a custom node than can handle both type and instance parameters.

---

<div class="post-metadata">

**Author:** ![MJB-online](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mjb-online/32/24884_2.png) [@MJB-online](https://forum.dynamobim.com/u/MJB-online)\
**Post date:** [November 23, 2017, 8:54am UTC](https://forum.dynamobim.com/t/filter-elements-not-working/16748/5 "2017-11-23T08:54:46Z")

</div>

Hi @robertobatista,

@Nick_Boyts is right if you want to filter by Level or Type you first have to turn it into a string.  
In the below examples i used a “String from Object” node for this purpose.

 ![BoolMask_==](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/c/6c1ba413c6b83c618b6f8db8df6fe4ebd9e22f63.png)

 ![BoolMask_StringContains](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/3/131656328633cac3270dbd31792d07e1d45f435e.png)

I hope it helps to solve your problem.

Kind regards,  
Mark

---

<div class="post-metadata">

**Author:** ![robertobatista](https://avatars.discourse-cdn.com/v4/letter/r/f08c70/32.png) [@robertobatista](https://forum.dynamobim.com/u/robertobatista)\
**Post date:** [November 23, 2017, 9:11pm UTC](https://forum.dynamobim.com/t/filter-elements-not-working/16748/6 "2017-11-23T21:11:17Z")

</div>

Converting each step to a string seems the be the answer. In my case, I’ve filtered the generic model families by type name, then filter it by level, both using the string by object nodes.

Thank you very much!!!

---

<div class="post-metadata">

**Author:** ![MJB-online](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mjb-online/32/24884_2.png) [@MJB-online](https://forum.dynamobim.com/u/MJB-online)\
**Post date:** [November 24, 2017, 7:58am UTC](https://forum.dynamobim.com/t/filter-elements-not-working/16748/7 "2017-11-24T07:58:25Z")

</div>

Hi @robertobatista,

If you think this is the answer to your question, please mark this post as solved (so others can also benefit from it).

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

Kind regards,  
Mark
