Since Revit has System Families and Component Families we need a way to handle both. The problem is System Families do not have any representation on Revit API besides its name. That’s why we reference families here as texts.
You can do your own
Famly Filter like this.
As you can see this filter is not the fastest ever since is a combination of two slow filters,
Type Filter is the slow one here, and tooks 4.5s to run the Query.
Alternatively, if you don’t need a
Filter to combine it latter on a more complex one, but you just need the result, there is a fastest way skipping the
Type Filter and getting the instances of each Type using the
Type Instances and then trimming the tree to have same data structure that only takes 1.5s.