Hello KiCad developers,
I am working on a headless PCB generation workflow and would like to ask whether KiCad would accept a command-line equivalent of “Update PCB from Schematic”.
At the moment, kicad-cli can export schematic netlists and run PCB checks, but forward annotation still requires opening the PCB Editor, pressing F8, placing the new footprints, and saving the board.
Current PCB Editor path
F8
↓
ACTIONS::updatePcbFromSchematic
↓
TOOL_ACTION event mapping
↓
BOARD_EDITOR_CONTROL::UpdatePCBFromSchematic
├─ PCB_EDIT_FRAME::FetchNetlistFromSchematic(...)
│
└─ if (fetched)
├─ DIALOG_UPDATE_PCB updateDialog(...)
└─ updateDialog.ShowModal()
│
├─ TransferDataToWindow()
│ └─ PerformUpdate(true)
│ └─ BOARD_NETLIST_UPDATER::UpdateNetlist(...)
│ [dry run: calculate and display proposed changes]
│
└─ OnUpdateClick()
└─ PerformUpdate(false)
└─ BOARD_NETLIST_UPDATER::UpdateNetlist(...)
[apply changes to the in-memory board]Proposed CLI command
kicad-cli pcb update-from-schematic [options] <project-or-schematic>I would like to reuse BOARD_NETLIST_UPDATER and KiCad’s existing netlist and footprint-library code.
From reading the source, BOARD_NETLIST_UPDATER currently depends on PCB_EDIT_FRAME for footprint loading, settings, footprint replacement, and BOARD_COMMIT. Supporting a headless caller may require separating these services from the GUI while preserving the existing F8 behavior.
The CLI path would load the project and board, obtain the schematic netlist, run the native updater, place new footprints at a deterministic staging position, and save the result to an output board. If this fits KiCad’s development direction, I am willing to implement it against current master with tests and documentation.
Questions
kicad-cli?BOARD_NETLIST_UPDATER from PCB_EDIT_FRAME the right approach, or is there another API or job framework I should use?Best regards,
SHA HIROYASU
Hi SHA,
As the PCB depends on the schematics and footprint libs and the schematics depends on symbol libs.
You may also need "Update symbols from library" and "Update footprints from library"
Thanks
Greg
--
You received this message because you are subscribed to the Google Groups "KiCad Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to devlist+u...@kicad.org.
To view this discussion visit https://groups.google.com/a/kicad.org/d/msgid/devlist/CAJ3Qg24C1g2SyJ3THgTUgdDkCwG8s5ni9s82SO24BEX2DpA-Tg%40mail.gmail.com.