Bulk Rename Footprint References on PCB?

I have many footprints with the same Reference field.

Is it possible to simply bulk add a numbered suffix to the Reference field of all these footprints?

As an example, with 5 footprints that all have the Reference field set to “T”, and I want to add a numbered suffix to each:
T, T, T, T, T → T_1, T_2, T_3, T_4, T_5

Is something like this possible to achieve within KiCad’s default Layout Editor?

Thanks for reading my post, any guidance is appreciated.

Let me guess, you are creating layout without schematic. Usually symbols are annotated in the schematic and it drives the pcb.

In the pcb side you can try tools → geographical reannotation.

Thanks for your reply;

This appears to only be able to rename all the front or back footprints at once, not ones I select. I have other footprints among the ones I want to rename that I don’t want changed.

It also appears to be restricted in the order it renames the footprints, I want to be in control of the remaming order.

Is it possible to bulk rename only the footprints I select with this tool, in the order I want? Or is it restricted to only being able to rename all footprints at once in it’s own order?

To forgo the schematic is a path that will lead you only to chaos and misery. Return from whence you came and embrace the schematic, only then will you find your true PCB and the harmony you seek.
:mouse:

3 Likes

I’ll take that as a no lmao

1 Like

Geographic reannotation is more limited, schematic annotation gives more freedom.

1 Like
import pcbnew
board = pcbnew.GetBoard()
footprints = board.GetFootprints()
counter = 1  # 从1开始计数
for footprint in footprints:
    if footprint.IsSelected():  # 只处理选中的封装
        reference = footprint.Reference()
        footprint.SetReference("T_" + str(counter))
        counter += 1  # 递增计数器
pcbnew.Refresh()  # 刷新画面


1 Like