Hi @prasannamurumkar ,
Here the question is which tags you want to collect?
Do you want to collect Roomtags or DoorTags?
this code will help you to collect RoomTags
FilteredElementCollector Collector = new FilteredElementCollector(doc,doc.ActiveView.Id).OfCategory(BuiltInCategory.OST_RoomTags).WhereElementIsNotElementType();
IList<ElementId> eids = Collector.ToElementIds() as IList<ElementId>;
foreach(ElementId eid in eids)
{
Element e = doc.GetElement(eid);
RoomTag IT = e as RoomTag;
string s=IT.TagText;
}
and this code will help you to collect DoorTags
FilteredElementCollector Collector = new FilteredElementCollector(doc,doc.ActiveView.Id).OfCategory(BuiltInCategory.OST_DoorTags).WhereElementIsNotElementType();
IList<ElementId> eids = Collector.ToElementIds() as IList<ElementId>;
foreach(ElementId eid in eids)
{
Element e = doc.GetElement(eid);
IndependentTag IT = e as IndependentTag;
string s=IT.TagText;
}
I tested the above codes and both are working fine for me.
Naveen Kumar T
Developer Technical Services
Autodesk Developer Network