Filtering FamilyInstances by multiple categories via FamilySymbols
This filter combines an inclusion list with the two-step relationship pattern to select placed elements across multiple categories.
(
/* Category inclusion */
$CategoryInclusion := ["OST_Doors", "OST_Windows"];
/* Filter FamilySymbols by category */
$familySymbols := $[
type = "FamilySymbol"
and values.category.label in $CategoryInclusion
].id;
/* Filter FamilyInstances by their FamilySymbol */
$[
type = "FamilyInstance"
and parent.id in $familySymbols
].{
"id": id,
"type": type,
"name": name,
"parent": parent.id
}
)
What this filter does
"Select all placed door and window elements by first selecting the relevant types, then selecting all instances that use those types."
Why the two steps are necessary
Category data lives on FamilySymbol, not on FamilyInstance. Filtering instances directly by category is fragile — the correct approach is always:
- Filter symbols by category → collect their IDs
- Filter instances where
parent.idis in that set
This pattern is correct for any rule that applies to placed elements of specific categories. See Two-Step Filtering for the full explanation.
Typical use cases
Use this structure for rules like:
- "All placed doors and windows must have a Mark"
- "Door and window instances must be on a valid level"
- "No placed element in these categories may have an empty Assembly Code"
Any rule that combines multiple categories with instance-level validation starts here.