Get Tag host element

Thanks Sean! Would you be kind enough to modify to Get model element IDs? Or would it need to be specific to wall elements and floor and so on

Feel like I’m close
image

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

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

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

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

dataEnteringNode = IN
tags = UnwrapElement(IN[0])
taggedelements = []
taggedelementids = []
doc = DocumentManager.Instance.CurrentDBDocument
TransactionManager.Instance.EnsureInTransaction(doc)

for i in tags:
	tagID = doc.GetElement(i.Id)
	taggedElem = doc.GetElement(tagID.TaggedLocalElementId)
	taggedelements.append(taggedElem)
	taggedelementids.append(taggedElem.Id)

TransactionManager.Instance.EnsureInTransaction(doc)

OUT = taggedelements,taggedelementids