All Instances from Element Type

I’m honestly drawing a blank on whether or not this is possible without Python :thinking: here’s the Python code I have for this:

import clr
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
doc = DocumentManager.Instance.CurrentDBDocument

texttype = UnwrapElement(IN[0])

if not isinstance(IN[0], 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:
			texts.append(x)

OUT = texts

IN[0] should be the TextNoteType you are pulling with your x[0] Code Block but it can also accept a list of TextNoteTypes

4 Likes