diff --git a/kibot/gs.py b/kibot/gs.py index dc1b822e..7b1564cc 100644 --- a/kibot/gs.py +++ b/kibot/gs.py @@ -273,6 +273,12 @@ class GS(object): def zones(): return pcbnew.ZONES() if GS.ki6() else pcbnew.ZONE_CONTAINERS() + @staticmethod + def layers_contains(layers, id): + if GS.ki6(): + return layers.Contains(id) + return id in layers.Seq() + @staticmethod def expand_text_variables(text, extra_vars=None): vars = GS.load_pro_variables() diff --git a/kibot/out_pcb_print.py b/kibot/out_pcb_print.py index 6ad9d60d..bd359169 100644 --- a/kibot/out_pcb_print.py +++ b/kibot/out_pcb_print.py @@ -532,7 +532,7 @@ class PCB_PrintOptions(VariantOptions): if dr.x: continue layers = pad.GetLayerSet() - if layers.Contains(id): + if GS.layers_contains(layers, id): layers.removeLayer(id) pad.SetLayerSet(layers) removed.append(pad) @@ -592,7 +592,7 @@ class PCB_PrintOptions(VariantOptions): moved.append(gi) for pad in m.Pads(): layers = pad.GetLayerSet() - if layers.Contains(id): + if GS.layers_contains(layers, id): layers.removeLayer(id) pad.SetLayerSet(layers) removed.append(pad)