# Duct Tagging Using Conditional Statement

**URL:** <https://forum.dynamobim.com/t/duct-tagging-using-conditional-statement/73128>\
**Category:** Revit\
**Created:** [February 8, 2022, 2:52pm UTC](https://forum.dynamobim.com/t/duct-tagging-using-conditional-statement/73128 "2022-02-08T14:52:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![irfankhan888969](https://avatars.discourse-cdn.com/v4/letter/i/f05b48/32.png) [@irfankhan888969](https://forum.dynamobim.com/u/irfankhan888969)\
**Post date:** [February 8, 2022, 2:52pm UTC](https://forum.dynamobim.com/t/duct-tagging-using-conditional-statement/73128/1 "2022-02-08T14:52:06Z")

</div>

Hi All,  
I just make a script for tagging ducts which length is above 2000 mm. So what i have done is firstly tag all the ducts using Tag.ByElement. Then I want to filter the length which is below 2000 mm so i take Node List.FilterByBoolMask it works smoothly. But the problem is when i connect List.FilterByBoolMask output to Tag Element input it shows something is Wrong. Can anyone look into it. It would be helpful.  
(See Below attached Snap)

Thank You

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

---

<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:** [February 8, 2022, 3:16pm UTC](https://forum.dynamobim.com/t/duct-tagging-using-conditional-statement/73128/2 "2022-02-08T15:16:16Z")

</div>

If you look at your filtered list you’ll see you’re now providing a length instead of an element to be tagged. The `mask` input for `FilterByBoolMask` has to be a list matching the `list` input. For each item in `list` there needs to be a respective boolean in `mask` that determines which output the item gets filtered to. In your case you would check the duct lengths to be \>2000 and then filter the _elements_, not the lengths like you’re doing currently.

---

<div class="post-metadata">

**Author:** ![irfankhan888969](https://avatars.discourse-cdn.com/v4/letter/i/f05b48/32.png) [@irfankhan888969](https://forum.dynamobim.com/u/irfankhan888969)\
**Post date:** [February 8, 2022, 4:22pm UTC](https://forum.dynamobim.com/t/duct-tagging-using-conditional-statement/73128/3 "2022-02-08T16:22:27Z")

</div>

Thanks. your Suggestion is working

But What if i want to filter list (Which Contains Length).

---

<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:** [February 8, 2022, 4:26pm UTC](https://forum.dynamobim.com/t/duct-tagging-using-conditional-statement/73128/4 "2022-02-08T16:26:09Z")

</div>

I’m not sure I follow. The `list` input is the list that gets filtered. If you wanted to separate the lengths then you would supply the lengths list. However, in this case, you need to supply an element to be tagged so you filter the elements _based_ on length.

---

<div class="post-metadata">

**Author:** ![irfankhan888969](https://avatars.discourse-cdn.com/v4/letter/i/f05b48/32.png) [@irfankhan888969](https://forum.dynamobim.com/u/irfankhan888969)\
**Post date:** [February 8, 2022, 4:34pm UTC](https://forum.dynamobim.com/t/duct-tagging-using-conditional-statement/73128/5 "2022-02-08T16:34:49Z")

</div>

Thanks. Its Working. (Accepting as a Solution)

---

<div class="post-metadata">

**Author:** ![Robert\_Younger](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/robert_younger/32/205603_2.png) [@Robert\_Younger](https://forum.dynamobim.com/u/Robert_Younger)\
**Post date:** [February 8, 2022, 11:29pm UTC](https://forum.dynamobim.com/t/duct-tagging-using-conditional-statement/73128/6 "2022-02-08T23:29:34Z")

</div>

Related note: your script can potentially tag rise/drop (vertical) ductwork unless you are intending to manually select horizontal ducts via your Select Model Elements node. You may want to consider adding a duct slope filter depending on what your final goal is.

---

<div class="post-metadata">

**Author:** ![irfankhan888969](https://avatars.discourse-cdn.com/v4/letter/i/f05b48/32.png) [@irfankhan888969](https://forum.dynamobim.com/u/irfankhan888969)\
**Post date:** [February 9, 2022, 3:35pm UTC](https://forum.dynamobim.com/t/duct-tagging-using-conditional-statement/73128/7 "2022-02-09T15:35:33Z")

</div>

Thanks for your suggestion.
