From f0d9ad3fd6d0d7523d63edb118cfb90c3ce72828 Mon Sep 17 00:00:00 2001 From: andrewc Date: Tue, 18 Mar 2025 18:20:00 +1000 Subject: [PATCH] Fixed up foot gen script --- .scripts/foot_gen.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.scripts/foot_gen.py b/.scripts/foot_gen.py index 0eed083..4aaf4e8 100644 --- a/.scripts/foot_gen.py +++ b/.scripts/foot_gen.py @@ -95,7 +95,7 @@ for d in brd_drawings: # Keep only required foots saved = [] -while len(pcb.Footprints()) > 1: +while len(pcb.Footprints()) > 0: foot = pcb.Footprints().pop() if foot.GetReference() in new_foots.keys(): saved.append(foot) @@ -323,7 +323,7 @@ for [foot, pad_map] in sorted_foots: elif shape_type == pcbnew.PAD_SHAPE_CUSTOM: pad_shape = Pad.SHAPE_CUSTOM for d in foot.GraphicalItems(): - if type(d) is pcbnew.FP_TEXT and "User.Drawings" in d.GetLayerName(): + if type(d) is pcbnew.PCB_TEXT and "User.Drawings" in d.GetLayerName(): txt_sp = d.GetText().split(':',1) if pad_number != txt_sp[0]: continue