← Back to team overview

kicad-developers team mailing list archive

Re: pcbnew.py: How to set plot color?

 

On Friday 03 February 2017 08:25:12 Martin Schreiber wrote:
> Hi,
> How can the plot color been set while using pcbnew.py?
> "
> [...]
>  board = LoadBoard(apcbfilename)
>  pctl = PLOT_CONTROLLER(board)
>  popt = pctl.GetPlotOptions()
>  popt.SetOutputDirectory(aoutputdir)
>  popt.SetPlotFrameRef(False)
>  popt.SetLineWidth(FromMM(0.35))
>
>  popt.SetAutoScale(False)
>  popt.SetScale(1)
>  popt.SetMirror(False)
>  popt.SetUseGerberAttributes(True)
>  popt.SetExcludeEdgeLayer(True);
>  popt.SetUseAuxOrigin(True)
>  popt.SetSubtractMaskFromSilk(False)
>
>  pctl.OpenPlotfile(lnames[0],PLOT_FORMAT_POST,'')
>  pctl.SetColorMode(False)
>  popt.SetColor(YELLOW)
>  pctl.SetLayer(F_SilkS)
>  pctl.PlotLayer()
>  pctl.ClosePlot()
> [...]
> "
> shows black,
> "
>  pctl.SetColorMode(True)
> "
> shows cyan.
> share/kicad/demos/python_scripts_examples/plot_board.py also makes black on
> white PDF's only.
>
> How can the colors been set by a RGB or other component color format?
>
> Version info:
> "
> Application: kicad
> Version: 4.0.5 release build
> wxWidgets: Version 3.0.2 (release,wchar_t,compiler with C++ ABI 1002,GCC
> 4.8.3,STL containers,compatible with 2.8)
> Platform: Linux 3.16.7-53-desktop i686, 32 bit, Little endian, wxGTK
> Boost version: 1.54.0
>          USE_WX_GRAPHICS_CONTEXT=OFF
>          USE_WX_OVERLAY=OFF
>          KICAD_SCRIPTING=ON
>          KICAD_SCRIPTING_MODULES=ON
>          KICAD_SCRIPTING_WXPYTHON=OFF
>          USE_FP_LIB_TABLE=HARD_CODED_ON
>          BUILD_GITHUB_PLUGIN=ON
> "
> compiled from 4.0 branch 575b22d018e83b81c66d169bb4afb2d0005dcb37.
>

Anybody? I want tom make MSEkicadBOM 100% working. BTW, there is a first 
release:
https://forum.kicad.info/t/new-msekicadbom/5797

Martin


Follow ups

References