reorder_sheet_pages
Put hierarchical sheets in the page order given: sheets listed come first, in that order, then the others in the order they have now.
Instructions
Put hierarchical sheets in the page order given: sheets listed come first, in that order, then the others in the order they have now.
KiCad orders sheets by their page numbers, not by where their blocks sit in the file, so
this rewrites the page numbers and leaves the blocks where they are. Call it on the root
schematic: a sheet's page is stored at its parent's path, and a sub-sheet's blocks are
refused. The numbers already in use are given back in the new order, so custom labels
such as "Intro" stay; when they repeat, or a deeper sheet uses one, the sheets are numbered
from the lowest positive whole number no other sheet holds. A sheet whose instance entry
was written at its own path, as earlier versions of the tools did, has it moved to the path
KiCad reads. A root older than format 20221110, which keeps every page in its own
sheet_instances table, is refused.
Args:
page_order: List of sheet UUIDs in desired order
schematic_path: Path to root .kicad_sch file. Optional; omit to use the configured default.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page_order | Yes | ||
| schematic_path | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |