Index: gcode.c =================================================================== --- gcode.c (revision 19142) +++ gcode.c (revision 19143) @@ -273,6 +273,7 @@ if (!pcb_layer_is_empty_(PCB, layer)) { /* layer isn't empty */ + int purpi = pcb_layer_purpose(PCB, n, NULL); /* * is this check necessary? It seems that special @@ -279,7 +280,7 @@ * layers have negative indexes? */ - if ((flags & PCB_LYT_COPPER) || (flags & PCB_LYT_OUTLINE)) { + if ((flags & PCB_LYT_COPPER) || PCB_LAYER_IS_ROUTE(flags, purpi)) { m = pcb_layer_get_group(PCB, n); /* the export layer */