Python scripting refill all zones


I’m scripting a task I’ve found my self doing a lot recently so am trying to automate it. The last step is I’d like to run “Fill All Zones” (ie press B for me).

I’ve poked about in the API and I can’t see a way to do this, even looping all zones seems a bit awkward. Python isn’t my primary language so I am learning on the job so to speak.

Do I need to call SetNeedRefill()?

Worst case I can press B and get over it, but it would be nice to do it all.

Try ZONE_FILLER.Fill() it takes result of board.Zones() as param

Btw to iterate over zones simply do

for zone in board.Zones():
1 Like

Thanks that worked great!

for anyone following later

filler = pcbnew.ZONE_FILLER(board) # create the filler provide the board as a param
filler.Fill(board.Zones()) # use the filler to re-fill all Zones on the board.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.