Skip to content

Commit

Permalink
Explicitly casting parent to FOOTPRINT (KiCAD 8)
Browse files Browse the repository at this point in the history
  • Loading branch information
medo64 committed Apr 21, 2024
1 parent 44ef01f commit c538bc2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion WireIt.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,12 @@ def get_netlist():
"""Create a dict with part ref & pad num as the key and attached net as the value."""
netlist = {}
for pad in GetBoard().GetPads():
pad_key = pad.GetParent().GetReference(), pad.GetPadName()
parent = pad.GetParent()
if type(parent) == BOARD_ITEM_CONTAINER: # KiCAD 8
footprint = Cast_to_FOOTPRINT(pad.GetParent())
else: # KiCAD 7 and earlier
footprint = parent
pad_key = footprint.GetReference(), pad.GetPadName()
netlist[pad_key] = pad.GetNetname(), pad.GetNetCode()
return netlist

Expand Down

0 comments on commit c538bc2

Please sign in to comment.