Index: write.c =================================================================== --- write.c (revision 7735) +++ write.c (revision 7736) @@ -327,12 +327,12 @@ /* we now proceed to write the internal copper text to the kicad file, layer by layer */ if (innerCount > 0) { - currentGroup = pcb_layer_lookup_group(innerLayers[0]); + currentGroup = pcb_layer_get_group(PCB, innerLayers[0]); } for (i = 0, currentKicadLayer = 1; i < innerCount; i++) /* write inner copper text, group by group */ { - if (currentGroup != pcb_layer_lookup_group(innerLayers[i])) { - currentGroup = pcb_layer_lookup_group(innerLayers[i]); + if (currentGroup != pcb_layer_get_group(PCB, innerLayers[i])) { + currentGroup = pcb_layer_get_group(PCB, innerLayers[i]); currentKicadLayer++; if (currentKicadLayer > 14) { currentKicadLayer = 14; /* kicad 16 layers in total, 0...15 */ @@ -379,12 +379,12 @@ /* we now proceed to write the internal copper tracks to the kicad file, layer by layer */ if (innerCount > 0) { - currentGroup = pcb_layer_lookup_group(innerLayers[0]); + currentGroup = pcb_layer_get_group(PCB, innerLayers[0]); } for (i = 0, currentKicadLayer = 1; i < innerCount; i++) /* write inner copper tracks, group by group */ { - if (currentGroup != pcb_layer_lookup_group(innerLayers[i])) { - currentGroup = pcb_layer_lookup_group(innerLayers[i]); + if (currentGroup != pcb_layer_get_group(PCB, innerLayers[i])) { + currentGroup = pcb_layer_get_group(PCB, innerLayers[i]); currentKicadLayer++; if (currentKicadLayer > 14) { currentKicadLayer = 14; /* kicad 16 layers in total, 0...15 */ @@ -429,12 +429,12 @@ /* we now proceed to write the internal copper polygons to the kicad file, layer by layer */ if (innerCount > 0) { - currentGroup = pcb_layer_lookup_group(innerLayers[0]); + currentGroup = pcb_layer_get_group(PCB, innerLayers[0]); } for (i = 0, currentKicadLayer = 1; i < innerCount; i++) /* write inner copper polygons, group by group */ { - if (currentGroup != pcb_layer_lookup_group(innerLayers[i])) { - currentGroup = pcb_layer_lookup_group(innerLayers[i]); + if (currentGroup != pcb_layer_get_group(PCB, innerLayers[i])) { + currentGroup = pcb_layer_get_group(PCB, innerLayers[i]); currentKicadLayer++; if (currentKicadLayer > 14) { currentKicadLayer = 14; /* kicad 16 layers in total, 0...15 */