# Hide all lines of a specific line style / texts of a specific text type

**URL:** <https://forum.dynamobim.com/t/hide-all-lines-of-a-specific-line-style-texts-of-a-specific-text-type/5240>\
**Category:** Revit\
**Created:** [July 26, 2016, 6:41pm UTC](https://forum.dynamobim.com/t/hide-all-lines-of-a-specific-line-style-texts-of-a-specific-text-type/5240 "2016-07-26T18:41:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ToanDN](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/toandn/32/11582_2.png) [@ToanDN](https://forum.dynamobim.com/u/ToanDN)\
**Post date:** [July 26, 2016, 6:41pm UTC](https://forum.dynamobim.com/t/hide-all-lines-of-a-specific-line-style-texts-of-a-specific-text-type/5240/1 "2016-07-26T18:41:39Z")

</div>

Hi,

I am trying to create a script to hide all lines of a specific Line Styles. I have followed the instructions from [this very similar topic](https://forum.dynamobim.com/t/delete-all-detail-lines-with-a-specific-line-style-parameter-how/951) to create the script attached. But when I run the script, all lines in the project disappear. Looks like it fails to filter out the target Line Styles.

Any hints much appreciated!

-Toan

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

---

<div class="post-metadata">

**Author:** ![Mostafa\_El\_Ayoubi](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mostafa_el_ayoubi/32/7815_2.png) [@Mostafa\_El\_Ayoubi](https://forum.dynamobim.com/u/Mostafa_El_Ayoubi)\
**Post date:** [July 26, 2016, 7:11pm UTC](https://forum.dynamobim.com/t/hide-all-lines-of-a-specific-line-style-texts-of-a-specific-text-type/5240/2 "2016-07-26T19:11:34Z")

</div>

Hi @ToanDN ,  
what I can say from your screenshot is that the problem most probably happens when you filter your list. Nothing comes out of the “In” output, and thats where the lines of the line style you want should be… I would be intersted in seeing what comes out of the list.map node…

Anyway,  
You can try this if you’d like:

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/9/99425f2c2966af6bf110a96c7e4de3e1a60d1119.JPG)  
This little code will get all lines of a linestyle (then you can hide them with the view.hideelements node) :

```
import clr
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

doc = DocumentManager.Instance.CurrentDBDocument

alllines = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Lines)
n = IN[0]
lines = [x for x in alllines if x.LineStyle.Name == n]

OUT = lines

```

I have wrapped it in a node called “all lines of linestyle” in the Node-Mode package.

I hope this helps

---

<div class="post-metadata">

**Author:** ![ToanDN](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/toandn/32/11582_2.png) [@ToanDN](https://forum.dynamobim.com/u/ToanDN)\
**Post date:** [July 26, 2016, 7:19pm UTC](https://forum.dynamobim.com/t/hide-all-lines-of-a-specific-line-style-texts-of-a-specific-text-type/5240/3 "2016-07-26T19:19:15Z")

</div>

Wow… that is so simple and working great. Thank you very much!

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/4/4205d389c9b149161df2f4e413e32f58d4c5266e.png)

---

<div class="post-metadata">

**Author:** ![ToanDN](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/toandn/32/11582_2.png) [@ToanDN](https://forum.dynamobim.com/u/ToanDN)\
**Post date:** [July 26, 2016, 9:30pm UTC](https://forum.dynamobim.com/t/hide-all-lines-of-a-specific-line-style-texts-of-a-specific-text-type/5240/4 "2016-07-26T21:30:51Z")

</div>

So I am creating a very similar script to hide all text of a specific text type. The list shows correct items being filtered but the final command fails. Please advise. Thanks!

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

---

<div class="post-metadata">

**Author:** ![Mostafa\_El\_Ayoubi](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mostafa_el_ayoubi/32/7815_2.png) [@Mostafa\_El\_Ayoubi](https://forum.dynamobim.com/u/Mostafa_El_Ayoubi)\
**Post date:** [July 26, 2016, 10:10pm UTC](https://forum.dynamobim.com/t/hide-all-lines-of-a-specific-line-style-texts-of-a-specific-text-type/5240/5 "2016-07-26T22:10:13Z")

</div>

The issue here is that you’re giving the view.hideelements strings instead of revit elements. This should work:

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/4/4281e21b3bb803a50986bbe06c8916e0a0ec6728.JPG)

---

<div class="post-metadata">

**Author:** ![Leo\_Hart](https://avatars.discourse-cdn.com/v4/letter/l/57b2e6/32.png) [@Leo\_Hart](https://forum.dynamobim.com/u/Leo_Hart)\
**Post date:** [April 10, 2017, 4:44pm UTC](https://forum.dynamobim.com/t/hide-all-lines-of-a-specific-line-style-texts-of-a-specific-text-type/5240/6 "2017-04-10T16:44:29Z")

</div>

Hi everyone,  
I have a similar problem with the hide/unhide node from archi-lab pakage.  
I try to hide a CAD file but unfortunately it occurs an error:

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

I can’t figure out what is wrong, any advice?

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [April 10, 2017, 5:00pm UTC](https://forum.dynamobim.com/t/hide-all-lines-of-a-specific-line-style-texts-of-a-specific-text-type/5240/7 "2017-04-10T17:00:09Z")

</div>

> [@Leo\_Hart](#):
>
> I try to hide a CAD file but unfortunately it occurs an error:

Hi @Leo_Hart Could you please start a new topic and add this topic as reference. Thanks.
