diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2017-08-04 14:39:59 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2017-08-04 14:39:59 +0200 |
commit | 331becba428d0ad33a13d97aa9b1406deb701eb8 (patch) | |
tree | 0f88b8e4387e2306d8c110f11eac4e8bcf8e83bd /py | |
parent | 9d656614d8fef518f6f400bb5560f9e4a0ad3b8a (diff) | |
download | kicad-utils-331becba428d0ad33a13d97aa9b1406deb701eb8.tar.gz kicad-utils-331becba428d0ad33a13d97aa9b1406deb701eb8.tar.bz2 kicad-utils-331becba428d0ad33a13d97aa9b1406deb701eb8.tar.xz kicad-utils-331becba428d0ad33a13d97aa9b1406deb701eb8.zip |
o Reading the list of copper layers from the board file instead of hard coding them.
Diffstat (limited to 'py')
-rwxr-xr-x | py/kicad_pcb_plot.py | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/py/kicad_pcb_plot.py b/py/kicad_pcb_plot.py index d6f123d..cb0bc94 100755 --- a/py/kicad_pcb_plot.py +++ b/py/kicad_pcb_plot.py @@ -80,29 +80,7 @@ popt.SetUseAuxOrigin(True) # This by gerbers only (also the name is truly horrid!) popt.SetSubtractMaskFromSilk(False) -pctl.SetLayer(F_SilkS) -pctl.OpenPlotfile("Silk", PLOT_FORMAT_PDF, "Assembly guide") -pctl.PlotLayer() - -######################### -#### CuBottom.gbr #### -#### CuTop.gbr #### -#### EdgeCuts.gbr #### -#### MaskBottom.gbr #### -#### MaskTop.gbr #### -#### PasteBottom.gbr #### -#### PasteTop.gbr #### -#### SilkBottom.gbr #### -#### SilkTop.gbr #### -######################### - -# Once the defaults are set it become pretty easy... -# I have a Turing-complete programming language here: I'll use it... -# param 0 is a string added to the file base name to identify the drawing -# param 1 is the layer ID plot_plan = [ - ("F.Cu", F_Cu, "Front layer"), - ("B.Cu", B_Cu, "Bottom layer"), ("F.Paste", F_Paste, "Paste front"), ("B.Paste", B_Paste, "Paste bottom"), ("F.Silk", F_SilkS, "Silk front"), @@ -113,6 +91,12 @@ plot_plan = [ ("Cmts.User", Cmts_User, "User comments"), ] +layers = board.GetEnabledLayers() +for layerNum in layers.CuStack(): + layerName = board.GetLayerName(layerNum) + description = "Copper Layer " + layerName + plot_plan.append((layerName, layerNum, description)) + for layer_info in plot_plan: pctl.SetLayer(layer_info[1]) pctl.OpenPlotfile(layer_info[0], PLOT_FORMAT_PDF, layer_info[2]) |