Hello, I started looking at KiCad 8 release candidate. I expect that many plugins will break due to major API changes. I’m creating this topic for sharing findings/porting efforts.
Let me start:
-
pcbnew.PAD.GetParent()
no longer returnsFOOTPRINT
(returnsBOARD_ITEM_CONTAINER
) - to callFOOTPRINT
methods ( in my case it waspad.GetParent().GetOrientationDegrees()
) the additional cast is required:pcbnew.Cast_to_FOOTPRINT(parent)
-
NETINFO_LIST
object has no attributeAppendNet
-
I was using
AppendNet
for generating board objects, like this:board = pcbnew.CreateEmptyBoard() ... add_nets(board, netnames) ... def add_nets(board, netnames): net_info = board.GetNetInfo() net_count = board.GetNetCount() for i, n in enumerate(netnames): net = pcbnew.NETINFO_ITEM(board, n, net_count + i) net_info.AppendNet(net) board.Add(net)
Looks like
net_info
can be ignored when using KiCad8?
-
-
Loading footprints does not work for me anymore. The part of my ‘generate board from scratch’ flow was adding footprints:
def add_diode_footprint(board, footprint, request): library = get_footprints_dir(request) f = pcbnew.FootprintLoad(str(library), footprint) f.SetReference("D1") board.Add(f) return f
which now fails with following error:
tests/test_board_modifier.py:37: in add_diode_footprint f = pcbnew.FootprintLoad(str(library), footprint) /usr/lib/kicad-nightly/local/lib/python3.11/dist-packages/pcbnew.py:19001: in FootprintLoad plug = GetPluginForPath(libname) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ libname = '/home/aws/git/kicad-kbplacer/tests/data/footprints/tests.pretty' def GetPluginForPath(libname): > plugin_type = IO_MGR.GuessPluginTypeFromLibPath( libname ); E NameError: name 'IO_MGR' is not defined /usr/lib/kicad-nightly/local/lib/python3.11/dist-packages/pcbnew.py:18993: NameError
This might be either wrong usage or perhaps bug in KiCad, did not figure out that one yet (looks more like the latter).