Can you show us the code you have? The important part of that linked code is the x.Family.FamilyCategory.CategoryType == CategoryType.Annotation line. This is the condition you’re looking for. You should be able to just rewrite the filter or loop through each FamilySymbol individually.
here is the (totally new) code, and it seems like it’s working (after only 10 or 15 ChatGTP iterations):
# Import necessary libraries
import clr
clr.AddReference('RevitAPI')
clr.AddReference('RevitServices')
from Autodesk.Revit.DB import FilteredElementCollector, Family
from Autodesk.Revit.DB import CategoryType
from RevitServices.Persistence import DocumentManager
# Get the current document
doc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument.Document
# Collect all families in the document
collector = FilteredElementCollector(doc)
all_families = collector.OfClass(Family).WhereElementIsNotElementType().ToElements()
# Filter families based on their CategoryType being Annotation
annotation_families_filtered = []
for family in all_families:
if family.FamilyCategory is not None and family.FamilyCategory.CategoryType == CategoryType.Annotation:
annotation_families_filtered.append(family)
# Output the filtered list of annotation families
OUT = annotation_families_filtered