Plot scripting/API - color choice for layers?

OK, for anyone who wants grey-scale prints of boards for assembling them by hand, here are my current pcbnew color settings for the layers to get some decent print out on a black and white laser printer:

ColorPCBLayer_F.Cu=L.Yellow
ColorPCBLayer_In1.Cu=Gray 3
ColorPCBLayer_In2.Cu=Gray 3
ColorPCBLayer_In3.Cu=Gray 3
ColorPCBLayer_In4.Cu=Gray 3
ColorPCBLayer_In5.Cu=Gray 3
ColorPCBLayer_In6.Cu=Gray 3
ColorPCBLayer_In7.Cu=Gray 3
ColorPCBLayer_In8.Cu=Gray 3
ColorPCBLayer_In9.Cu=Gray 3
ColorPCBLayer_In10.Cu=Gray 3
ColorPCBLayer_In11.Cu=Gray 3
ColorPCBLayer_In12.Cu=Gray 3
ColorPCBLayer_In13.Cu=Gray 3
ColorPCBLayer_In14.Cu=Gray 3
ColorPCBLayer_In15.Cu=Gray 3
ColorPCBLayer_In16.Cu=Gray 3
ColorPCBLayer_In17.Cu=Gray 3
ColorPCBLayer_In18.Cu=Gray 3
ColorPCBLayer_In19.Cu=Gray 3
ColorPCBLayer_In20.Cu=Gray 3
ColorPCBLayer_In21.Cu=Gray 3
ColorPCBLayer_In22.Cu=Gray 3
ColorPCBLayer_In23.Cu=Gray 3
ColorPCBLayer_In24.Cu=Gray 3
ColorPCBLayer_In25.Cu=Gray 3
ColorPCBLayer_In26.Cu=Gray 3
ColorPCBLayer_In27.Cu=Gray 3
ColorPCBLayer_In28.Cu=Gray 3
ColorPCBLayer_In29.Cu=Gray 3
ColorPCBLayer_In30.Cu=Gray 3
ColorPCBLayer_B.Cu=Gray 3
ColorPCBLayer_B.Adhes=Black
ColorPCBLayer_F.Adhes=Black
ColorPCBLayer_B.Paste=Gray 1
ColorPCBLayer_F.Paste=Gray 1
ColorPCBLayer_B.SilkS=Black
ColorPCBLayer_F.SilkS=Black
ColorPCBLayer_B.Mask=Gray 2
ColorPCBLayer_F.Mask=Gray 2
ColorPCBLayer_Dwgs.User=Black
ColorPCBLayer_Cmts.User=Black
ColorPCBLayer_Eco1.User=Gray 1
ColorPCBLayer_Eco2.User=Gray 1
ColorPCBLayer_Edge.Cuts=Black
ColorPCBLayer_Margin=Gray 2
ColorPCBLayer_B.CrtYd=Gray 1
ColorPCBLayer_F.CrtYd=Gray 1
ColorPCBLayer_B.Fab=Gray 1
ColorPCBLayer_F.Fab=Gray 1
ColorTxtFrontEx=Black
ColorTxtBackEx=Black
ColorTxtInvisEx=Gray 2
ColorAnchorEx=Black
ColorPadBackEx=Yellow 4
ColorPadFrontEx=Yellow 4
ColorViaThruEx=Gray 3
ColorViaBBlindEx=Gray 2
ColorViaMicroEx=Gray 2
ColorNonPlatedEx=Gray 3
ColorRatsEx=White

These settings reside in an ini file called pcbnew (in the same folder are other settings files for eeschema or kicad etc..). Under Windows 7 it’s located here:

C:\Users\JohnDoe\AppData\Roaming\kicad\pcbnew

Create another file with extension .PRINT (copy pcbnew) and replace above lines in there.

Procedure if you want to print something with those color settings:

  • quit KiCAD completely
  • swap pcbnew ini with pcbnew.PRINT ini by doing this:
    – 1st rename ‘normal’ pcbnew into pcbnew.LAYOUT
    – 2nd rename pcbnew.PRINT into pcbnew
  • start KiCAD/pcbnew
  • open print dialog and set it to Print Mode [Color]
  • print
  • quit pcbnew/KiCAD and revert the pcbnew ini file swap from above

I’ll see if I can whip up some script that would do this, but it will take some time. Maybe someone else can create a script that swaps layer colors for printing and reverses those settings to the layout colors once printing is done?

Result (Top):

PS: I know that the XH connector symbols are the wrong way around and some bottom devices outlines show up, still working on it (have 1/3rd of my local lib adapted so far phew). :wink:

PPS: I have REF** on Eco1 and VAL** as well as the device outlines on F.Fab. There is information on silkscreen, but I don’t print that. Problem with REF being on a non-Top/Bottom layer.. both top and bottom devices REF fields are visible on the print. If you stick with KiCAD library ‘rules’ you shouldn’t have this problem though, just print the silkscreen layers to get the REF fields for the correct side.