pcb_set_mech_layers
Set names, enablement and kinds for multiple mechanical layers of an open PCB board in one call, with each change read back and per-layer failures reported.
Instructions
Name, enable and kind the mechanical layers of the open BOARD.
The board counterpart of lib_set_mech_layers, which takes a
library by path and refuses a PcbDoc. Without this a board could
only have kinds set, one layer per call through
pcb_set_mech_layer_kind, and could not be renamed at all
above Mechanical16.
Every change is READ BACK. A layer whose name, enable or kind did not take is reported against that layer rather than folded into an overall pass.
PAIRED KINDS. Any kind ending in Top or Bottom is held by the layer PAIR rather than by either layer, under a shorter name with the side dropped, so "Courtyard Top" is stored as the pair kind "Courtyard". Give both sides in the same call and the two are joined and the pair given the kind. Single kinds such as "Fab Notes" need no partner.
READ THE BOARD FIRST. pcb_get_mech_layer_names reports
primitive_count per layer, and a kind moved off a layer that
is carrying geometry orphans that geometry from whatever resolves
the layer by purpose.
Args:
layers: One dict per layer. Keys: layer (required, e.g.
"Mechanical13"), and any of name, enabled
(bool), kind (e.g. "Courtyard Top"). A layer with
none of the three is reported as nothing asked for.
tidy_pairs: Remove layer pairs no kind justifies. Off by
default, because it REMOVES pairs.
timeout: Seconds.
Returns:
Dict with document, layers (each: layer, changed,
problem), changed, failed, kinds_displaced,
pairs_removed, pairs_tidied and pairs_scanned_to.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| layers | Yes | ||
| timeout | No | ||
| tidy_pairs | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||