I am missing something really simple here but for the life of me I cannot figure it out. I am trying to select all Text Instances of a Particular type. I know I can run All elements of type with TextNote rather than TextNoteType or all Elements of Category but that takes a long time to collect all the text notes. I only need the text notes of one of the text note types.
I’m honestly drawing a blank on whether or not this is possible without Python here’s the Python code I have for this:
from RevitServices.Persistence import DocumentManager
from Autodesk.Revit.DB import *
doc = DocumentManager.Instance.CurrentDBDocument
texttype = UnwrapElement(IN)
if not isinstance(IN, list): texttype = [texttype]
alltext = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_TextNotes)
texts = 
for type in texttype:
for x in alltext:
if x.TextNoteType.Id == type.Id:
OUT = texts
IN should be the TextNoteType you are pulling with your x Code Block but it can also accept a list of TextNoteTypes
I can’t find a way to get the elements without iterating through all text notes in document. The Python code above also does the same. Both are not ideal as number of texts in a project can be quite a lot.
I could be wrong on this, but I was under the assumption that the background processing of filtering elements in Python was faster than directly filtering through them in Dynamo… I have experienced myself that filtering a collection of all elements of a type in Dynamo tends to take longer than doing so in Python; If someone could correct me on this if I am wrong, I would truly appreciate it