KiCAD AddNet action-plugin
Allows to add a new net on a already existing PCB.
In the correct approach to electronic design, the normal workflow when you become aware that a new net is needed during PCB routing is:
- getting back on EESchema,
- apply the needed fixes,
- export it to the
net
file - rebuild the connectivity in PCBNew.
In the real world and more specifically under some work dynamics/cicumstances (hurry hurry!) this workflow can be time wasting or disruptive.
The main cases-of-use for this tool are (assuming an intricate schematics as a basis or no schematics at all):
- I have not a schematics and I need to modify pcb design;
- I found a missing connection on my board (often caused by a non correctly designed footprint or symbol);
- I performed a number of pin net reassignment and/or change of footprint and I found a net missing;
In such cases getting back to EESchema to fix can be painful (or even unfeasible) and non error-free resulting in repeating the process more than once. Having a chance to create a brand new net can speed up the board routing. Prior writing this plugin I was usually doing this by text editing .kicad_pcb
file by hand (not an error free practice but quite fast).
Of course, for the sake of the project, I fix all the mess the right way at a certain point, usually at the end of routing.
After installing it (just clone this repo in your preferred plugin location) launch KiCAD and click on Tools->External Plugins->AddNet
or click on toolbar icon: a dilaog like the one below should appear:
Just write down a suitable name (in the net name textbox), select a module and a pad on which the net will apply using combo-boxes below, finally press Ok. The plugin will create the new net and apply it to the selected pad. The result is something like that:
Please note that (prior the plugin assigment) the net currently assigned to the pad selected is reported in the readonly textbox on the left of the pad combo-box.
Draw a better UI (if anyone willing to contribute please read the following section).
If you are willing to make any modification to the GUI (you're welcome) trough wxFormBuilder (addnet.fbp
file) remember to modify this line (around line 21 addnet_gui.py
):
self.SetSizeHints( wx.DefaultSize, wx.DefaultSize )
In this way:
if sys.version_info[0] == 2:
self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
else:
self.SetSizeHints( wx.DefaultSize, wx.DefaultSize )
This modification allows the code to work with Python 2 (that's the standard KiCAD/Python distribution AFAIK) as long as Python 3, please note that you need to import sys
. Special thanks to NilujePerchut for this hint.
This tool share some similarity with WireIt Connect with Airwire
feature: unluckly I've become aware of WireIt existance only after having coded my plugin.
Some useful references that helped me coding this plugin:
- https://sourceforge.net/projects/wxformbuilder/
- https://wxpython.org/
- http://docs.kicad-pcb.org/doxygen-python/namespacepcbnew.html
- https://forum.kicad.info/c/external-plugins
- https://github.com/KiCad/kicad-source-mirror/blob/master/Documentation/development/pcbnew-plugins.md
Tool I got inspired by:
Very good tools makers:
Hope someone find my work useful or at least inspiring to create something else/better.
I would like to thank in particular:
- Qu1ck
- MitjaN
- NilujePerchut
- hildogjr
For having shared their knoledge of Python and KiCAD with me: Thanks!
Live long and prosper!
That's all folks.
By[t]e{s} Weirdgyn