Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
KiCad Layout Replicator
A KiCad PCB editor plugin that replicates component placement across hierarchical sheet instances.
Concept
When a schematic uses multiple instances of the same hierarchical sheet (e.g. four identical amplifier channels), you can place and arrange one instance manually, then use this plugin to copy that exact layout to the other instances — preserving relative positions and rotations.
Workflow
1. Replicate component placement
- Open Layout Replicator from Tools → External Plugins
- Pick a source sheet (the fully placed reference layout) and a target sheet
- Pick a reference component from the source sheet — this acts as the anchor point
- The corresponding component in the target sheet defines where the copy should land and at what orientation
- Hit Apply — all other components in the target sheet are placed using a rigid body transform: rotated around the source reference position, then translated to the target reference position
The reference component in the target sheet must already be placed — it defines the destination and orientation of the replicated layout.
Note: this only moves components. Traces and vias are not copied.
2. Replicate traces and vias
To bring the routing across as well:
- In the source layout, select all the traces and vias you want to replicate
- Copy and paste the selection
- In the properties of the pasted selection, clear the net assignment (set to no net)
- Move the selection into position over the target components — traces will reconnect automatically, vias will remain unconnected
- Select just the vias
- Run Assign Via Nets from Nearest Copper — this assigns each via to the net of the closest copper item, reconnecting them
Installation
Symlink the plugin directory into your KiCad scripting plugins folder:
./local-deploy.sh
Or manually:
ln -sf "$(realpath plugins/layout_replicator)" ~/.local/share/kicad/9.0/scripting/plugins/layout_replicator
Then in the PCB editor: Tools → External Plugins → Refresh Plugins
The plugin appears as Layout Replicator under Tools → External Plugins.
Component matching
Components are matched across sheet instances using the symbol UUID from the hierarchical path — the last segment of GetPath(). This is identical for equivalent components across all instances of the same sheet, regardless of their assigned reference designators.