Revit 2022 API |
ParameterFilterElement..::..SetElementFilter Method |
ParameterFilterElement Class See Also |
Sets the rules that must be satisfied for a given element to pass this filter.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 22.0.0.0 (22.1.0.0)
Since:
2019
Syntax
C# |
---|
public bool SetElementFilter( ElementFilter elementFilter ) |
Visual Basic |
---|
Public Function SetElementFilter ( _ elementFilter As ElementFilter _ ) As Boolean |
Visual C++ |
---|
public: bool SetElementFilter( ElementFilter^ elementFilter ) |
Parameters
- elementFilter
- Type: Autodesk.Revit.DB..::..ElementFilter
An ElementFilter representing the rules. It may be an ElementParameterFilter representing a conjunction of one or more FilterRules, or an ElementLogicalFilter (of type LogicalAndFilter or LogicalOrFilter) representing a logical combination of FilterRules, using AND/OR operations.
Return Value
Returns true if this ParameterFilterElement was changed, false if not. It will not be changed if the input rules are equivalent to the ParameterFilterElement's existing rules.
Remarks
Note that in some situation, calling GetElementFilter after calling SetElementFilter
may return an ElementFilter that is structurally different from the one passed as input
to SetElementFilter. For example, if the input ElementFilter contains an ElementParameterFilter
that contains more than one FilterRule, and if the view filters dialog box is used in between
the calls to SetElementFilter and GetElementFilter, the output ElementFilter will use a single
ElementParameterFilter for each of the FilterRules that were bundled in an input ElementParameterFilter.
The two ElementFilters will be logically and functionally equivalent in the sense that any given
Element will either be accepted by both ElementFilters or rejected by both ElementFilters.
Exceptions
Exception | Condition |
---|---|
Autodesk.Revit.Exceptions..::..ArgumentException | One of the given rules refers to a parameter that does not apply to this filter's categories. |
Autodesk.Revit.Exceptions..::..ArgumentNullException | A non-optional argument was null |
Autodesk.Revit.Exceptions..::..ArgumentsInconsistentException | The ElementFilter is not acceptable for use by a ParameterFilterElement. |