I’ve been trying to integrate replicatelayout.py from @mmccoo as an Action plugin.
With help of @HiGreg I’ve finished the UI part, but now I stumbled upon a new problem. To me it looks like the pcbnew Python API has changed since @mmccoo tested his script.
In order to replicate layout the script:
- does a lot of other things quite succesfully
- gets all nets via
board.GetNetsByNetcode()
- gets all pads connected to each net via Pads method for each net (e.g.
net.Pads()
). And this is where I get an error "_AttributeError: ‘NETINFO__ITEM’ object has no attribute 'Pads’ " - again a lot of other things
As I look on Tutorials on python scripting in pcbnew the Net class used to have Pads() method. But from what I can tell from the current Python API documentation at KiCAD pcbnew scripting the Net class does no longer have this method.
I probably might be able to jerry rig the script to get the modules and nets associated to them via pads class as its members have GetNet()
and GetNetname()
and I can find to which Module they belong to via GetParent()
, but before I delve to deep for my comfort I would like to know:
TL;DR;
- Can anybody confirm that pcbnew python API changed, and Net class does no longer have Pads() method?
- How stable is Python API (if I make something and publish it, how much will the support for the thing take in the long run)?
- Is there any other direct way to find pads (or even better modules) that are connected to one net?