Element.IsTagged 'RoomTag' object has no attribute 'TaggedLocalElementId'

Hi, this script was working really well to tag things that wernt tag. However now I’ve started to get this issue below. I pulled the guys of the node out to show the error. Any suggestions? :thinking: :slight_smile:

Can you take a screenshot of the python code too?

Hard to solve without that :slight_smile:

I ended up just deleting the room tags and tagging from scratch to get around it. The codes below if your interested :slight_smile:

If your keen on a python challenge some help with this would be awesome! :rofl:

#python nodes in dynamo 1.0
#proposed by Julien Benoit @jbenoit44 
#http://aecuandme.wordpress.com/
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
# Import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
# Import geometry conversion extension methods
clr.ImportExtensions(Revit.GeometryConversion)
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *
# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

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

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

ids, tags = [], []

# Start Transaction
#TransactionManager.Instance.EnsureInTransaction(doc)


for i in elt:
	if i.TaggedLocalElementId.IntegerValue != -1:
		ids.append(i.TaggedLocalElementId)
		tags.append(i)
	else:
		continue
		

# End Transaction
#TransactionManager.Instance.TransactionTaskDone()

OUT = ids, tags

On line 40 of the script, the element you’re calling .TaggedLocalElementId on doesn’t have that property. This is because it’s a roomtag which doesn’t have this property. Read the description of the revit api (link below) for more information.

https://www.revitapidocs.com/2020/e52073e2-9d98-6fb5-eb43-288cf9ed2e28.htm

1 Like