[Python] new PLOT_CONTROLLER.SetPlotOnAllLayersSelection member doesn't work as the dialog option (does nothing)
I'm trying to emulate the KiCad 6/5 PLOT_CONTROLLER.SetExcludeEdgeLayer(False)
by adding Edge.Cuts to the list of layers to plot on all the selected layers. This works using the GUI, but using Python:
import pcbnew
board = pcbnew.LoadBoard('simple_2layer.kicad_pcb')
pc = pcbnew.PLOT_CONTROLLER(board)
po = pc.GetPlotOptions()
include = pcbnew.LSET()
include.addLayer(board.GetLayerID('Edge.Cuts'))
po.SetPlotOnAllLayersSelection(include)
pc.SetLayer(board.GetLayerID('F.Cu'))
assert pc.OpenPlotfile('t', pcbnew.PLOT_FORMAT_PDF, 'test')
pc.PlotLayer()
pc.ClosePlot()
Doesn't work, the result for simple_2layer.kicad_pcb is just simple_2layer-t.pdf, no edge. I also tried:
import pcbnew
board = pcbnew.LoadBoard('simple_2layer.kicad_pcb')
pc = pcbnew.PLOT_CONTROLLER(board)
pc.SetLayer(board.GetLayerID('F.Cu'))
po = pc.GetPlotOptions()
include = pcbnew.LSET()
include.addLayer(board.GetLayerID('Edge.Cuts'))
po.SetPlotOnAllLayersSelection(include)
layers = pcbnew.LSET()
layers.addLayer(board.GetLayerID('F.Cu'))
# layers.addLayer(board.GetLayerID('Edge.Cuts'))
po.SetLayerSelection(layers)
assert pc.OpenPlotfile('t', pcbnew.PLOT_FORMAT_PDF, 'test')
pc.PlotLayer()
pc.ClosePlot()
Got the same result. Am I interpreting it wrong? Shouldn't this do the same as the GUI (include the Edge.Cuts when plotting other layers)?
KiCad Version
Application: KiCad PCB Editor
Version: 7.0.0-rc2-unknown-rc2+208+g52b07b8bac, release build
Libraries:
wxWidgets 3.0.5
FreeType 2.10.4
HarfBuzz 2.7.4
FontConfig 2.13.1
Platform: Debian GNU/Linux 11 (bullseye), 64 bit, Little endian, wxGTK, gnome-xorg, x11
wxWidgets: 3.0.5 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
Boost: 1.74.0
OCC: 7.5.1
Curl: 7.74.0
ngspice: 34
Compiler: GCC 10.2.1 with C++ ABI 1014
Build settings:
KICAD_SPICE=ON