One way to do it without text editing (which is not perfect but less error prone) is to script it by changing the layer of the drawing associated with the fontprint (made on another layer):
import pcbnew
board = pcbnew.GetBoard()
io = pcbnew.PCB_IO()
for module in board.GetModules():
# check somehow that the module is the footprint you are looking for
# did not find a way to access the footprint name
if 'J' in module.GetReference():
print(module.GetReference())
graphics = module.GraphicalItemsList()
graphicsLayers = [x.GetLayerName() for x in graphics]
if len(graphicsLayers) == 8 and len(set(graphicsLayers)) == 1:
for x in graphics:
x.SetLayer(board.GetLayerID('Edge.Cuts'))
One way to do it without text editing (which is not perfect but less error prone) is to script it by changing the layer of the drawing associated with the fontprint (made on another layer):
import pcbnew
board = pcbnew.GetBoard()
io = pcbnew.PCB_IO()
for module in board.GetModules():
# check somehow that the module is the footprint you are looking for GetReference( ): module. GetReference( )) GraphicalItemsL ist() graphicsLayers) ) == 1: board.GetLayerI D('Edge. Cuts'))
# did not find a way to access the footprint name
if 'J' in module.
print(
graphics = module.
graphicsLayers = [x.GetLayerName() for x in graphics]
if len(graphicsLayers) == 8 and len(set(
for x in graphics:
x.SetLayer(
pcbnew.Refresh()