Hallo, I’m trying to write a new plugin . Since I’m a newbie in Python a decided to start from a working plugin and mimic its structure to avoid issues.
To build the main dialog I’m using wxFormBuilder.
Unluckly the code seems not to work and I’m not understanding why. There’s a way to check where the error is instead trying to load it on KiCAD? The code should just add it’s icon on tools menu and open its dialog when triggered (but fails).
the variable: _version_ declared in addnet_plugin.py and recalled in addnet_dialog.py in the following line:
from addnet.addnet_plugin import __version__
Cannot be shared in this way for some reason. I just moved it’s declaration inside addnet_dialog.py to make it work but I would really like to understand how to reference a variable between modules.
Also don’t name variables that are meant to be shared with double underscores in front, such variables have special meaning to be super private, which is not really enforced but at least that’s the convention.
and signed as fixed (from almost 3 years) but apparently in my case the class NETINFO_ITEM is still not usable trough Python:
import pcbnew board = pcbnew.GetBoard() net = NETINFO_ITEM(board, "NEWNET") Traceback (most recent call last): File "<input>", line 1, in <module> NameError: name 'NETINFO_ITEM' is not defined
Someone else tried this? I’m running KiCAD 5.1.4 on Windows 10 Pro
Yes I did … and it seems to work but I still have problem trying to set a pad with the newly created net.
It seems that after setting the new net to the pad it become unstable and if I try to select it after the assigment pcbnew closes (probably an exception or something).
The repository has been updated with the last commit (crashing).