auto_layout_view
Automatically reposition all nodes in an ArchiMate view to eliminate overlap. Supports layered, grid, and semantic layout strategies with internal or pyarchimate engines.
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 resulting `ViewDetail` in `data`
(nodes with updated x/y/width/height and connections). Under
`pyarchimate` the message says which options were not applied.
Errors:
`ViewNotFoundError` (returned as `ModelOperationError`) when
`view_id` is unknown.
`ModelOperationError` for an unknown strategy or engine, 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 |
|---|---|---|---|
| view_id | Yes | ||
| strategy | No | layered_by_type | |
| layer_bands | No | ||
| layout_engine | No | internal |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||