Fixed up foot gen script

This commit is contained in:
andrewc
2025-03-18 18:20:00 +10:00
parent 171942349f
commit f0d9ad3fd6

View File

@@ -95,7 +95,7 @@ for d in brd_drawings:
# Keep only required foots # Keep only required foots
saved = [] saved = []
while len(pcb.Footprints()) > 1: while len(pcb.Footprints()) > 0:
foot = pcb.Footprints().pop() foot = pcb.Footprints().pop()
if foot.GetReference() in new_foots.keys(): if foot.GetReference() in new_foots.keys():
saved.append(foot) saved.append(foot)
@@ -323,7 +323,7 @@ for [foot, pad_map] in sorted_foots:
elif shape_type == pcbnew.PAD_SHAPE_CUSTOM: elif shape_type == pcbnew.PAD_SHAPE_CUSTOM:
pad_shape = Pad.SHAPE_CUSTOM pad_shape = Pad.SHAPE_CUSTOM
for d in foot.GraphicalItems(): 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) txt_sp = d.GetText().split(':',1)
if pad_number != txt_sp[0]: if pad_number != txt_sp[0]:
continue continue