Replace Schematic Component
replace_schematic_componentReplace a placed component's symbol in a KiCad schematic while preserving its position, rotation, and field values. Optionally set a new rotation and get updated pin positions.
Instructions
Replace a placed component's symbol with a different one (e.g. Device:R -> Device:R_Potentiometer), preserving its position, rotation, and field values (Value/Footprint/custom). Optionally override rotation with newRotation. Returns the new pin positions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| newSymbol | Yes | New symbol in 'Library:Symbol' form (e.g., Device:D_Zener) | |
| reference | Yes | Reference of the component to replace (e.g., D1) | |
| newRotation | No | Override rotation in degrees (default: keep existing) | |
| schematicPath | Yes | Path to the .kicad_sch file |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |