Filter by Current Design Option
Overview
Unlike previous approaches, this filter returns a number of elements, not a collector. The ElementDesignOptionFilter
class is used, providing a design option as an argument.
Example
-
Get the active design option ID:
activeOptId = DesignOption.GetActiveDesignOptionId(doc)
-
Create the filter and collect elements:
filtro = ElementDesignOptionFilter(activeOptId)
elems = FilteredElementCollector(doc).WherePasses(filtro).ToElements()
Note
Any design option can be passed as an argument, not necessarily the current option. The filter can also be inverted with a Boolean value as a second argument.