V0.103 RenumberKiCadPCB

Note: RenumKiCadPCB has been updated several times to enhance usability and fix bugs. Please check documenteddesigns.com for the most recent version.

This RenumKiCadPCB.V0103 is an updated version of RenumberKiCadPCB. Earlier today I posted v0.102 and 0.103 updates net names to correct some (but not all) issues associated with netlist imports and pours.

Since I take a second pass on the file to update nets it takes about 100mSecs longer.

Thanks to Andy_P at https://forum.kicad.info/ who tested the program and correctly identified that it did not handle hierarchical sheets.

The program has been extensively rewritten to support hierarchies and (I believe) “channels” or the same sheet repeated with different reference designators.

I also added the option to -c output a change list and leave the files alone and a -y option so you don’t have to type Y/N to run the program.

Thanks also to PCB_Wiz on https://forum.kicad.info/ who graciously proved a link to this project https://github.com/FPGAwars/icezum/tree/master/src-kicad (which is a beautiful project by the way).

After running V0.101 on PCB_Wiz’s icezum project, it seems to work fine. There is an issue if I then create a schematic netlist from the updated files and import that into PCBNew and run the DRC. One netlist is flagged no connects even though they appear to be connected. The name of the problem net is neither in the original (pre-run) PCB file or the post run file.

I lack the KiCad skills to determine if this is a problem with my code or the way the original files were made (I have had KiCad complain about files it alone had made)

It appears to be easy enough to correct but the project is too complex for me to understand. Note that this only occurs if you recreate the netlist.

If anybody has a similar problem and can reproduce it on a minimal project I can probably fix the code if there is a bug.

Please let me know if there are any issues.


7 thoughts on “V0.103 RenumberKiCadPCB”

    1. Sure.

      When you prepare a KiCad schematic and update the annotation, the annotation makes some sense from the schematic perspective.

      However, when you do a PCB layout, the part numbers assigned by the schematic are out of order. So, R21 might be near R2 for example.

      This makes debugging almost impossible because you can’t find the physical part on the PCB. Usually, professional PCB packages have the ability to automatically rename the PCB parts in order and them make the schematic parts correspond.

      KiCad does not have a function to do this.

      RenumKiCadPCB processes the finished PCB file and renumbers the parts based on rules. Then it goes over to your schematic and updates that according to the PCB part numbering.

      So when you are debugging and you want to find R22, you know roughly where to look on the PCB.

      Most makers do not make complicated boards so they don’t see the importance of this function but it is extremely important with a complex board.

      Even a simple board can take hours to manually renumber and back annotate after you correct all the mistakes.

      Make sense?


      1. Very good. Thanks for these clear explanations. You maybe should include them in your manual.txt file (and/or) your blog post.


  1. Thanks for that man !
    Here to me, I got no problem in generate a new .net and re-load it in PCBnew. Worked fine here.



    1. Thanks for the feedback!

      I turns out the netlist problem is actually a bug in KiCad and is now on their bug list.

      I hope to come out with a menu driven version shortly (like the old DOS days) and once I can figure out how to compile on msys2 a GUI version. Can I ask what OS you use?


  2. Check out v0.200 posted yesterday: it has a better menu interface but not a GUI. I am having some issues install the development environment but I’ll work it out.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: