Back Annotation

Does KiCad support renumbering all of the components in the PCB editor and then back-annotating the changes into the schematic? I usually like to do that to make components easier to find on the PCB, but I haven’t found a way to do that in KiCad yet.

Hmm, I’m having trouble with forward-annotation, too. If I re-annotate all components in the schematic, then I don’t see how to get my reference designator changes into my nearly-finished PCB design without messing up all of my routing and placement. I guess that the smart topology-based forward annotation in those $20k per seat tools is a bit fancier than KiCad can do so far, unless I’m missing something!

Maybe there’s some way to handle re-annotation of a routed design using Python scripting? I wonder whether that trail has been blazed by anybody yet?

You mean something like Edit -> Import Footprint Selection in eeschema?

And about the editing annotations during the pcb design, I do this all the time! Just export a new netlist from the schematic, import it in your pcb and the changes get picked up? I just leave all the options at their defaults (Keep) and my components stay in place perfectly.
Do you by any chance use footprints not provided by your schematic/netlist?

Do I understand correctly that executing that function will import footprint selections made in pcbnew into the schematic diagram? That’s a useful function, but what I’m specifically looking for here is a way to re-annotate the components in the PCB and then back-annotate the reference designator changes into the schematic. Does Edit -> Import Footprint Selection import reference designator changes, too?

In other PCB packages, I’ll usually re-annotate all of the components in the PCB so that they’re numbered left-to-right, top-to-bottom on the PCB, and then I’ll back-annotate those changes into the schematic. Every tool handles it a bit differently, but I’m able to do that one way or another in Eagle 6.x, Mentor PADS, and the Frankenstein combination of OrCAD CIS + PADS PCB that I’ve had to use a lot at work. I haven’t figured out how to do that (or if it’s even supported) in KiCad yet.

When I tried it, I ran cvpcb again, and it looks like that was the mistake that broke everything. I’ve since found this in a KiCad FAQ that describes re-annotating in the schematic and updating the PCB, and I’ll give that a try tonight or tomorrow.

I’m not sure what you’re asking. I had to create several symbols, footprints and 3D models for this design, and I’ve also used symbols, footprints and 3D models provided with KiCad. Incidentally, I’m running KiCad on a Mac, using the “all the trimmings” build that was recently described here on the forum.

Here are a couple of renderings of my work in progress, just in case anybody’s curious. I’m using this simple project as an excuse to learn KiCad, and to see if I’d like to switch from Eagle 6.x to KiCad for my open-source hardware projects. The blue board is a LightBlue Bean, with the breadboard area chopped off. After hearing an interview with one of the LightBlue folks on a recent Amp Hour podcast, I decided it’d be fun to use the Bean in a project.

I really like the 3D view feature of KiCad! I’m finding some annoyances in KiCad, but that’s true of every single CAD tool I’ve ever used, whether it’s free or it costs a hundred grand per butt-year.

Hi, I’ve developed a python script to automate this task. It will rename components on the pcb according to their position then it will update the schematic files as well. You can find it here. I’ve also written a blog post on it.

I’m posting it here because this is the first result on search engines when searched for ‘back annotation in kicad’.

Hi, trying out the script but get error messages.

sys.path.append(“C:/Users/i7/OneDrive/Programmer/Kicad/kicad-python”)
execfile(“C:/Users/i7/OneDrive/Programmer/Kicad/kicad-python/examples/pcbannotate.py”)
Traceback (most recent call last):
File “”, line 1, in
File “C:/Users/i7/OneDrive/Programmer/Kicad/kicad-python/examples/pcbannotate.py”, line 31, in
from kicad.pcbnew.board import Board
File “C:/Users/i7/OneDrive/Programmer/Kicad/kicad-python/kicad/pcbnew/board.py”, line 23, in
from kicad.pcbnew import drawing
File “C:/Users/i7/OneDrive/Programmer/Kicad/kicad-python/kicad/pcbnew/drawing.py”, line 26, in
from kicad.pcbnew import layer as pcbnew_layer
File “C:/Users/i7/OneDrive/Programmer/Kicad/kicad-python/kicad/pcbnew/layer.py”, line 22, in
from enum import IntEnum
ImportError: No module named enum

Got it working with help from hyOzd.
I am on win64 kicad 4.0.0 stable.

Had to download enum34( https://pypi.python.org/pypi/enum34#downloads) and add the path.

This works for me in Scripting Console,
import sys
sys.path.append(“C:/xxxx/xxxx/OneDrive/Programmer/Kicad/kicad-python”)
sys.path.append(“C:/xxxx/xxxx/OneDrive/Programmer/Kicad/kicad-python/enum34-1.1.1”)
execfile(“C:/xxxx/xxxx/OneDrive/Programmer/Kicad/kicad-python/examples/pcbannotate.py”)

I’ve added a copy of enum34 to my fork of kicad-python’s source which will be automatically loaded if system doesn’t provide it. So you don’t have to install it yourself. If it doesn’t work for you please let me know.

Thank you for developing and sharing this! I’ll try it out soon.

2 posts were split to a new topic: Topic posted to was three years old, that’s 21 in Kicad years. :wink:

Andy, do you mean close the window and reoopen it? I cannot seem to update schematic with new reference values.

Hello hyOzd,
The schematic references are not updated after I renumber the pcb references. Do you know why that might be? I totally messed up the routing after updating netlist in pcbnew.

This is a very old post (you might have already noticed this as @hermit split the topic originally)

So the version of kicad discussed here is long outdated. So are any scripts discussed here.

You might need to give a bit of detail what exactly you tried, which version of kicad you used, …

Hey Rene, thanks for appearing out of nowhere to answer this :slight_smile:

I run Kicad 5.0.1 on Windows and the problem I face is annotating the reference values in the schematic according to the reference values in the pcb_new ( I suppose that is called back-annotation).

The reason I want to do that is because once I (almost) finished the layout I realised there was an extra piece of schematic needed to be added, which I did add with the option “file->Append schematic sheet”. Once I did that, both my existing schematic and the one just appended had their references values turn into question marks and therefore there was no longer a 1-to1 mapping of schematic and layout reference values.

What I did to solve this is to manually edit each question mark in the schematic and put the appropriate number according to the reference value in the layout. (30 minutes work)

However, when I tried hyOzd’s script I didn’t achieve this back-annotation. Instead, I simply achieved a renumbering of the reference values in the layout from left to right but the question marks in the schematic remained there.

As per hyOzd’s instruction, I did the following “After you run the script, update the netlist files. When you read netlist from pcbnew, it shouldn’t change any component footprints. Otherwise something went wrong! It may update some (automatically given) net names though. That’s expected.”

But “generating the netlist” required annotating the question marks and then when “updating netlist” in pcbnew everything got messed up.

Is there something about this script I am missing or manually is the way to go ?

Again thanks so much.