diff --git a/.scripts/foot_gen.py b/.scripts/foot_gen.py index 89d8c83..69054a9 100644 --- a/.scripts/foot_gen.py +++ b/.scripts/foot_gen.py @@ -93,6 +93,7 @@ while len(pcb.Footprints()) > 1: foot = pcb.Footprints().pop() if foot.GetReference() in new_foots.keys(): saved.append(foot) +saved.sort(key=lambda foot: list(new_foots.keys()).index(foot.GetReference())) # just in case pcb.DeleteAllFootprints() # Add them back @@ -149,8 +150,8 @@ for foot in saved: pcb.Add(load_foot) -# Sort by Y -sorted_foots.sort(key=lambda foot: foot[0].GetY()) +# # Sort by Y +# sorted_foots.sort(key=lambda foot: foot[0].GetY()) # Export the step file os.system("kicad-cli pcb export step -f --subst-models --user-origin " + str(ToMM(brd_cent.x)) + "x" + str(ToMM(brd_cent.y)) + "mm -o /tmp/dummy.step " + sys.argv[1])