Commands  ›  General  ›  Toggle Grids

Toggle Grids

General writes to model Public API · not yet exposed

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

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

NameTypeDescription
ToggledToPinnedintNumber of grids toggled to pinned state
ToggledToUnpinnedintNumber 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...
thinking
Finding all host grids in open worksets...
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 commandsUnpinAllGridsCommand
PillarGeneral