I want to delete all zones of a board via the Python API. My attempts so far:
import pcbmerge
board = pcbnew.LoadBoard('myboard.kicad_pcb')
for i in range(board.GetAreaCount()):
board.Delete(board.GetArea(i)) # doesn't work
board.Remove(board.GetArea(i)) # doesn't work
board.RemoveNative(board.GetArea(i)) # doesn't work
board.Remove(board.GetArea(i)) should work.
Did you save the board after that?
Edit: actually that will work for 1 zone, but you can’t remove items from the list and expect indexes to remain the same. Either get all zone objects and remove them after or repeatedly remove area #0 until there are no more.