Selecting Parent Element(Multi Rebar Annotation) from individual Tag Id

ok

Hi,
I took your script and recoded in a different way, I guess is simplified, I was not understanding everything in the previous one.


import clr

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

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

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

doc = DocumentManager.Instance.CurrentDBDocument
coll = FilteredElementCollector(doc,doc.ActiveView.Id)
tagsinview = coll.OfCategory(BuiltInCategory.OST_RebarTags).ToElements()

duptags = []
unique = []

for t in tagsinview:
	
	id = t.TaggedLocalElementId
	
	if id in unique:
		duptags.append(t)
	else:
		unique.append(id)
		
OUT = duptags

I hope this is what you were looking for

1 Like

Il use this code…Its clearer…However your using’ single tag’ on a single rebar i use multi rebar tag on groups of rebars …my problem is when you run the code …and get the element , tags and isolate …the tags will not be seen in the isolated view only the elments wil be shown.