# Collect Tags

**URL:** <https://forum.dynamobim.com/t/collect-tags/68873>\
**Category:** Revit\
**Created:** [October 5, 2021, 1:21am UTC](https://forum.dynamobim.com/t/collect-tags/68873 "2021-10-05T01:21:16Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![michael.bronson](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@michael.bronson](https://forum.dynamobim.com/u/michael.bronson)\
**Post date:** [October 5, 2021, 1:21am UTC](https://forum.dynamobim.com/t/collect-tags/68873/1 "2021-10-05T01:21:16Z")

</div>

Why is it so hard to get all the tags in a view? What am I missing. Please help!

 ![Mirror Annotations wip_2021-10-04_09-19-34](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/7/e74bb9662d3dfd2c14af6e67404997315409b9f6.png)

---

<div class="post-metadata">

**Author:** ![GavinNicholls](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gavinnicholls/32/190442_2.png) [@GavinNicholls](https://forum.dynamobim.com/u/GavinNicholls)\
**Post date:** [October 5, 2021, 2:49am UTC](https://forum.dynamobim.com/t/collect-tags/68873/2 "2021-10-05T02:49:41Z")

</div>

My first (unlikely) guess is the active view may not be what you think it is. In this case I can get window tags using either method. If a null is returned my guess is there aren’t any. Double check you have a single space between those names too, looks like it could be 2.

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

It appears some collectors don’t pick up tags which is frustrating, so if that node uses a similar collection method that could also be why (more likely, but can’t see the node’s innards), see below for an example:

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

As a desperate measure, this method exhausts most categories and seems to get the tags also. I use the ElementView node from my package (Crumple) to filter out all elements not specific to the view, so you’re left with mostly tags, dimensions, textnotes etc.

 ![force all categories](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/2/02136dee72a390316752c2efeb575a145573145a.png)

---

<div class="post-metadata">

**Author:** ![paris](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/paris/32/144289_2.png) [@paris](https://forum.dynamobim.com/u/paris)\
**Post date:** [October 5, 2021, 5:43am UTC](https://forum.dynamobim.com/t/collect-tags/68873/3 "2021-10-05T05:43:22Z")

</div>

Hi @michael.bronson are you using english version of Revit? Maybe try the same node of Springs package  
Cheers

---

<div class="post-metadata">

**Author:** ![lkichenin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/lkichenin/32/96679_2.png) [@lkichenin](https://forum.dynamobim.com/u/lkichenin)\
**Post date:** [October 5, 2021, 9:57am UTC](https://forum.dynamobim.com/t/collect-tags/68873/4 "2021-10-05T09:57:56Z")

</div>

Hey there,

I suggest an alternative approach using the OwnedByView method. With that you can retrieve all view specific elements and from then on filter them to target the tags.

Here are the nodes and the Python snippet :

```auto
import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager

doc = DocumentManager.Instance.CurrentDBDocument

active_view = IN[0]

view_specific_elements = FilteredElementCollector(doc).WhereElementIsNotElementType().OwnedByView(ElementId(active_view.Id)).ToElements()

OUT = view_specific_elements

```

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

---

<div class="post-metadata">

**Author:** ![michael.bronson](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@michael.bronson](https://forum.dynamobim.com/u/michael.bronson)\
**Post date:** [October 5, 2021, 3:47pm UTC](https://forum.dynamobim.com/t/collect-tags/68873/5 "2021-10-05T15:47:21Z")

</div>

So why does yours work, and mine does not? What Dynamo version are you using? I just installed Revit 2020 and 2021.

This is what I get.

 ![Dynamo issue](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/6/c6df3aeae10dc870a4526ac00b37db6fd0debf7a.png)

Thanks for any help,  
frustrated Mike

---

<div class="post-metadata">

**Author:** ![michael.bronson](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@michael.bronson](https://forum.dynamobim.com/u/michael.bronson)\
**Post date:** [October 5, 2021, 4:14pm UTC](https://forum.dynamobim.com/t/collect-tags/68873/6 "2021-10-05T16:14:04Z")

</div>

I ran a test on a new project with all doors, windows and walls tagged - and it works perfect as shown via Gavin’s response.(Thank you)

If I start a new project, add a link, tag all linked elements, it give me the error. Why would a linked element cause the “All Elements of Category” node to crash?

Thanks,  
Mike

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [October 5, 2021, 5:33pm UTC](https://forum.dynamobim.com/t/collect-tags/68873/7 "2021-10-05T17:33:29Z")

</div>

> [@michael.bronson](#):
>
> Why would a linked element cause the “All Elements of Category” node to crash?

Hi,

This is indeed the reason.  
Use the _Collect.ElementsInView_ node from Spring Nodes or the _SelectByCateOrType_ node of the _Genius Loci_ package.  
 ![select](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/1/211619a5e5d3f6fe9f8895122de8327f09e3c49a.png)

---

<div class="post-metadata">

**Author:** ![michael.bronson](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@michael.bronson](https://forum.dynamobim.com/u/michael.bronson)\
**Post date:** [October 5, 2021, 5:51pm UTC](https://forum.dynamobim.com/t/collect-tags/68873/8 "2021-10-05T17:51:07Z")

</div>

That’s exactly what was happening. Your solution worked perfect.

HUGE thank you to Alban. You saved my !#@@#%^&.

Mike in Maryland
