Commands › General › Toggle Grids
Toggle Grids
Coming soon
Before you run this
Active document must be open. At least one grid must exist in the model. Worksets containing grids must be open for modification.
After it runs
All host grids on open worksets have their pin state toggled. Previously pinned grids are now unpinned, and vice versa. Linked grids and grids on closed worksets are unchanged.
When to use this
- User wants to quickly toggle all grid pin states before editing grid positions.
- User needs to unpin grids that were batch-pinned after setup.
- User wants to re-pin grids after repositioning.
Don't use this when
Not for unpinning only (use UnpinAllGridsCommand instead). Not for toggling grids in linked models. Not for autonomous AI execution — requires interactive Revit UI context.
Returns
| Name | Type | Description |
|---|---|---|
ToggledToPinned | int | Number of grids toggled to pinned state |
ToggledToUnpinned | int | Number of grids toggled to unpinned state |
Decision flow
check: document.isValid → proceed check: grids.count > 0 → proceed action: toggleGridsInOpenWorksets → report results
What you'll see in the chat
on start
Toggling pin state on all host grids...
Switching grid pin states in open worksets...
Switching grid pin states in open worksets...
thinking
Finding all host grids in open worksets...
Toggling pin state for each grid...
Toggling pin state for each grid...
on success
Toggled {ToggledToPinned} grids to pinned, {ToggledToUnpinned} to unpinned.
on failure
Grid toggle failed: {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/toggle_grids- Request body schema (from
[RestApiParam]) - Response schema (from
[RestApiResponse]) - curl / JS / Python code examples
Keywords & intent patterns
toggle grids · pin grids · unpin grids · grid pin toggle · switch grid pins
Patterns: toggle * grids · pin * grids · switch * grid * pin
Related
| Related commands | UnpinAllGridsCommand |
|---|---|
| Pillar | General |