Hi everyone.
EDIT: First Question answered:
Right after I posted this and reread my code I found the solution to plot multiple layers on one page… Simply, call PLOT_CONTROLLER.SetLayer(…) and PLOT_CONTROLLER.PlotLayer() again.
plot_controller.SetLayer(id)
if plot_controller.PlotLayer() == False:
print("plot error")
plot_controller.SetLayer(Layer.Edge_Cuts)
if plot_controller.PlotLayer() == False:
print("plot error")
— End of edit —
I am writing a small script, to export all data for review and manufacturing. My starting point was ./demos/python_scripts_examples/plot_board.py
I want to get a colored output and the Edge.cuts layer should be plotted as well. After searching through the pcbnew.py lib and ./pcbnew/pcb_plot_params.h
I found the function PCB_PLOT_PARAMS.SetPlotOnAllLayersSelection(...)
, and tried to set the edge cuts layer in there:
selected_layers = pcbnew.LSET()
selected_layers.addLayer(Layer.Edge_Cuts)
plot_options.SetPlotOnAllLayersSelection(selected_layers)
But this did not give the expected result. Can anyone point me in the right direction?
Also I would like to get colored output and I could not find the correct function for this. Any ideas?
Thanks for reading so far,
fotte