auto_layout_view
Automatically repositions nodes in a view to eliminate overlap, using strategies like layered by type or grid layout for clear organization.
Instructions
Automatically reposition all nodes in a view to avoid overlap.
The default `internal` layout nests Aggregation/Composition members
inside visible Grouping nodes, wraps wide lanes into multiple rows,
aligns connected nodes vertically across lanes, and routes
connections orthogonally around nodes. With `layer_bands` (default
true) and the `layered_by_type` strategy, views spanning two or
more ArchiMate layers get labeled visual bands (diagram-only Archi
Groups — the semantic model is never modified; set
`layer_bands=false` to disable).
The engine choice applies to this call only. It is never stored on
the model or the view, so it cannot appear in an export or in
Archi's Properties tab.
Note: parameter is `strategy` (matches `auto_layout_view`) but the
equivalent parameter on `export_model_content` and
`export_model_to_file` is named `layout_strategy`.
Args:
view_id: ID of the view to lay out.
strategy: One of:
- `layered_by_type` (default): ArchiMate semantic lanes
(Motivation/Strategy on top, then Business, Application,
Application Data, Technology/Physical/Implementation).
- `layered`: relationship-direction layered, source nodes
before target nodes.
- `grid`: compact non-overlapping grid, no semantic
ordering.
Ignored (but still validated) by the `pyarchimate` engine,
which has a single fixed algorithm.
layout_engine: One of:
- `internal` (default): everything described above.
- `pyarchimate`: pyArchimate's own coarse-grid placement.
Much faster on large views, but it applies no `strategy`,
no layer bands, no lane wrapping, no barycenter
alignment, and no ArchiMate lane ordering (its own layer
classification misplaces SystemSoftware, Artifact, Path,
Equipment, Facility, Material, Contract, Representation
and ImplementationEvent). Best for flat views of
default-sized nodes. It has no collision detection, so a
view whose nodes do not fit its grid cell is refused
rather than silently overlapped — see Errors.
Returns:
Success envelope with the laid-out view in `data`. Under
`pyarchimate` the message says which options were not applied.
`detail="summary"` (default) returns the view's identity,
`properties`, `metadata`, `node_count`, `connection_count`, and
a `bounds` box (`{x, y, width, height}`, or null for an empty
view) giving the canvas the layout consumed — enough to place a
note in free space afterwards.
`detail="full"` adds `nodes` (each with x/y/width/height) and
`connections`. Ask for it when you need per-node geometry; it
is several thousand tokens on a mid-sized view.
Both shapes report the band outcome directly:
`layer_bands_created` (int) and `layer_bands_reason`, which is
null when bands were created and otherwise one of
`single_layer_view`, `coverage_view`, `not_requested`,
`strategy_does_not_use_bands`, or
`engine_does_not_support_bands`. Zero bands on a single-layer
view is correct, not a failure.
Errors:
`ViewNotFoundError` (returned as `ModelOperationError`) when
`view_id` is unknown.
`ModelOperationError` for an unknown strategy, engine, or
`detail` level, with close matches in
`error.details.suggestions`.
`ModelOperationError` when `layout_engine="pyarchimate"` cannot
lay the view out safely, with `error.details.grid_size` and
`error.details.oversized_nodes`. No placement is written, so
the view is never left half laid out, but the shared
prologue (Grouping nesting, group sizing) may already have
repaired it. Retry with `layout_engine="internal"`.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| detail | No | summary | |
| view_id | Yes | ||
| strategy | No | layered_by_type | |
| layer_bands | No | ||
| layout_engine | No | internal |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||