Area Tag's Tagged element can't be found

Hello,

I am struggling to get tagged Areas from list of Area tags.

I first tried Tag.TaggedElement, but the node is reporting Area tags are under Revit.Elements.UnknownElement object type.

So I took an attempt to replicate code from link below but it is still telling me the same thing.

http://dynamobim.com/forums/topic/get-tag-host-element/

Does anyone know a way to capture Area hosts from Area tags?

I appreciate your help in advance!

Hi @JTY

This should get what you are after:

import clr

#Import the Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *

#Import DocumentManager and TransactionManager
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager

#Reference the active Document and application
doc = DocumentManager.Instance.CurrentDBDocument

#Start scripting here:

tags = IN[0]

#Assign your output to the OUT variable.
OUT = [i.Area for i in UnwrapElement(tags)]

This is Revit 2018.2 and Dynamo 2.0.1 BTW.

1 Like

That was fast @MartinSpence !

This solved my problem, Many Thanks to you! I should probably start studying Revit API…

No problem :-).

A little bit of python and learning to navigate the API is rewarding! It does also require investment though :slight_smile:

2 Likes

How can make this work for dynamo 1.3.3?

Hi Francisco,

You can also use the Tag Get tagged Element node that works with areas, rooms, spaces and other elements.

Tag%20Get%20tagged%20Element

Thanks Alban!!!
is this a new node on your package???

You’re welcome.
You probably need to update the package if you can’t find it.

Hello,
I am using dynamo 1.3.3 is your most up to date package compatible?

Absolutely.
All nodes are developed in 1.3.3 to ensure compatibility with version 1.3.3 and 2.0.

However, the latest versions of the package are released to the Package Manager with Dynamo 2.0 to try to minimize failures on some computers when updating or installing the package on version 2.0 (a strange bug).

great,
Many thanks!!!

Another option posted to your original request.

1 Like