# Hide in view

**URL:** <https://forum.dynamobim.com/t/hide-in-view/2452>\
**Category:** Packages\
**Tags:** archi-lab\
**Created:** [October 27, 2015, 9:24am UTC](https://forum.dynamobim.com/t/hide-in-view/2452 "2015-10-27T09:24:38Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [October 27, 2015, 9:24am UTC](https://forum.dynamobim.com/t/hide-in-view/2452/1 "2015-10-27T09:24:38Z")

</div>

Hi,

I’m looking for a node that can hide elements in a selected view.

So, create a list of elements (query) and hide them in view.

Probably a silly question.

Any tips?

Marcel

&nbsp;

---

<div class="post-metadata">

**Author:** ![Danny\_Jones](https://avatars.discourse-cdn.com/v4/letter/d/439d5e/32.png) [@Danny\_Jones](https://forum.dynamobim.com/u/Danny_Jones)\
**Post date:** [October 27, 2015, 10:29am UTC](https://forum.dynamobim.com/t/hide-in-view/2452/2 "2015-10-27T10:29:10Z")

</div>

Marcel, try this, I set it for the active view but you could pipe in a list pretty easily.

import clr  
clr.AddReference(‘ProtoGeometry’)  
from Autodesk.DesignScript.Geometry import \*

# Import DocumentManager and TransactionManager

clr.AddReference(“RevitServices”)  
import RevitServices  
from RevitServices.Persistence import DocumentManager  
from RevitServices.Transactions import TransactionManager

# Import RevitAPI

clr.AddReference(“RevitAPI”)  
import Autodesk  
from Autodesk.Revit.DB import \*

doc = DocumentManager.Instance.CurrentDBDocument  
uiapp = DocumentManager.Instance.CurrentUIApplication  
app = uiapp.Application

from System.Collections.Generic import \*

doc = DocumentManager.Instance.CurrentDBDocument  
ActiveView = doc.ActiveView

elements = []  
for i in IN[0]:  
elements.append(UnwrapElement(i))

idsToHide = ListAutodesk.Revit.DB.ElementId  
for i in elements:  
idsToHide.Add([i.Id](http://i.Id))  
TransactionManager.Instance.EnsureInTransaction(doc)  
ActiveView.HideElements(idsToHide)  
TransactionManager.Instance.TransactionTaskDone()  
OUT = idsToHide

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [December 10, 2015, 8:52am UTC](https://forum.dynamobim.com/t/hide-in-view/2452/3 "2015-12-10T08:52:56Z")

</div>

Hi,

I am a little lost here but i think i have to change the line that says “ActiveView=doc.ActiveView” into something else.

I havent done any pythoncode yet, i just copied some pieces from other people here in the forum.

Can somebody elaborate on what is needed here?

&nbsp;

Marcel

---

<div class="post-metadata">

**Author:** ![Konrad\_K\_Sobon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/konrad_k_sobon/32/8838_2.png) [@Konrad\_K\_Sobon](https://forum.dynamobim.com/u/Konrad_K_Sobon)\
**Post date:** [December 10, 2015, 9:41am UTC](https://forum.dynamobim.com/t/hide-in-view/2452/4 "2015-12-10T09:41:08Z")

</div>

Marcel,

Based on the example above I made two nodes for you. One to hide elements in a current view and one to unhide them. Here’s how to hide:

![Capture](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/2/2ae2cdbf9de1ab267acd85fe1510656412a938ef.png)

&nbsp;

&nbsp;

Here’s how to hide them:

![Capture1](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/a/ac56b63ad08348a11028eb5fe0b13819efde5d39.png)

&nbsp;

Now, the only difference is that I added a check for whether elements are already hidden in the view so that Revit doesn’t throw an error.

---

<div class="post-metadata">

**Author:** ![Konrad\_K\_Sobon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/konrad_k_sobon/32/8838_2.png) [@Konrad\_K\_Sobon](https://forum.dynamobim.com/u/Konrad_K_Sobon)\
**Post date:** [December 10, 2015, 9:42am UTC](https://forum.dynamobim.com/t/hide-in-view/2452/5 "2015-12-10T09:42:17Z")

</div>

Those nodes should have two inputs and second one is a boolean:

 ![Capture2](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/1X/46017bae6f11d8be6ab09ebd70372fe726a1b822.png)

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [December 10, 2015, 12:39pm UTC](https://forum.dynamobim.com/t/hide-in-view/2452/6 "2015-12-10T12:39:32Z")

</div>

Hello Konrad,

Yhank you so very much!

However, what i was looking for was to alter the behavior of the node to process a list of views.

I should have been more clear.

The end result would be to hide certain sections in views that do not comply to a rule.

I have tried but a filter can not do what i want it to do.

&nbsp;

Marcel

&nbsp;

---

<div class="post-metadata">

**Author:** ![Konrad\_K\_Sobon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/konrad_k_sobon/32/8838_2.png) [@Konrad\_K\_Sobon](https://forum.dynamobim.com/u/Konrad_K_Sobon)\
**Post date:** [December 10, 2015, 2:24pm UTC](https://forum.dynamobim.com/t/hide-in-view/2452/7 "2015-12-10T14:24:21Z")

</div>

Well that shouldn’t be too hard:

 ![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/0/0d09fb3c6d5f6bcdb8ed5a14b0ab4b4669622d8d.png)

&nbsp;

 ![Untitled-1](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/b/bf12c18508c23dc6ad770951d815fdd89d3336cf.png)

&nbsp;

 ![Untitled-2](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/a/a142d023cd02118074399e7e565511ac2df21b4e.png)

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [December 11, 2015, 5:29am UTC](https://forum.dynamobim.com/t/hide-in-view/2452/8 "2015-12-11T05:29:42Z")

</div>

Thank you Konrad !

I retyping everything in a Pythonnode.

Hope i dont make any typo’s

Can you post the code in something i can download?

Marcel

---

<div class="post-metadata">

**Author:** ![Konrad\_K\_Sobon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/konrad_k_sobon/32/8838_2.png) [@Konrad\_K\_Sobon](https://forum.dynamobim.com/u/Konrad_K_Sobon)\
**Post date:** [December 11, 2015, 8:46am UTC](https://forum.dynamobim.com/t/hide-in-view/2452/9 "2015-12-11T08:46:16Z")

</div>

Marcel,

Normally I don’t share code as images, but this forum is an abomination to all technology forums and as long as there isn’t a decent syntax highlighting implemented I refuse to use it.

Ps. I also believe that you will benefit from re-typing it. Who knows, maybe you will learn a thing or two about Python and won’t have to rely on others to provide ready samples next time.

Good luck!

---

<div class="post-metadata">

**Author:** ![Alisder\_Brown](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alisder_brown/32/14995_2.png) [@Alisder\_Brown](https://forum.dynamobim.com/u/Alisder_Brown)\
**Post date:** [January 12, 2016, 6:04am UTC](https://forum.dynamobim.com/t/hide-in-view/2452/10 "2016-01-12T06:04:10Z")

</div>

Konrad/Danny Thanks for this! Its helped me understand a bit more of Python writing it out like this 🙂 As tedious as it was 😛 Im trying to do something similar but cant seem to get it to play nice! I have a Plan view with an Elevation marker in the middle of a room, i only want this elevation marker visible in this one view. I dont want to turn off the visibility off in the VG as i need to see other elevation markers in other views, and i cant get the elevation circle to disappear using filters (i can get the wee black triangles to work via filters, just not the circle) So i was using this to select the elevation marker \> Get a list of all plans, filter out the plan i want to keep it in \> then feed this into your above solution but it does not seem to do anything. See attached definition. Any help would be greatly appreciated [Hide in View](http://dynamobim.org/wp-content/uploads/forum-assets/alisder-brownoutlook-com/01/12/Hide-in-View.dyn) \<-----

&nbsp;

EDIT:: Managed to get the outout i needed using filters, i was being stupid haha. But i would still like to know how i would do this using Dynamo. Thanks 🙂

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [January 23, 2016, 2:08pm UTC](https://forum.dynamobim.com/t/hide-in-view/2452/11 "2016-01-23T14:08:30Z")

</div>

Hi,

Im wondering if this is an issue concerning revit 2015 R2.

Im using Revit 2015 UR8, and nothing is happening using this Python script.

I tried and tried again.

What could be wrong here?

Marcel

&nbsp;

---

<div class="post-metadata">

**Author:** ![Manuel\_Lopez1](https://avatars.discourse-cdn.com/v4/letter/m/5f9b8f/32.png) [@Manuel\_Lopez1](https://forum.dynamobim.com/u/Manuel_Lopez1)\
**Post date:** [May 7, 2016, 3:42am UTC](https://forum.dynamobim.com/t/hide-in-view/2452/12 "2016-05-07T03:42:38Z")

</div>

Hi Konrad.

I’m getting the following error message in both Pyton scripts when i set boolean to true:

“Advertencia: IronPythonEvaluator.Error en la operación EvaluateIronPythonScript.  
Traceback (most recent call last):  
File “\<string\>”, line 67, in \<module\>  
ImportError: No module named traceback”

I’ve checked several times the code looking for any typing mistake but it’s ok.

Maybe because Dynamo’s instalation is in spanish language?

I’m using other projects and they work fine.

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [May 7, 2016, 5:25am UTC](https://forum.dynamobim.com/t/hide-in-view/2452/13 "2016-05-07T05:25:56Z")

</div>

Hi Manuel,

here is a node for this now, saw it in the latest Archi-lab package.

Thanks to Konrad.

Marcel

---

<div class="post-metadata">

**Author:** ![Manuel\_Lopez1](https://avatars.discourse-cdn.com/v4/letter/m/5f9b8f/32.png) [@Manuel\_Lopez1](https://forum.dynamobim.com/u/Manuel_Lopez1)\
**Post date:** [May 8, 2016, 3:59am UTC](https://forum.dynamobim.com/t/hide-in-view/2452/14 "2016-05-08T03:59:55Z")

</div>

Thank you very much. It now works properly.

---

<div class="post-metadata">

**Author:** ![Thomasbsmits](https://avatars.discourse-cdn.com/v4/letter/t/e56c9b/32.png) [@Thomasbsmits](https://forum.dynamobim.com/u/Thomasbsmits)\
**Post date:** [December 12, 2017, 11:54am UTC](https://forum.dynamobim.com/t/hide-in-view/2452/15 "2017-12-12T11:54:19Z")

</div>

@Konrad_K_Sobon  
I’ve been trying to eddit the node so that the output contains the elements that were hidden in the FloorPlans for review purposes. Since I’m posting, it is without success.

Goal is to check multiple floorplans for hidden elements. Can this node be used for this goal and if so, what is the part thats need to be eddited?

Hope to hear from u
