# Struggling with hide element

**URL:** <https://forum.dynamobim.com/t/struggling-with-hide-element/23080>\
**Category:** Revit\
**Created:** [June 25, 2018, 2:05pm UTC](https://forum.dynamobim.com/t/struggling-with-hide-element/23080 "2018-06-25T14:05:59Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![EzDoesIt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ezdoesit/32/70125_2.png) [@EzDoesIt](https://forum.dynamobim.com/u/EzDoesIt)\
**Post date:** [June 25, 2018, 2:05pm UTC](https://forum.dynamobim.com/t/struggling-with-hide-element/23080/1 "2018-06-25T14:05:59Z")

</div>

Hi all,

I have search previous topics but still can get my solution.

Problem 1.  
I feed 3 StructuralPlanViews in the **string.contains** but only one (the last one) appears.

 ![Why%20only%20one](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/8/785320d7bd9872004609609f05b857698f5e7db8.PNG)

Problem 2.  
The node **View.HideElements** is not working as i tought is should. I feed the sections wich i want to hide in “Element” and the view(s), where these sections are, to “View”.

 ![element%20hide%20error](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/0/f0ee38fa156c071fc3665e0de34c40d845dd6b59.PNG)

 ![total](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/9/e9429768d2fbc8424f64e6ac359409f7ccae44a8.png)

here is the dyn file [Tekening dupliceren.dyn](https://forum.dynamobim.com/uploads/short-url/lXS47h9PhSFJuEiRmJyNuHuxPEA.dyn) (33.4 KB)

Hope someone could help me out.

Thnks Edwin

---

<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:** [June 25, 2018, 2:40pm UTC](https://forum.dynamobim.com/t/struggling-with-hide-element/23080/2 "2018-06-25T14:40:12Z")

</div>

You’re trying to hide the actual view element, which won’t work. You want to hide the section graphic element. Unfortunately there’s no good way to get these elements (last time I checked).

Here’s a little trick you can try that usually works:

- Get the element Id from the section view elements

- Subtract 1 from the Id (this is usually the Id of the graphical element associated with a view)

- Get the element from the new Id (Rutabaga has a node Revit.ElementById or you can use python)

---

<div class="post-metadata">

**Author:** ![EzDoesIt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ezdoesit/32/70125_2.png) [@EzDoesIt](https://forum.dynamobim.com/u/EzDoesIt)\
**Post date:** [June 26, 2018, 7:08am UTC](https://forum.dynamobim.com/t/struggling-with-hide-element/23080/3 "2018-06-26T07:08:55Z")

</div>

@ nick,

thanks for pointing me in the right direction that the ID from a section on a view is not the same as the ID from the section itself.  
I manage to created this solution but i guess it only works with one item as input in the python node (from Kulkul), i hope someone could help me to rewrite this to make it works with a list of items.  
I am sadly not familiar with python.

 ![element%20hide%20working](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/8/e8c63f7636e5d16a35c14493190600e2c09fa171.PNG)

thnks.

---

<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:** [June 26, 2018, 12:16pm UTC](https://forum.dynamobim.com/t/struggling-with-hide-element/23080/4 "2018-06-26T12:16:07Z")

</div>

Can you show the node previews? What is your input for the python node? You can create a simple for loop to iterate through a list.

---

<div class="post-metadata">

**Author:** ![EzDoesIt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ezdoesit/32/70125_2.png) [@EzDoesIt](https://forum.dynamobim.com/u/EzDoesIt)\
**Post date:** [June 26, 2018, 12:33pm UTC](https://forum.dynamobim.com/t/struggling-with-hide-element/23080/5 "2018-06-26T12:33:04Z")

</div>

Hi Nick,

Here it is.

![Python%20node](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/2/421d56d8440a20ca97be3e978482eda92de8e0da.PNG)  
import clr  
clr.AddReference(‘RevitAPI’)  
from Autodesk.Revit.DB import \*

clr.AddReference(‘RevitServices’)  
import RevitServices  
from RevitServices.Persistence import DocumentManager

views = UnwrapElement(IN[0])

elements =   
doc = DocumentManager.Instance.CurrentDBDocument  
cat = doc.Settings.Categories.get\_Item(BuiltInCategory.OST\_Views)  
for view in views:  
collector = FilteredElementCollector(doc, view.Id)  
elements.append(collector.ToElements())

OUT = elements

thnks

---

<div class="post-metadata">

**Author:** ![EzDoesIt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ezdoesit/32/70125_2.png) [@EzDoesIt](https://forum.dynamobim.com/u/EzDoesIt)\
**Post date:** [June 26, 2018, 12:36pm UTC](https://forum.dynamobim.com/t/struggling-with-hide-element/23080/6 "2018-06-26T12:36:55Z")

</div>

Here are the node previews  
At this moment i have only one planview this is because of problem 1 at the top of this topic eventually this must be a list of ‘plans’ (structural and floorplans)

 ![element%20hide%20working%20node%20preview](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/7/f7a0dd77dda106557b0fe6a7e1021824af122292.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:** [June 26, 2018, 12:42pm UTC](https://forum.dynamobim.com/t/struggling-with-hide-element/23080/7 "2018-06-26T12:42:20Z")

</div>

> [@EzDoesIt](#):
>
> it only works with one item as input in the python node

I don’t quite understand the problem here. The collector is already a list so this should work with multiple input views.

---

<div class="post-metadata">

**Author:** ![EzDoesIt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ezdoesit/32/70125_2.png) [@EzDoesIt](https://forum.dynamobim.com/u/EzDoesIt)\
**Post date:** [June 26, 2018, 1:27pm UTC](https://forum.dynamobim.com/t/struggling-with-hide-element/23080/8 "2018-06-26T13:27:51Z")

</div>

You’re absolutely right i quickly simulate multiple input and it works as it should be.

Still problem 1 i don’t understand why after String.Contains only 1 item came out as true.

 ![Why%20only%20one%20II](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/e/8e5a659f1c360f834193df958377dec49711ddfd.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:** [June 26, 2018, 1:40pm UTC](https://forum.dynamobim.com/t/struggling-with-hide-element/23080/9 "2018-06-26T13:40:58Z")

</div>

Oh i see what you’re saying. You’re flattening Element.Name which is removing the list structure for when you mask your sublists. Get rid of the Flatten node and use list levels with your BoolMask.

---

<div class="post-metadata">

**Author:** ![EzDoesIt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ezdoesit/32/70125_2.png) [@EzDoesIt](https://forum.dynamobim.com/u/EzDoesIt)\
**Post date:** [June 26, 2018, 2:09pm UTC](https://forum.dynamobim.com/t/struggling-with-hide-element/23080/10 "2018-06-26T14:09:47Z")

</div>

i am thinking around and around but i just don’t get it what am i doing wrong here.

 ![Why%20only%20one%20III](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/1/518d30552d4bae57c873e07d5d5c608066622b76.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:** [June 26, 2018, 2:17pm UTC](https://forum.dynamobim.com/t/struggling-with-hide-element/23080/11 "2018-06-26T14:17:27Z")

</div>

Oh I was talking about your previous image with the element name.

In this case, try changing `String.Contains` to `searchFor @L2`. That will give you a separate sublist for each search term. Then you’ll have to use list level `@L2` again for `mask` on the `FilterByBoolMask` node.

---

<div class="post-metadata">

**Author:** ![EzDoesIt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ezdoesit/32/70125_2.png) [@EzDoesIt](https://forum.dynamobim.com/u/EzDoesIt)\
**Post date:** [June 26, 2018, 7:16pm UTC](https://forum.dynamobim.com/t/struggling-with-hide-element/23080/12 "2018-06-26T19:16:58Z")

</div>

Thanks Nick for your time and answers i finally got it working.

Just started this part over from the beginning and considering your suggestion @L…

 ![working](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/d/fdcab8e611d22e804416bac0aed77813f50e0f33.PNG)

Edwin
