pi-revit 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +167 -0
- package/CHANGELOG.md +465 -430
- package/README.md +604 -548
- package/bin/pi-revit.js +9 -9
- package/docs/architecture.md +271 -0
- package/docs/evaluation.md +434 -0
- package/docs/invariants.json +147 -0
- package/extensions/pi-revit/completion-monitor.ts +55 -0
- package/extensions/pi-revit/contracts.ts +146 -0
- package/extensions/pi-revit/discovery.ts +93 -0
- package/extensions/pi-revit/index.ts +342 -255
- package/extensions/pi-revit/instance-router.ts +86 -86
- package/extensions/pi-revit/platform-prompt.ts +40 -0
- package/extensions/pi-revit/scope-monitor.ts +114 -0
- package/extensions/pi-revit/script-library.ts +144 -144
- package/extensions/pi-revit/tool-catalog.ts +113 -14
- package/extensions/pi-revit/tool-documentation.ts +72 -0
- package/extensions/pi-revit/tool-schema.ts +8 -0
- package/package.json +8 -2
- package/scripts/build.ps1 +9 -9
- package/scripts/check-sdk.ps1 +66 -66
- package/scripts/check-tool-documentation.mjs +287 -0
- package/scripts/deploy.ps1 +16 -16
- package/scripts/generate-contracts.mjs +80 -0
- package/scripts/lib/platform.mjs +226 -0
- package/scripts/test-extension.mjs +15 -0
- package/skills/pi-revit/SKILL.md +30 -218
- package/skills/pi-revit/contracts.generated.json +3524 -0
- package/skills/pi-revit/references/execution-rules.md +41 -0
- package/skills/pi-revit/references/model-audit-export.md +38 -27
- package/skills/pi-revit/references/operation-recovery.md +33 -0
- package/skills/pi-revit/references/room-documentation.md +37 -26
- package/skills/pi-revit/references/tool-index.md +89 -0
- package/skills/pi-revit/references/tools/capture_view.md +62 -0
- package/skills/pi-revit/references/tools/change_element_types.md +65 -0
- package/skills/pi-revit/references/tools/create_tags.md +85 -0
- package/skills/pi-revit/references/tools/delete_elements.md +66 -0
- package/skills/pi-revit/references/tools/execute_csharp.md +81 -0
- package/skills/pi-revit/references/tools/export_documents.md +75 -0
- package/skills/pi-revit/references/tools/find_revit_tools.md +96 -0
- package/skills/pi-revit/references/tools/get_element_details.md +66 -0
- package/skills/pi-revit/references/tools/get_element_relationships.md +61 -0
- package/skills/pi-revit/references/tools/get_element_types.md +67 -0
- package/skills/pi-revit/references/tools/get_elements.md +87 -0
- package/skills/pi-revit/references/tools/get_linked_elements.md +79 -0
- package/skills/pi-revit/references/tools/get_linked_models.md +57 -0
- package/skills/pi-revit/references/tools/get_model_coordinates.md +64 -0
- package/skills/pi-revit/references/tools/get_model_health.md +53 -0
- package/skills/pi-revit/references/tools/get_model_overview.md +57 -0
- package/skills/pi-revit/references/tools/get_revit_operation.md +54 -0
- package/skills/pi-revit/references/tools/get_schedule_fields.md +62 -0
- package/skills/pi-revit/references/tools/get_schedules.md +71 -0
- package/skills/pi-revit/references/tools/manage_element_sets.md +92 -0
- package/skills/pi-revit/references/tools/manage_revit_instances.md +63 -0
- package/skills/pi-revit/references/tools/manage_revit_scripts.md +109 -0
- package/skills/pi-revit/references/tools/manage_schedules.md +90 -0
- package/skills/pi-revit/references/tools/manage_selection.md +66 -0
- package/skills/pi-revit/references/tools/manage_sheet_placements.md +82 -0
- package/skills/pi-revit/references/tools/manage_sheets.md +71 -0
- package/skills/pi-revit/references/tools/manage_views.md +95 -0
- package/skills/pi-revit/references/tools/measure_geometry.md +71 -0
- package/skills/pi-revit/references/tools/open_view.md +59 -0
- package/skills/pi-revit/references/tools/ping.md +41 -0
- package/skills/pi-revit/references/tools/query_spatial_elements.md +74 -0
- package/skills/pi-revit/references/tools/read_revit_result.md +53 -0
- package/skills/pi-revit/references/tools/search_api_docs.md +65 -0
- package/skills/pi-revit/references/tools/set_parameters.md +75 -0
- package/skills/pi-revit/references/tools/summarize_elements.md +64 -0
- package/skills/pi-revit/references/tools/transform_elements.md +79 -0
- package/skills/pi-revit/references/visual-verification.md +36 -0
- package/skills/pi-revit/tool-manifest.json +338 -0
- package/src/Revit/BridgeServer.cs +93 -87
- package/src/Revit/OperationStore.cs +178 -178
- package/src/Revit/ToolRegistry.cs +88 -57
- package/src/Revit/Tools/CaptureView.cs +10 -2
- package/src/Revit/Tools/ChangeElementTypes.cs +74 -60
- package/src/Revit/Tools/ChangeSet.cs +39 -0
- package/src/Revit/Tools/CreateTags.cs +107 -95
- package/src/Revit/Tools/DeleteElements.cs +53 -44
- package/src/Revit/Tools/DocumentGuard.cs +74 -64
- package/src/Revit/Tools/ElementNames.cs +103 -0
- package/src/Revit/Tools/ElementQueryScope.cs +27 -27
- package/src/Revit/Tools/ElementTraits.cs +53 -0
- package/src/Revit/Tools/ExecuteCsharp.cs +54 -45
- package/src/Revit/Tools/ExportDocuments.cs +129 -121
- package/src/Revit/Tools/GetElementDetails.cs +37 -41
- package/src/Revit/Tools/GetElementRelationships.cs +82 -76
- package/src/Revit/Tools/GetElementTypes.cs +8 -0
- package/src/Revit/Tools/GetElements.cs +75 -86
- package/src/Revit/Tools/GetLinkedElements.cs +89 -82
- package/src/Revit/Tools/GetLinkedModels.cs +73 -66
- package/src/Revit/Tools/GetModelCoordinates.cs +56 -49
- package/src/Revit/Tools/GetModelHealth.cs +7 -0
- package/src/Revit/Tools/GetModelOverview.cs +185 -158
- package/src/Revit/Tools/GetScheduleFields.cs +44 -37
- package/src/Revit/Tools/GetSchedules.cs +96 -89
- package/src/Revit/Tools/InheritedState.Summary.cs +57 -0
- package/src/Revit/Tools/InheritedState.cs +144 -0
- package/src/Revit/Tools/ManageElementSets.cs +114 -106
- package/src/Revit/Tools/ManageSchedules.cs +174 -164
- package/src/Revit/Tools/ManageSelection.cs +45 -37
- package/src/Revit/Tools/ManageSheetPlacements.cs +113 -97
- package/src/Revit/Tools/ManageSheets.cs +72 -63
- package/src/Revit/Tools/ManageViews.cs +115 -100
- package/src/Revit/Tools/MeasureGeometry.cs +60 -54
- package/src/Revit/Tools/ModelChanges.cs +154 -0
- package/src/Revit/Tools/ModelEditBatch.cs +105 -102
- package/src/Revit/Tools/ModelEditInputs.cs +49 -49
- package/src/Revit/Tools/OpenView.cs +9 -2
- package/src/Revit/Tools/ParameterResolver.cs +94 -0
- package/src/Revit/Tools/QuerySpatialElements.cs +70 -63
- package/src/Revit/Tools/SearchApiDocs.cs +72 -4
- package/src/Revit/Tools/SetParameters.cs +60 -79
- package/src/Revit/Tools/SpatialBounds.cs +30 -30
- package/src/Revit/Tools/SummarizeElements.cs +94 -87
- package/src/Revit/Tools/ToolContract.cs +48 -0
- package/src/Revit/Tools/ToolSupport.cs +5 -1
- package/src/Revit/Tools/TransformElements.cs +72 -57
- package/workspace/AGENTS.md +26 -20
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# measure_geometry
|
|
2
|
+
|
|
3
|
+
## Purpose and preconditions
|
|
4
|
+
|
|
5
|
+
Measure exact distance between explicitly supplied points or approximate separation of two host elements' model bounding boxes. Activate with `find_revit_tools`; both modes require an active document. Linked contents are not traversed. Choose a mode that answers the question without overstating what was measured.
|
|
6
|
+
|
|
7
|
+
<!-- generated:contract:start (npm run generate:contracts; do not edit this block) -->
|
|
8
|
+
## Contract (generated)
|
|
9
|
+
|
|
10
|
+
- **Source:** bridge tool, advanced tier: activate it with `find_revit_tools`.
|
|
11
|
+
- **Writes model:** no. **Effects:** none. **Requires an open document:** yes.
|
|
12
|
+
- **Works in:** project and family documents.
|
|
13
|
+
- **Contract hash:** `34cc9bf1c26888bd`. `find_revit_tools` compares it with the selected bridge's live contract.
|
|
14
|
+
|
|
15
|
+
| Input | Type | Required | Default | Allowed values |
|
|
16
|
+
| --- | --- | --- | --- | --- |
|
|
17
|
+
| `mode` | string | yes | | `point_distance`, `bounding_box_gap` |
|
|
18
|
+
| `unit` | string | yes | | `millimeters`, `centimeters`, `meters`, `feet`, `inches` |
|
|
19
|
+
| `point_a` | array of number | no | | |
|
|
20
|
+
| `point_b` | array of number | no | | |
|
|
21
|
+
| `element_a_id` | integer | no | | |
|
|
22
|
+
| `element_b_id` | integer | no | | |
|
|
23
|
+
| `clearance` | number | no | | |
|
|
24
|
+
| `expected_document_id` | string | no | | |
|
|
25
|
+
|
|
26
|
+
Bridge calls also accept `_operation_id`, only to retry an identical earlier request (see [operation recovery](../operation-recovery.md)).
|
|
27
|
+
|
|
28
|
+
| Not covered by this tool | Use instead |
|
|
29
|
+
| --- | --- |
|
|
30
|
+
| Exact solid-to-solid distance or clash detection | Revit API: ElementIntersectsElementFilter; ElementIntersectsSolidFilter; ReferenceIntersector. Check all its members in one call: `search_api_docs` with query `ElementIntersectsElementFilter; ElementIntersectsSolidFilter; ReferenceIntersector`, then use `execute_csharp` within the requested scope. |
|
|
31
|
+
<!-- generated:contract:end -->
|
|
32
|
+
|
|
33
|
+
## Public inputs
|
|
34
|
+
|
|
35
|
+
- Required `mode`: `point_distance` or `bounding_box_gap`.
|
|
36
|
+
- Required `unit`: `millimeters`, `centimeters`, `meters`, `feet`, or `inches`; applies to point inputs, clearance threshold, and all returned coordinates/distances.
|
|
37
|
+
- Point mode requires `point_a` and `point_b`, each three finite coordinates in document internal axes. Omit both element IDs and `clearance` entirely.
|
|
38
|
+
- Box mode requires positive integer `element_a_id` and `element_b_id` in the host; omit point arguments. Optional `clearance` is a finite nonnegative box-proximity threshold in the selected unit.
|
|
39
|
+
- Optional `expected_document_id`: exact read guard. Optional `_operation_id`: exact previous ID for identical retry only.
|
|
40
|
+
|
|
41
|
+
## Examples
|
|
42
|
+
|
|
43
|
+
The supplied points are illustrative; the result measures those points, not any implied element surfaces.
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{ "mode": "point_distance", "unit": "meters", "point_a": [0, 0, 0], "point_b": [3, 4, 0] }
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Replace these illustrative IDs with two discovered host elements:
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{ "mode": "bounding_box_gap", "unit": "millimeters", "element_a_id": 12345, "element_b_id": 12346, "clearance": 100 }
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Results and verification
|
|
56
|
+
|
|
57
|
+
Point mode returns `approximate: false`, exact Euclidean `distance`, signed `delta` from A to B, both input points, coordinate frame, and unit. Exactness applies to the given points, not to how those points were chosen.
|
|
58
|
+
|
|
59
|
+
Box mode returns `approximate: true`, `distance`, nonnegative `axis_gaps`, element identities/bounds, `boxes_overlap_or_touch`, and the optional threshold classification. `box_gap_below_clearance` uses strict less-than; equality does not pass it. `boxes_overlap_or_touch` includes contact. There is no pagination.
|
|
60
|
+
|
|
61
|
+
A box gap is only a lower bound on physical geometry separation; boxes can include nonphysical geometry. Zero gap means enclosing boxes touch/overlap, not that solids clash. A threshold hit identifies a candidate for further review, not a verified clearance violation. Preserve the result's method and approximation labels. A missing model box fails the whole measurement rather than treating it as zero distance.
|
|
62
|
+
|
|
63
|
+
Verify units, frame, element identities, and intended measurement meaning. Use exact geometry investigation for claims requiring actual surfaces. See [execution rules](../execution-rules.md) for document/result handling and [visual verification](../visual-verification.md) if the wider task produces visible changes.
|
|
64
|
+
|
|
65
|
+
## Effects and recovery
|
|
66
|
+
|
|
67
|
+
Read-only: no geometry edits, dimensions, markers, UI changes, save, or export. Mixed mode arguments, invalid numbers/units, missing elements, or absent boxes fail. Reinspect inputs rather than substituting another mode without explaining its meaning. Follow [operation recovery](../operation-recovery.md) for bridge/identity uncertainty.
|
|
68
|
+
|
|
69
|
+
## Compatibility
|
|
70
|
+
|
|
71
|
+
Source reference: PI-Revit 0.5.0, [MeasureGeometry.cs](../../../../src/Revit/Tools/MeasureGeometry.cs), shared length/vector parsing, and public identity/retry inputs. Revit 2025–2027 bridge targets; no new live validation is claimed.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# open_view
|
|
2
|
+
|
|
3
|
+
## Purpose and boundaries
|
|
4
|
+
|
|
5
|
+
Queue activation of an existing view or sheet in the Revit UI, like opening it in the Project Browser. It creates no view and edits no model data. Use `manage_views` or `manage_sheets` for authoring.
|
|
6
|
+
|
|
7
|
+
Contract: PI-Revit 0.5.0 source, [OpenView.cs](../../../../src/Revit/Tools/OpenView.cs). The current public schema is authoritative. This page documents source behavior, not a live-model test.
|
|
8
|
+
|
|
9
|
+
<!-- generated:contract:start (npm run generate:contracts; do not edit this block) -->
|
|
10
|
+
## Contract (generated)
|
|
11
|
+
|
|
12
|
+
- **Source:** bridge tool, core tier: active by default.
|
|
13
|
+
- **Writes model:** no. **Effects:** ui. **Requires an open document:** yes.
|
|
14
|
+
- **Works in:** project and family documents.
|
|
15
|
+
- **Verify the outcome:** `none`: no durable outcome to check; report what was done.
|
|
16
|
+
- **Contract hash:** `6bb71caab2e5304b`. `find_revit_tools` compares it with the selected bridge's live contract.
|
|
17
|
+
|
|
18
|
+
| Input | Type | Required | Default | Allowed values |
|
|
19
|
+
| --- | --- | --- | --- | --- |
|
|
20
|
+
| `view_id` | integer | no | | |
|
|
21
|
+
| `name` | string | no | | |
|
|
22
|
+
| `expected_document_id` | string | yes | | |
|
|
23
|
+
|
|
24
|
+
Bridge calls also accept `_operation_id`, only to retry an identical earlier request (see [operation recovery](../operation-recovery.md)).
|
|
25
|
+
|
|
26
|
+
| Not covered by this tool | Use instead |
|
|
27
|
+
| --- | --- |
|
|
28
|
+
| Creating views | Tool: manage_views |
|
|
29
|
+
<!-- generated:contract:end -->
|
|
30
|
+
|
|
31
|
+
## Inputs and preconditions
|
|
32
|
+
|
|
33
|
+
| Input | Meaning |
|
|
34
|
+
| --- | --- |
|
|
35
|
+
| `view_id` | Existing view or sheet ID. Takes precedence over `name`. Discover with `get_elements` or use a committed creation result. |
|
|
36
|
+
| `name` | When no ID is supplied: exact view name, sheet number such as `A-101`, or `number - name`, matched case-insensitively. Ambiguous names fail; use an ID. |
|
|
37
|
+
| `expected_document_id` | Required even though the tool is read-classified: activation changes UI state. Copy the intended model's exact current `project.documentId`. |
|
|
38
|
+
| `_operation_id` | Optional extension argument only for an identical retry. Omit for a new operation. |
|
|
39
|
+
|
|
40
|
+
At least one of `view_id` or `name` is required at execution. View templates and Revit views that cannot be activated are rejected. An active edit can prevent activation; resolve it before retrying. Follow [execution rules](../execution-rules.md).
|
|
41
|
+
|
|
42
|
+
## Example
|
|
43
|
+
|
|
44
|
+
ID `23456` is illustrative; replace it with a discovered or committed view ID.
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"view_id": 23456,
|
|
49
|
+
"expected_document_id": "<project.documentId>"
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Results, effects and verification
|
|
54
|
+
|
|
55
|
+
The result contains `requestedViewId`, `viewName`, and `viewType`. It confirms that activation was queued, not that a screenshot already shows that view. Revit performs the view change after control returns to it.
|
|
56
|
+
|
|
57
|
+
There is no preview transaction and no model save. A capture relying on the active view in the same call batch can show the previous view. Prefer a subsequent `capture_view` with the explicit target `view_id`, open the returned image, and follow [visual verification](../visual-verification.md).
|
|
58
|
+
|
|
59
|
+
If a call times out or its status is unclear, follow [operation recovery](../operation-recovery.md); check the requested view and actual UI before issuing a new operation.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# ping
|
|
2
|
+
|
|
3
|
+
## Purpose and preconditions
|
|
4
|
+
|
|
5
|
+
Check whether the selected local Revit bridge is reachable and which Revit/add-in version is loaded. No open document is required. Pi registers this utility independently of bridge tool discovery, so it remains available when Revit is closed or specialist tools are missing. Multiple sessions may require [explicit selection](manage_revit_instances.md).
|
|
6
|
+
|
|
7
|
+
<!-- generated:contract:start (npm run generate:contracts; do not edit this block) -->
|
|
8
|
+
## Contract (generated)
|
|
9
|
+
|
|
10
|
+
- **Source:** Pi extension utility, always active.
|
|
11
|
+
- **Writes model:** no. **Effects:** none. **Requires an open document:** no.
|
|
12
|
+
- **Contract hash:** `aefaeb4355d5d822`. `find_revit_tools` compares it with the selected bridge's live contract.
|
|
13
|
+
|
|
14
|
+
| Input | Type | Required | Default | Allowed values |
|
|
15
|
+
| --- | --- | --- | --- | --- |
|
|
16
|
+
| _(none)_ | | | | |
|
|
17
|
+
|
|
18
|
+
| Not covered by this tool | Use instead |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| Whether a project document is open | Tool: get_model_overview |
|
|
21
|
+
<!-- generated:contract:end -->
|
|
22
|
+
|
|
23
|
+
## Public inputs and example
|
|
24
|
+
|
|
25
|
+
The public input is an empty object. This utility does not accept document-identity or retry fields.
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Results and effects
|
|
32
|
+
|
|
33
|
+
The current bridge returns `ok`, `service`, `revitVersion`, `pid`, `addinVersion`, `bridgeId`, and `supportsOperationTracking`. The extension appends a warning when installed package and loaded add-in versions differ, or a note when tool registration just succeeded or failed. Ping can trigger discovery/registration, but does not execute a model operation or activate all specialist tools. It may bind an initial sole session through normal instance routing.
|
|
34
|
+
|
|
35
|
+
## Failures and recovery
|
|
36
|
+
|
|
37
|
+
A missing bridge usually means Revit is closed, still starting, or the add-in did not load. When user action is needed, identify that requirement. A successful ping can coexist with failed tool discovery; retry ping or restart Pi if discovery remains unavailable. Do not treat ping success as proof that a document is open. Selected-session failures require listing/selecting the intended current instance rather than automatic fallback.
|
|
38
|
+
|
|
39
|
+
## Verification and compatibility
|
|
40
|
+
|
|
41
|
+
Check the returned Revit/add-in version and any warning before relying on version-specific contracts. This utility uses a 10-second request budget and has no model operation receipt. Updating the Pi package does not replace the already loaded add-in; use the package's installation/upgrade procedure for a matching deployment. Do not deploy or restart merely because an unrelated task requested inspection. Contract source: `extensions/pi-revit/index.ts` (`registerPing`); bridge response: `src/Revit/BridgeServer.cs` (`/ping`).
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# query_spatial_elements
|
|
2
|
+
|
|
3
|
+
## Purpose and preconditions
|
|
4
|
+
|
|
5
|
+
Find host elements whose model axis-aligned bounding boxes intersect or fit inside a specified region. Activate with `find_revit_tools`; use the intended active document. This is an approximate candidate query, not a solid-intersection or clash detector, and it does not traverse linked contents.
|
|
6
|
+
|
|
7
|
+
<!-- generated:contract:start (npm run generate:contracts; do not edit this block) -->
|
|
8
|
+
## Contract (generated)
|
|
9
|
+
|
|
10
|
+
- **Source:** bridge tool, advanced tier: activate it with `find_revit_tools`.
|
|
11
|
+
- **Writes model:** no. **Effects:** none. **Requires an open document:** yes.
|
|
12
|
+
- **Works in:** project documents only; the bridge refuses other documents before running, with the route to use instead.
|
|
13
|
+
- **Contract hash:** `0018676c125da56c`. `find_revit_tools` compares it with the selected bridge's live contract.
|
|
14
|
+
|
|
15
|
+
| Input | Type | Required | Default | Allowed values |
|
|
16
|
+
| --- | --- | --- | --- | --- |
|
|
17
|
+
| `query` | object | no | | |
|
|
18
|
+
| `min` | array of number | yes | | |
|
|
19
|
+
| `max` | array of number | yes | | |
|
|
20
|
+
| `unit` | string | yes | | `millimeters`, `centimeters`, `meters`, `feet`, `inches` |
|
|
21
|
+
| `relation` | string | no | | `intersects`, `inside` |
|
|
22
|
+
| `offset` | integer | no | | |
|
|
23
|
+
| `limit` | integer | no | | |
|
|
24
|
+
| `expected_document_id` | string | no | | |
|
|
25
|
+
|
|
26
|
+
Bridge calls also accept `_operation_id`, only to retry an identical earlier request (see [operation recovery](../operation-recovery.md)).
|
|
27
|
+
|
|
28
|
+
| Not covered by this tool | Use instead |
|
|
29
|
+
| --- | --- |
|
|
30
|
+
| Solid-intersection clash detection | Revit API: ElementIntersectsElementFilter; ElementIntersectsSolidFilter. Check all its members in one call: `search_api_docs` with query `ElementIntersectsElementFilter; ElementIntersectsSolidFilter`, then use `execute_csharp` within the requested scope. |
|
|
31
|
+
| Elements inside linked models | Tool: get_linked_elements with host_bounds |
|
|
32
|
+
<!-- generated:contract:end -->
|
|
33
|
+
|
|
34
|
+
## Public inputs
|
|
35
|
+
|
|
36
|
+
- Required `min` and `max`: arrays of three finite numbers along document internal axes. Every minimum coordinate must be less than or equal to its maximum.
|
|
37
|
+
- Required `unit`: `millimeters`, `centimeters`, `meters`, `feet`, or `inches`. This covers region coordinates and output lengths.
|
|
38
|
+
- Optional `relation`: `intersects` (default) or `inside`. Both include touching boundaries; inside requires the entire element box to fit in the region.
|
|
39
|
+
- Optional `query`: whole-scope `get_elements` filters (`category`, `of_class`, `level`, `type_id`, `in_active_view`, `filter`). No query-level paging, count-only mode, fields, or projections are accepted.
|
|
40
|
+
- Optional outer `offset`: default 0; `limit`: 1–200, default 100. Pages spatial matches.
|
|
41
|
+
- Optional `expected_document_id`: exact read guard. Optional `_operation_id`: exact previous operation ID for identical retry only.
|
|
42
|
+
|
|
43
|
+
## Example
|
|
44
|
+
|
|
45
|
+
This illustrative region is in internal document axes. Replace it with bounds established for the requested part of the intended model; it is not a shared/GIS region.
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"query": { "category": "OST_Walls" },
|
|
50
|
+
"min": [0, 0, 0],
|
|
51
|
+
"max": [10, 10, 3],
|
|
52
|
+
"unit": "meters",
|
|
53
|
+
"relation": "intersects",
|
|
54
|
+
"limit": 100
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Results and verification
|
|
59
|
+
|
|
60
|
+
The candidate query is capped at 10,000 elements **before** spatial testing, even if few boxes intersect. Narrow the category/level/type/filter scope first. `candidate_count` is distinct from spatial `total_count`; `without_bounds_count` counts candidates omitted because no model bounding box exists. Preserve warnings.
|
|
61
|
+
|
|
62
|
+
The result states `method: "axis_aligned_bounding_boxes"`, `approximate: true`, `coordinate_system: "document_internal"`, selected unit/relation, and the normalized region. Element rows include IDs, unique identities, names/categories, and bounds in the requested unit. Results sort by ID; follow `next_offset` for remaining matches.
|
|
63
|
+
|
|
64
|
+
Bounds can include nonphysical geometry. Intersection or containment of enclosing boxes does not establish a physical collision, exact shape containment, or clearance failure. Report candidates with the returned approximation/method labels, then inspect actual geometry if the task requires stronger conclusions. [Visual verification](../visual-verification.md) can support review but does not by itself turn box testing into exact geometry computation.
|
|
65
|
+
|
|
66
|
+
Check coordinate frame, unit, candidate coverage, absent bounds, and page coverage before reporting. Any saved-response continuation is separate; see [execution rules](../execution-rules.md).
|
|
67
|
+
|
|
68
|
+
## Effects and recovery
|
|
69
|
+
|
|
70
|
+
Read-only: no model or UI edits, save, or export. Invalid units/vectors, reversed region bounds, unsupported query fields, or too many candidates fail. Correct the region/scope; do not reinterpret coordinates silently. Use [operation recovery](../operation-recovery.md) for bridge/identity failures.
|
|
71
|
+
|
|
72
|
+
## Compatibility
|
|
73
|
+
|
|
74
|
+
Source reference: PI-Revit 0.5.0, [QuerySpatialElements.cs](../../../../src/Revit/Tools/QuerySpatialElements.cs), shared whole-query scope, and identity/retry inputs. Revit 2025–2027 bridge targets; source-reviewed without new live validation.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# read_revit_result
|
|
2
|
+
|
|
3
|
+
## Purpose and preconditions
|
|
4
|
+
|
|
5
|
+
Read bounded fragments of an oversized response saved locally by this extension. Revit and an open model are unnecessary. Use the opaque `result_id` returned with `file_path` and `complete_inline: false`; this is not an arbitrary file-reading tool or a new query against Revit. <!-- inv:saved-result-sandbox -->
|
|
6
|
+
|
|
7
|
+
<!-- generated:contract:start (npm run generate:contracts; do not edit this block) -->
|
|
8
|
+
## Contract (generated)
|
|
9
|
+
|
|
10
|
+
- **Source:** Pi extension utility, always active.
|
|
11
|
+
- **Writes model:** no. **Effects:** none. **Requires an open document:** no.
|
|
12
|
+
- **Contract hash:** `b318aeb83a3acd30`. `find_revit_tools` compares it with the selected bridge's live contract.
|
|
13
|
+
|
|
14
|
+
| Input | Type | Required | Default | Allowed values |
|
|
15
|
+
| --- | --- | --- | --- | --- |
|
|
16
|
+
| `result_id` | string | yes | | |
|
|
17
|
+
| `offset` | integer | no | | |
|
|
18
|
+
| `limit` | integer | no | | |
|
|
19
|
+
|
|
20
|
+
| Not covered by this tool | Use instead |
|
|
21
|
+
| --- | --- |
|
|
22
|
+
| Paging the original query | Tool: the original query tool (for example get_elements) with its next_offset |
|
|
23
|
+
<!-- generated:contract:end -->
|
|
24
|
+
|
|
25
|
+
## Public inputs and example
|
|
26
|
+
|
|
27
|
+
| Field | Contract |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| `result_id` | Required string returned by this extension instance. |
|
|
30
|
+
| `offset` | Optional nonnegative integer; default `0`. Use the previous `next_offset`. |
|
|
31
|
+
| `limit` | Optional integer `1`–`8000`; default `8000`. JSON escaping may shorten the actual fragment. |
|
|
32
|
+
|
|
33
|
+
Replace the illustrative UUID with the real returned ID:
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"result_id": "00000000-0000-4000-8000-000000000001",
|
|
38
|
+
"offset": 0,
|
|
39
|
+
"limit": 8000
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Results and effects
|
|
44
|
+
|
|
45
|
+
The result contains `result_id`, `offset`, `returned_chars`, `total_chars`, `has_more`, `next_offset`, `fragment: true`, and `text`. Concatenate `text` fragments in order; each page is not a standalone JSON result. Offsets count UTF-16 code units, not bytes or Unicode characters. Follow returned offsets until `has_more` is false when complete data is needed. The model-facing response remains bounded including JSON metadata/escaping, so do not infer progress from requested `limit`.
|
|
46
|
+
|
|
47
|
+
This reads a local saved file without contacting Revit or changing the model. Result IDs last for the current extension instance. After reload, use the original absolute `file_path` with Pi's `read` tool while the file exists. Saved-result continuation does not remove the original query's limits or replace its own row/column/group pagination.
|
|
48
|
+
|
|
49
|
+
## Failures, recovery, and verification
|
|
50
|
+
|
|
51
|
+
An unknown ID can mean the extension reloaded; use the original path. An offset past `total_chars` or invalid limit is rejected. A missing local file requires another source of the original result. On a tracked bridge, [get_revit_operation](get_revit_operation.md) may retain it; do not repeat a model write just to recover its output. A large-result save error can occur after Revit finished, so follow [operation recovery](../operation-recovery.md).
|
|
52
|
+
|
|
53
|
+
Confirm continuity of returned offsets and final completion before treating the reconstructed payload as complete. Keep the query's truncation and pagination labels intact. Contract source: `extensions/pi-revit/index.ts` (`modelContent`, `registerResultReader`); this is a local package contract independent of the loaded Revit version.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# search_api_docs
|
|
2
|
+
|
|
3
|
+
## Purpose and preconditions
|
|
4
|
+
|
|
5
|
+
Search the API documentation belonging to the selected running Revit installation before writing unfamiliar C# calls. This is a core tool; it requires a reachable bridge but no open document. The index reads `RevitAPI.xml` and `RevitAPIUI.xml` beside the loaded assemblies and supplements public enum members from assembly metadata. It does not search Autodesk product Help or explain a complete modeling workflow.
|
|
6
|
+
|
|
7
|
+
<!-- generated:contract:start (npm run generate:contracts; do not edit this block) -->
|
|
8
|
+
## Contract (generated)
|
|
9
|
+
|
|
10
|
+
- **Source:** bridge tool, core tier: active by default.
|
|
11
|
+
- **Writes model:** no. **Effects:** none. **Requires an open document:** no.
|
|
12
|
+
- **Contract hash:** `dea6dc11655529a1`. `find_revit_tools` compares it with the selected bridge's live contract.
|
|
13
|
+
|
|
14
|
+
| Input | Type | Required | Default | Allowed values |
|
|
15
|
+
| --- | --- | --- | --- | --- |
|
|
16
|
+
| `query` | string | yes | | |
|
|
17
|
+
| `kind` | string | no | | `type`, `method`, `property`, `field`, `event` |
|
|
18
|
+
| `max_results` | integer | no | | |
|
|
19
|
+
|
|
20
|
+
Bridge calls also accept `_operation_id`, only to retry an identical earlier request (see [operation recovery](../operation-recovery.md)).
|
|
21
|
+
|
|
22
|
+
| Not covered by this tool | Use instead |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| Autodesk product Help or modeling guidance | User action: Autodesk Revit Help or project standards |
|
|
25
|
+
| Proof that code compiles or works | Tool: execute_csharp |
|
|
26
|
+
<!-- generated:contract:end -->
|
|
27
|
+
|
|
28
|
+
## Public inputs
|
|
29
|
+
|
|
30
|
+
- Required `query`: a nonempty class/member name or substring. Prefer `Wall.Create`, `FilteredElementCollector`, or an enum value over a natural-language question. To verify several members at once, separate up to 10 names with `;`, for example the reference of a tool's API limit.
|
|
31
|
+
- Optional `kind`: `type`, `method`, `property`, `field`, or `event`. Methods include constructors; enum values are fields.
|
|
32
|
+
- Optional `max_results`: 1–50, default 10; for a multi-member query, per member, default 3. There is no offset or continuation page.
|
|
33
|
+
- Optional `_operation_id`: only for an identical retry of a previous bridge request; omit for new searches. This tool has no `expected_document_id` input.
|
|
34
|
+
|
|
35
|
+
## Example
|
|
36
|
+
|
|
37
|
+
Narrow the signature to choose an overload; inspect the result rather than assuming the example identifies the required overload for your task.
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{ "query": "Wall.Create(Document, Curve", "kind": "method", "max_results": 5 }
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Verify every member a script needs in one call instead of one search per member. `find_revit_tools` gives each API limit a ready `lookup` query of this form:
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{ "query": "View3D.CreatePerspective; ViewOrientation3D; View.CropBox" }
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Results and verification
|
|
50
|
+
|
|
51
|
+
A multi-member query returns `lookups` and `results` instead of `matches`: per member its `query`, `totalMatches`, the `best` match (signature, summary, shortened remarks, parameters, returns, and up to three documented exceptions, which state when a member refuses), up to two `alternatives` by signature, and a `note` for a rewrite or a miss. Search a member again on its own when its full remarks or other overloads matter.
|
|
52
|
+
|
|
53
|
+
For a single query, inspect `matches`, `totalMatches`, `returnedCount`, `sources`, and `warnings`. Each match includes signature, assembly, summary, remarks, parameter/return/exception documentation, and `since` where documented. Exact names rank ahead of prefixes and substrings; same-named overloads favor simpler signatures. Narrow the query to bring the relevant overload to the top.
|
|
54
|
+
|
|
55
|
+
Pi receives the structured JSON payload with the full available documentation for returned matches, or a saved-result envelope when it is large; retrieve that result as described in [execution rules](../execution-rules.md). The bridge also builds compact display text, but the current Pi extension does not present it to the model. A top match's presence does not establish that its class is suitable for the desired modeling operation. Read parameter restrictions and confirm the installed Revit version.
|
|
56
|
+
|
|
57
|
+
Creation-factory queries such as `Document.Create.NewRoom` and accessor queries such as `Element.get_Parameter` can be rewritten to the documented member. Verify the returned signatures: the rewrite note exists only in the bridge's compact display text and is not included in Pi's structured result. Public enum values can be searchable even when the XML gives them no description. Missing XML content is a documentation limitation, not proof that a member is absent from the API.
|
|
58
|
+
|
|
59
|
+
## Effects and recovery
|
|
60
|
+
|
|
61
|
+
The first query builds a process-wide lazy index and may take several seconds. Later searches reuse it. It performs no model/UI mutation, save, or export. Missing or unparsable documentation yields warnings; an empty index fails. For transport uncertainty use [operation recovery](../operation-recovery.md). Do not invent signatures when documentation is incomplete; report the gap and use verified API sources or inspection.
|
|
62
|
+
|
|
63
|
+
## Compatibility
|
|
64
|
+
|
|
65
|
+
Source reference: PI-Revit 0.5.0, [SearchApiDocs.cs](../../../../src/Revit/Tools/SearchApiDocs.cs), with the extension's optional retry input. This manual describes source behavior, not a new live validation. Search results depend on the selected installed Revit version (supported bridge targets: 2025–2027).
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# set_parameters
|
|
2
|
+
|
|
3
|
+
## Purpose and boundaries
|
|
4
|
+
|
|
5
|
+
Write parameters or rename elements in the active host document. Use `Name` to rename levels, views, sheets, types, and other elements that support `Element.Name`; the implementation falls back to that property when the Name parameter is missing, read-only, or rejects the write. That fallback rejects a name another object of the same kind already uses (views of one type, levels, grids, types, materials, filters), reporting `name_collision` with the existing object's ID. This tool does not change element types; use `change_element_types` for that.
|
|
6
|
+
|
|
7
|
+
Contract: PI-Revit 0.5.0 source, [SetParameters.cs](../../../../src/Revit/Tools/SetParameters.cs). The current public schema is authoritative. This page documents source behavior, not a live-model test.
|
|
8
|
+
|
|
9
|
+
<!-- generated:contract:start (npm run generate:contracts; do not edit this block) -->
|
|
10
|
+
## Contract (generated)
|
|
11
|
+
|
|
12
|
+
- **Source:** bridge tool, core tier: active by default.
|
|
13
|
+
- **Writes model:** yes. **Effects:** model. **Requires an open document:** yes.
|
|
14
|
+
- **Works in:** project and family documents.
|
|
15
|
+
- **Verify the outcome:** `reread`: query the changed state again with a read tool.
|
|
16
|
+
- **Contract hash:** `20ad3893ff59afa6`. `find_revit_tools` compares it with the selected bridge's live contract.
|
|
17
|
+
|
|
18
|
+
| Input | Type | Required | Default | Allowed values |
|
|
19
|
+
| --- | --- | --- | --- | --- |
|
|
20
|
+
| `preview` | boolean | no | | |
|
|
21
|
+
| `atomic` | boolean | no | | |
|
|
22
|
+
| `updates` | array of object | yes | | |
|
|
23
|
+
| `expected_document` | string | no | | |
|
|
24
|
+
| `expected_document_id` | string | yes | | |
|
|
25
|
+
|
|
26
|
+
Bridge calls also accept `_operation_id`, only to retry an identical earlier request (see [operation recovery](../operation-recovery.md)).
|
|
27
|
+
|
|
28
|
+
| Not covered by this tool | Use instead |
|
|
29
|
+
| --- | --- |
|
|
30
|
+
| Changing an element's type | Tool: change_element_types |
|
|
31
|
+
| Element properties that are not parameters, such as pinned state | Revit API: Element.Pinned. Check all its members in one call: `search_api_docs` with query `Element.Pinned`, then use `execute_csharp` within the requested scope. |
|
|
32
|
+
| Moving or rotating elements | Tool: transform_elements |
|
|
33
|
+
| Family parameters, family types and formulas in a family document | Revit API: FamilyManager.Types; FamilyManager.NewType; FamilyManager.Set; FamilyManager.AddParameter; FamilyManager.SetFormula. Check all its members in one call: `search_api_docs` with query `FamilyManager.Types; FamilyManager.NewType; FamilyManager.Set; FamilyManager.AddParameter; FamilyManager.SetFormula`, then use `execute_csharp` within the requested scope. |
|
|
34
|
+
<!-- generated:contract:end -->
|
|
35
|
+
|
|
36
|
+
## Inputs and preconditions
|
|
37
|
+
|
|
38
|
+
Read [execution rules](../execution-rules.md) before a write or preview. Inspect targets and parameters with `get_element_details` first.
|
|
39
|
+
|
|
40
|
+
| Input | Meaning |
|
|
41
|
+
| --- | --- |
|
|
42
|
+
| `updates` | Required array of 1–200 objects with `element_id`, `parameter`, `value`, and optional `unit`. Each update has its own subtransaction. |
|
|
43
|
+
| `parameter` | Localized display name, language-independent `BuiltInParameter` name, or `guid:<GUID>` for a shared parameter. Prefer an exact identity if display names are missing or ambiguous. |
|
|
44
|
+
| `value` | Matches the parameter storage type: text, number, integer, element ID integer, or boolean for yes/no. Empty text clears a string parameter. Renaming requires nonempty text. |
|
|
45
|
+
| `unit` | For measured numeric values, an explicit compatible unit such as `millimeters`, `feet`, `squareMeters`, or `degrees`. Omission uses this document's display units for the parameter. Omit units for unitless values. |
|
|
46
|
+
| `preview` | Default `false`. Commit-validates accepted changes, then rolls back the enclosing transaction group. |
|
|
47
|
+
| `atomic` | Default `false`: valid updates can commit despite other failures. `true` rolls the whole batch back if any update fails. |
|
|
48
|
+
| `expected_document_id` | Required for every call, including previews: exact current `project.documentId` from `get_model_overview`. |
|
|
49
|
+
| `expected_document` | Optional additional title check; never replaces exact identity. |
|
|
50
|
+
| `_operation_id` | Optional extension argument only for an identical retry of the original request. Omit for a new operation. |
|
|
51
|
+
|
|
52
|
+
Type parameters live on the element type: pass its ID, and assess all affected instances before changing a shared type. `get_element_details` reports `builtInParameter`; for example, `ALL_MODEL_MARK` and `ALL_MODEL_INSTANCE_COMMENTS` avoid translated display names. A display name that matches several parameters on the element fails that update and lists their exact identities (`BuiltInParameter` name or `guid:<GUID>`); nothing is written to an arbitrary one. <!-- inv:parameter-ambiguity --> Retry with one of the listed identities.
|
|
53
|
+
|
|
54
|
+
## Example
|
|
55
|
+
|
|
56
|
+
Illustrative ID `12345` must be replaced with a discovered host element; replace the document placeholder with the exact current identity. This previews a complete batch without retaining changes.
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"expected_document_id": "<project.documentId>",
|
|
61
|
+
"preview": true,
|
|
62
|
+
"atomic": true,
|
|
63
|
+
"updates": [
|
|
64
|
+
{ "element_id": 12345, "parameter": "ALL_MODEL_INSTANCE_COMMENTS", "value": "Reviewed" }
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Results, recovery and verification
|
|
70
|
+
|
|
71
|
+
Inspect `committed`, `succeeded`, `proposed`, `failed`, `commitWarnings`, and `commit_validation_performed`. `updated` counts committed steps, not distinct elements. Entries contain zero-based input `index`, observed `before`/`after`, and `newDisplayValue`; numeric parameter snapshots use internal units with separately formatted display values. Repeated writes to one parameter form a sequence, so an intermediate `after` is not a final-model snapshot. A proposal is not a retained change.
|
|
72
|
+
|
|
73
|
+
An atomic rejection can report proposals without reaching commit validation. Revit commit errors can roll back the whole batch; warnings are auto-dismissed and returned for reporting. Reread affected parameters after a committed change. Follow [visual verification](../visual-verification.md) when the values affect visible results.
|
|
74
|
+
|
|
75
|
+
For an uncertain timeout or cancellation, follow [operation recovery](../operation-recovery.md) before any repeat. A real write following a preview is a new operation because the arguments changed. This tool does not save the model or authorize additional edits.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# summarize_elements
|
|
2
|
+
|
|
3
|
+
## Purpose and preconditions
|
|
4
|
+
|
|
5
|
+
Count the whole matching host scope grouped by category, type name, level ID, or a single raw parameter value. Activate with `find_revit_tools`; use the intended active document. It does not traverse links and supports at most 10,000 matching elements. Use `get_elements.count_only` for a bare total that does not need grouping.
|
|
6
|
+
|
|
7
|
+
<!-- generated:contract:start (npm run generate:contracts; do not edit this block) -->
|
|
8
|
+
## Contract (generated)
|
|
9
|
+
|
|
10
|
+
- **Source:** bridge tool, advanced tier: activate it with `find_revit_tools`.
|
|
11
|
+
- **Writes model:** no. **Effects:** none. **Requires an open document:** yes.
|
|
12
|
+
- **Works in:** project and family documents.
|
|
13
|
+
- **Contract hash:** `27ddae42a59b01cb`. `find_revit_tools` compares it with the selected bridge's live contract.
|
|
14
|
+
|
|
15
|
+
| Input | Type | Required | Default | Allowed values |
|
|
16
|
+
| --- | --- | --- | --- | --- |
|
|
17
|
+
| `query` | object | no | | |
|
|
18
|
+
| `group_by` | string | yes | | `category`, `typeName`, `levelId`, `parameter` |
|
|
19
|
+
| `parameter` | string | no | | |
|
|
20
|
+
| `type_parameter` | boolean | no | | |
|
|
21
|
+
| `offset` | integer | no | | |
|
|
22
|
+
| `limit` | integer | no | | |
|
|
23
|
+
| `expected_document_id` | string | no | | |
|
|
24
|
+
|
|
25
|
+
Bridge calls also accept `_operation_id`, only to retry an identical earlier request (see [operation recovery](../operation-recovery.md)).
|
|
26
|
+
|
|
27
|
+
| Not covered by this tool | Use instead |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| Linked-model contents | Tool: get_linked_elements |
|
|
30
|
+
| Scopes above 10,000 elements | Tool: narrow the query, or get_elements with count_only for a total |
|
|
31
|
+
<!-- generated:contract:end -->
|
|
32
|
+
|
|
33
|
+
## Public inputs
|
|
34
|
+
|
|
35
|
+
- Required `group_by`: exactly `category`, `typeName`, `levelId`, or `parameter`.
|
|
36
|
+
- Optional `query`: whole-scope [get_elements](get_elements.md) filters: `category`, `of_class`, `level`, `type_id`, `in_active_view`, and `filter`. Omission covers all host non-type elements subject to the cap.
|
|
37
|
+
- Query-level `offset`, `limit`, `count_only`, `fields`, `parameter_names`, and `include_type_parameters` are rejected, as are unknown query properties. Place identity/retry arguments at the outer level.
|
|
38
|
+
- `parameter` is required when `group_by` is `parameter`: display name, built-in name, or `guid:<GUID>`. Optional `type_parameter` (default false) chooses the type's parameter rather than the instance's.
|
|
39
|
+
- Optional outer `offset`: default 0. `limit`: 1–500, default 100; these page groups, not input elements.
|
|
40
|
+
- Optional `expected_document_id`: exact read guard. Optional `_operation_id`: exact previous identical-retry ID only.
|
|
41
|
+
|
|
42
|
+
## Example
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{ "query": { "category": "OST_Walls" }, "group_by": "typeName", "limit": 100 }
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Results and verification
|
|
49
|
+
|
|
50
|
+
`total_elements` counts the entire matching scope; `total_groups` is independent of returned group count. Each `groups` row has `value`, `missing`, and `count`. Groups sort by descending count then an internal serialized key. Follow `next_offset` for remaining groups.
|
|
51
|
+
|
|
52
|
+
Parameter groups use exact raw values, including internal numeric units. A missing parameter (`missing: true`) is distinct from a present parameter whose value is null. Ambiguous display-name matches fail instead of choosing one parameter; use a discovered built-in identity or shared GUID. Names are localized. `typeName` groups by name, so different types with the same name can share a group; it is not a unique-type-ID inventory.
|
|
53
|
+
|
|
54
|
+
The query still interprets numeric **filter inputs** in explicit or document display units, while grouped numeric **output values** are raw internal units. Preserve this difference. Check warnings alongside an unexpected zero and confirm the filter scope. Summing counts from all groups should describe `total_elements`; a single group's page does not describe the full distribution.
|
|
55
|
+
|
|
56
|
+
For more than 10,000 matches, narrow the scope meaningfully and report any partitioning. Do not remove the cap by pretending a single page represents all elements. Any saved-response retrieval is separate from group paging; see [execution rules](../execution-rules.md).
|
|
57
|
+
|
|
58
|
+
## Effects and recovery
|
|
59
|
+
|
|
60
|
+
Read-only: no grouping changes in Revit, selection, save, or export. Oversized scope, invalid query fields, missing parameter input, or ambiguous identities fail. Correct the query rather than silently excluding problematic elements. Use [operation recovery](../operation-recovery.md) for document/bridge uncertainty.
|
|
61
|
+
|
|
62
|
+
## Compatibility
|
|
63
|
+
|
|
64
|
+
Source reference: PI-Revit 0.5.0, [SummarizeElements.cs](../../../../src/Revit/Tools/SummarizeElements.cs) and [ElementQueryScope.cs](../../../../src/Revit/Tools/ElementQueryScope.cs), with public identity/retry overlays. Revit 2025–2027 bridge targets; no new live validation is claimed.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# transform_elements
|
|
2
|
+
|
|
3
|
+
## Purpose and boundaries
|
|
4
|
+
|
|
5
|
+
Move, copy, or rotate explicit host elements together in one model-edit step. It does not accept linked targets or perform collision analysis. Constrained or hosted dependents may also move; returned target snapshots are not a complete dependent-change audit.
|
|
6
|
+
|
|
7
|
+
Contract: PI-Revit 0.5.0 source, [TransformElements.cs](../../../../src/Revit/Tools/TransformElements.cs). Activate this advanced tool through `find_revit_tools`. The public schema is authoritative; this page documents source behavior, not a live-model test.
|
|
8
|
+
|
|
9
|
+
<!-- generated:contract:start (npm run generate:contracts; do not edit this block) -->
|
|
10
|
+
## Contract (generated)
|
|
11
|
+
|
|
12
|
+
- **Source:** bridge tool, advanced tier: activate it with `find_revit_tools`.
|
|
13
|
+
- **Writes model:** yes. **Effects:** model. **Requires an open document:** yes.
|
|
14
|
+
- **Works in:** project and family documents.
|
|
15
|
+
- **Verify the outcome:** `reread`: query the changed state again with a read tool.
|
|
16
|
+
- **Contract hash:** `538f5336f11a299e`. `find_revit_tools` compares it with the selected bridge's live contract.
|
|
17
|
+
|
|
18
|
+
| Input | Type | Required | Default | Allowed values |
|
|
19
|
+
| --- | --- | --- | --- | --- |
|
|
20
|
+
| `action` | string | yes | | `move`, `copy`, `rotate` |
|
|
21
|
+
| `element_ids` | array of integer | yes | | |
|
|
22
|
+
| `unit` | string | yes | | `millimeters`, `centimeters`, `meters`, `feet`, `inches` |
|
|
23
|
+
| `translation` | array of number | no | | |
|
|
24
|
+
| `axis_origin` | array of number | no | | |
|
|
25
|
+
| `axis_direction` | array of number | no | | |
|
|
26
|
+
| `angle_degrees` | number | no | | |
|
|
27
|
+
| `preview` | boolean | no | | |
|
|
28
|
+
| `expected_document_id` | string | yes | | |
|
|
29
|
+
|
|
30
|
+
Bridge calls also accept `_operation_id`, only to retry an identical earlier request (see [operation recovery](../operation-recovery.md)).
|
|
31
|
+
|
|
32
|
+
| Not covered by this tool | Use instead |
|
|
33
|
+
| --- | --- |
|
|
34
|
+
| Mirroring | Revit API: ElementTransformUtils.MirrorElements. Check all its members in one call: `search_api_docs` with query `ElementTransformUtils.MirrorElements`, then use `execute_csharp` within the requested scope. |
|
|
35
|
+
| Pinned elements (move and rotate reject them) | User action: Confirm unpinning (Element.Pinned) first |
|
|
36
|
+
| Elements inside linked models | User action: Edit the linked model itself |
|
|
37
|
+
<!-- generated:contract:end -->
|
|
38
|
+
|
|
39
|
+
## Inputs and preconditions
|
|
40
|
+
|
|
41
|
+
Read [execution rules](../execution-rules.md), inspect targets, and confirm the requested scope first.
|
|
42
|
+
|
|
43
|
+
| Input | Meaning |
|
|
44
|
+
| --- | --- |
|
|
45
|
+
| `action` | Required: `move`, `copy`, or `rotate`. |
|
|
46
|
+
| `element_ids` | Required: 1–200 distinct positive host IDs. |
|
|
47
|
+
| `unit` | Required: `millimeters`, `centimeters`, `meters`, `feet`, or `inches`. |
|
|
48
|
+
| `translation` | Required for move/copy: finite `[x,y,z]` displacement in `unit`. |
|
|
49
|
+
| `axis_origin` | Required for rotate: finite `[x,y,z]` position in `unit`, relative to the document internal origin. |
|
|
50
|
+
| `axis_direction` | Required for rotate: nonzero dimensionless direction `[x,y,z]`; normalized internally. |
|
|
51
|
+
| `angle_degrees` | Required for rotate: finite signed angle using the right-hand rule. |
|
|
52
|
+
| `preview` | Default `false`; commit-validates then rolls back all model changes. |
|
|
53
|
+
| `expected_document_id` | Required for every call, including preview. Exact current model identity from the overview. |
|
|
54
|
+
| `_operation_id` | Optional extension argument only for an identical retry. Omit for a new operation. |
|
|
55
|
+
|
|
56
|
+
Coordinates follow the document's internal origin and axes, not sheet coordinates or shared coordinates. All requested elements form one step: the whole selection succeeds or rolls back. Move and rotate reject pinned targets; copy does not pre-reject pinned sources, but Revit still validates it. The tool never automatically unpins elements.
|
|
57
|
+
|
|
58
|
+
## Example
|
|
59
|
+
|
|
60
|
+
Illustrative IDs must be replaced with discovered targets. This previews a 250 mm move along internal X.
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"action": "move",
|
|
65
|
+
"element_ids": [12345, 12346],
|
|
66
|
+
"unit": "millimeters",
|
|
67
|
+
"translation": [250, 0, 0],
|
|
68
|
+
"preview": true,
|
|
69
|
+
"expected_document_id": "<project.documentId>"
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Results, recovery and verification
|
|
74
|
+
|
|
75
|
+
Inspect common fields `committed`, `succeeded`, `proposed`, `failed`, `commitWarnings`, and `commit_validation_performed`. Snapshots contain requested/created element identities, type, and point or curve-endpoint locations in feet; they do not include complete geometry. `created_ids` comes from copy and can include elements Revit creates with the copied selection. A copy also reports `inherited_state`: per copy, what it carried over from its source, such as Mark, Comments, group or design-option membership. Per-view hiding and overrides are keyed by element ID, so copies do not inherit them. Check carried values against the request; a copied Mark usually needs a new value.
|
|
76
|
+
|
|
77
|
+
Copy preview IDs are temporary (`created_ids_are_temporary`) and must never be reused after rollback. Use committed results, then reread targets and inspect affected dependents. A real operation after a preview has changed arguments and needs a new operation ID.
|
|
78
|
+
|
|
79
|
+
Follow [operation recovery](../operation-recovery.md) for uncertain outcomes and [visual verification](../visual-verification.md) for before/after positions and orientation. A successful API step alone does not establish correct placement. This tool does not save the model.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Visual verification and exported evidence
|
|
2
|
+
|
|
3
|
+
Read when the task creates or changes sheets, drawings, views, tags, schedule layout, geometry placement, or another visible result, or requests graphical deliverables. General explanations and bare counts do not need this workflow. API success establishes execution status, not visual correctness.
|
|
4
|
+
|
|
5
|
+
## Capture the actual result
|
|
6
|
+
|
|
7
|
+
- Use [capture_view](tools/capture_view.md) or a requested [image export](tools/export_documents.md) of the actual committed result. `capture_view` returns a temporary PNG path, not image contents.
|
|
8
|
+
- Open that returned file with Pi's image-capable `read` tool and inspect its contents. Do not infer appearance from a filename, image dimensions, successful export, or numeric positions.
|
|
9
|
+
- Frame the real view before capturing. A tiny drawing surrounded by blank space is not sufficient evidence. Use a readable full-sheet image and close-ups when necessary. Place schedules on a sheet when a graphical check of their sheet layout is needed and that placement is within the task scope.
|
|
10
|
+
- Use before/after images when needed to demonstrate movement, rotation, placement changes, or isolation. Preserve useful evidence without repeatedly exporting unrelated views.
|
|
11
|
+
|
|
12
|
+
## Assess the requested outcome
|
|
13
|
+
|
|
14
|
+
Check that the requested objects are visible and correctly positioned, view extents are appropriate, labels and schedule contents are readable, and the composition has no unintended overlap or clipping. Check scale/template/titleblock requirements when part of the request. Model coordinates and successful placement calls alone do not establish a good drawing layout.
|
|
15
|
+
|
|
16
|
+
If a correction is within the user's task, make it using the same identity and transaction rules, then inspect the changed result. If evidence is unavailable or unreadable, state that visual verification is blocked or incomplete and identify what remains unchecked; do not label the visible work fully verified.
|
|
17
|
+
|
|
18
|
+
## Stop when the request is verified
|
|
19
|
+
|
|
20
|
+
Verification checks the request; it is not an open-ended improvement loop. Before capturing, list the request's explicit requirements. Then:
|
|
21
|
+
|
|
22
|
+
- Correct only defects that break one of those requirements, such as a requested object missing or unreadable, an overlap in a requested layout, or a wrong name or target.
|
|
23
|
+
- Once every requirement is verified, stop and report. Offer anything else you noticed (graphic styles, hidden clutter, detail level, framing) as a suggestion; do not do it unrequested.
|
|
24
|
+
- Do not hide, remove or crop away content the request asks to show. For example, a view of "the whole building" keeps its roofs.
|
|
25
|
+
- A result derived from an existing object, such as a duplicated view, copied element or reused type, inherits that object's state. Its result reports `inherited_state`, and a view made by a script appears in `model_changes.new_views` with its hidden categories and elements. Check that state against the request, not just the framing: an image can look complete while roofs or walls are hidden.
|
|
26
|
+
- If the same capture has been repeated after further edits and requirements still seem unmet, stop and report what is met, what is not, and why, rather than continuing to adjust. <!-- inv:completion-proportionate -->
|
|
27
|
+
|
|
28
|
+
The extension also notices repeated identical verification calls after further edits in one run, and asks for this check.
|
|
29
|
+
|
|
30
|
+
## Retain and deliver
|
|
31
|
+
|
|
32
|
+
Retain inspected pictures with the task's evidence and show or link them with concise captions describing what was actually verified. Do not fabricate an image as proof of Revit output. `capture_view` uses temporary files; preserve them in the task's permitted evidence location when long-term retention is needed.
|
|
33
|
+
|
|
34
|
+
Use export's returned `outputDir` and file paths as authoritative. The default model directory derives from saved/cloud identity or a session fallback, not just the title; Save As can change the destination. Do not reconstruct paths from `project.documentId` or trigger an unrelated export merely to discover a directory.
|
|
35
|
+
|
|
36
|
+
For PDF/DWG/PNG/IFC deliverables, inspect the resulting artifact as appropriate. Existence and file size do not establish drawing quality or IFC geometry/schema validity. Failed exports can leave partial files. Record meaningful limits and warnings. Evidence capture or export does not authorize saving the Revit model; honor the user's scope and save instructions.
|