feat: add unit parameter to add_schematic_component for multi-unit symbols

Allows placing a specific unit (A=1, B=2, C=3, …) of a multi-unit KiCad
symbol rather than always defaulting to unit 1. Required for quad
optocouplers, dual op-amps, and other multi-unit parts where each channel
must be placed independently.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Samuel Price
2026-04-19 10:11:15 -04:00
parent 8ace3e4d24
commit 78e3b8860a
3 changed files with 17 additions and 2 deletions

View File

@@ -717,6 +717,7 @@ class KiCADInterface:
footprint = component.get("footprint", "")
x = component.get("x", 0)
y = component.get("y", 0)
unit = component.get("unit", 1)
# Derive project path from schematic path for project-local library resolution
schematic_file = Path(schematic_path)
@@ -732,6 +733,7 @@ class KiCADInterface:
footprint=footprint,
x=x,
y=y,
unit=unit,
project_path=derived_project_path,
)