8
\$\begingroup\$

Is there a way to produce Gerber files from command line in KiCAD (Linux/Unix) or a tool which can do it for me? The same question for SPICE netlist and BOM xml? I need it to automate this process within a CI-pipelie. GUI is not useable here.

\$\endgroup\$
5
\$\begingroup\$

It is possible to export Gerbers from Pcbnew with the Python Interface, as described here (with some adaption).

import pcbnew

# Load board and initialize plot controller
board = pcbnew.LoadBoard("<filename>.kicad_pcb")
pc = pcbnew.PLOT_CONTROLLER(board)
po = pc.GetPlotOptions()
po.SetPlotFrameRef(False)

# Set current layer
pc.SetLayer(pcbnew.F_Cu)

# Plot single layer to file
pc.OpenPlotfile("front_copper", pcbnew.PLOT_FORMAT_GERBER, "front_copper")
print("Plotting to " + pc.GetPlotFileName())
pc.PlotLayer()
pc.ClosePlot()

This can obviously be expanded to include all of the required layers for your output.

It's worth looking at the scripting reference to see if there's anything to help you further there.

Because netlists are handled by eeschema, it's unlikely you're going to be able to script that. Pcbnew can export BOMs, but it doesn't look like there is any way to export from the python interface.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.