Wie man Footprint-Pads mit der KiCAD-pcbnew-Plugin-Python-API iteriert

Iterieren Sie die Pads eines gegebenen pcbnew.FOOTPRINT-Objekts mit

iterate_pads_example.py
for pad in list(footprint.Pads()):
    # Example of what to do with [pad]
    print(f"{footprint.GetReference()} {pad.GetNetname()}")

Beispiel, wie man alle Pads für jeden Footprint auf dem Board ausgibt:

iterate_all_footprints_pads.py
for footprint in list(pcbnew.GetBoard().GetFootprints()):
    for pad in list(footprint.Pads()):
        # Example of what to do with [pad]
        print(f"{footprint.GetReference()} {pad.GetNetname()}")

Dies wird beispielsweise ausgeben:

example_output.txt
D1 Net-(D1-K)

Check out similar posts by category: KiCad, Python