Aggregate Elements
revit_aggregate_elementsGroup Revit elements by fields like category or level to get counts, sums, and averages. Use for breakdowns rather than listing individual rows.
Instructions
Summarize matching elements by one or two fields after revit_list_catalog.
Returns data with matchedElements and groups containing keys, count and optional numericCount, sum, average and unit. Lengths use mm, areas m2 and volumes m3; groups without numeric values have null sum and average. No matches return groups=[]; invalid field or filter names raise errors even for empty results. Call revit_list_catalog first; prefer this tool for counts and breakdowns, and revit_query_elements only for individual rows. For area totals, group by level and select the area scheme. A missing document, read failure or timeout raises an error; partial data is not returned.
If more than one Revit instance is running, document is required; otherwise any instance may respond.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| view | No | Exact non-template view name from the views catalog, matched case-insensitively, to restrict the element collector. Default null searches the document without a view filter; combines with the other model filters. | |
| level | No | ||
| phase | No | ||
| family | No | ||
| workset | No | ||
| document | No | Case-insensitive substring of the target active document title or file name; default null leaves requests unaddressed, so any instance may respond. Use a unique substring with multiple instances; revit_list_instances instead returns all matching instances, or all instances when omitted. | |
| group_by | Yes | Required list of one or two distinct system fields (e.g. category, family, type, level) or exact localized parameter names from the catalog; no default. Each combination produces a count, with numeric totals added by sum_field. | |
| sum_field | No | Numeric system field or exact localized parameter name to sum and average within each group. Default null omits numeric aggregation; lengths use mm, areas m2, volumes m3, and other quantities use the returned unit. | |
| type_name | No | Exact type name to match, case-insensitively, combined with the other model filters. Default null applies no type filter; discover names with the family-types catalog. | |
| categories | No | ||
| area_scheme | No | Exact area-scheme name from the area-schemes catalog, matched case-insensitively. Default null applies no scheme filter; selecting a scheme restricts results to its areas and combines with the other filters. | |
| timeout_seconds | No | Positive integer seconds to wait for a result after pickup (120 when omitted); HTTP uses this as its response budget. Expiry raises an error, and increasing it does not override the add-in's execution limits. | |
| parameter_filters | No | AND-combined objects with an exact localized parameter name in parameter, an operator (equals, contains, greater, less, empty, not-empty, exists), and value for comparisons; default null applies no parameter filters. Numeric values use mm, m2, m3 or other document display units; contains requires text, and empty/not-empty/exists need no value. | |
| pickup_timeout_seconds | No | Positive integer seconds to wait for the add-in to pick up a local or SSH job (300 when omitted); ignored over HTTP. A pickup timeout raises an error but the pending job may still execute later. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||