How to find all view-dependent families in the project (listed under "Annotation Symbols")?

Sorry for the banal question,

but I need to isolate the 2D, view dependent families from the regular 3D families.

In other words, I need a list of all families under “Annotation Symbols”, in the browser.

This post from 2021 had a python code for exactly what I need but it does not work for me:

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.

Hi Nick,

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
1 Like

By the way,

Clockwork had a node Category.Type which does what I needed.

Another morning wasted in a wild goose chase…

:roll_eyes:

Take the category types with a grain of salt, e.g. Detail Components are listed as Model instead of Annotation.

1 Like

Yes, I know, detail items are view dependent like ANNOs but actually print at different sizes depending on the view scale, just like model elements.

So I guess they are considered a “model” category because they are indeed like models elements, just 2D instead of 3D.

This distinction works for us, we only need to manage separately the Annotations categories, as listed in the project browser…