Commands › › Add Filter To View
Add Filter To View
Coming soon
Before you run this
Active document; filterName and viewName parameters supplied.
After it runs
Filter is present on the view with the requested visibility when the helper returns true.
When to use this
- Turn on a discipline filter on a working floor plan or section for QA checks.
Don't use this when
View templates — use AddFilterToTemplateCommand.
Inputs
| Name | Kind | Type | Required | Default | Description |
|---|---|---|---|---|---|
viewName |
config | string |
no | — | Exact name of the target view (not a template) |
filterName |
config | string |
no | — | Existing filter element name |
visible |
config | boolean |
no | true | Filter visibility (default true) |
Returns
| Name | Type | Description |
|---|---|---|
success | bool | Whether the filter was applied |
viewId | int | Target view element id when successful |
What you'll see in the chat
on start
Applying the filter to your view...
Resolving the target view and filter...
Checking view type (must not be a template)...
Resolving the target view and filter...
Checking view type (must not be a template)...
thinking
Read viewName, filterName, and optional visible from command parameters.
Resolve the view with ListViews.FindByExactName (case-insensitive exact match).
Reject template views; suggest AddFilterToTemplateCommand if IsTemplate.
Parse visible; recover to true if the value is not a valid boolean.
Start a manual transaction, call AddFilterToView.AddFilter(Autodesk.Revit.DB.View, string, bool).
Commit on success; roll back when the helper returns false.
Resolve the view with ListViews.FindByExactName (case-insensitive exact match).
Reject template views; suggest AddFilterToTemplateCommand if IsTemplate.
Parse visible; recover to true if the value is not a valid boolean.
Start a manual transaction, call AddFilterToView.AddFilter(Autodesk.Revit.DB.View, string, bool).
Commit on success; roll back when the helper returns false.
on success
Filter '{filterName}' is applied on view '{viewName}'.
on failure
Could not add filter to view: {error}
REST API
Not yet exposed
This command does not carry a [RestApi] attribute today. Once tagged, this section will auto-populate with:
POST /api/v1/commands/add_filter_to_view- Request body schema (from
[RestApiParam]) - Response schema (from
[RestApiResponse]) - curl / JS / Python code examples
Keywords & intent patterns
add filter to view · apply filter view · filter on view
Related
| Related commands | AddFilterToTemplateCommand · CreateFilterCommand |
|---|---|
| Pillar |