# How to create evenly spaced Resistors

Hello,
I need to layout SMD 50 resistors in a row, evenly spaced. None of the tools seem to do what I want.
I got them all straight using the Align to Top. Cool. How do I make a space of 2 or 3mm between each one?

Here is a pic

I want them to look like this

Ok, looking at the 3D PCB view, it looks like they are pretty evenly spaced already!
Maybe this is OK as is.

It sounds like you have solved your own problem. But if I had many which I wanted to evenly space, I would first set the grid to a large helpful value. Such as 1 mm or 2 mm or 50 or 100 mils for example. Then I would place two to four at the desired spacing. Then duplicate that group of (4 for example) to make 8, and then duplicate that group of 8 to make 16. I donâ€™t know if we have a way to create an â€śarrayâ€ť but the method I described should be quick & easy.

Right below your â€śalignâ€ť function, there is a â€śdistributeâ€ť function, which distributes the parts either horizontally or vertically.

But I prefer the way BobZ does it and align them on a coarse grid.
But you can combine it. If you have 100 resistors, then you have 99 distances, and when you place the leftmost and rightmost reisistors at the right distance then distribute should align them on the same coordinates as the grid. The distribute function does not sort the parts however, so you still have to do that manually, and when you do that, you might as well place them on the grid properly.

Note:
When you manually move a footprint, you can grab it by either a pad or the center, and after a move, the point you grabbed it will be on the grid. So if you mix those methods, you footprints wonâ€™t align.

Drag-select multiple resistors, Right click Align/distribute and here Distrubute (horizontally or vertically)

EDIT: paulvdh was first Just a note: after using Distribute, components may get weird off-grid coordinates. If you use coarse grid, theyâ€™ll stay on even coordinates.

After youâ€™ve put those Footprints in their right place, you still have the task of moving and rotating all the silk screen text.

You can move them all at once, but the path to do that is a bit convoluted.

1. Select one of your resistors in Pcbnew and press [Ctrl + e] to open it in the Footprint Editor.
2. Move & rotate your silkscreen text, maybe other changes.
3. Footprint Editor / File / New Library / â€¦, and make it project specific.
4. Put your modified footprint into it.
5. Eeschema / Tools / Edit Symbol Fields, and change the resistor footprint links to your modified footprint in your new library.
6. Eeschema / Tools / Update PCB from Schematic [F8] and make sure that Options: [v] Update footprints checkbox is turned on.

Perfect reason to learn some python scripting.

1 Like

Iâ€™ve been experimenting a bit more with the align / distribute, and itâ€™s also quite easy to put footprints at specific distances.

First, the align Top/Bottom/Left/Right works a bit differently then I expected. You first select a group of footprints, then right click on one of the footprints, select the function, and the other footprints will get aligned to the Top/Bottom/Left/Right of the last selected footprint.

Aligning a row with a specific distance is also easy. You first select (for example) the left most resistor, press e to edit itâ€™s properties and set itâ€™s X-coordinate to 80. Then select the rightmost resistor and for a row of 8 resistors (7 distances) set itâ€™s X-coordinate to: KiCad evaluates this to 101, and after that you can distribute them horizontally and each distance will be 3mm.

@qui1ck Why would you need python for this?

@paulvdh none of GUI tools will help when the order of your resistors is wrong. Itâ€™s still a lot of manual labor to reorganize them when it would be a small for loop in python (assuming your references follow some logic).

As you found the align and distribute found in the right click context menu is of help. So you can just place your resistors approximately where you want them in the correct order and then use this tool to distribute them with an equal spacing.

If you want to space them with a given distance then just calculate the position of the outermost resistors and then use the distribute tool on a selection that includes the outermost ones (you can use the position relative to tool to achieve this, or by use of the custom grid and setting the origin to the first one).

If you are on 5.1.x and the resistor references are sequential you can try Place footrprints action plugin.

Select all the footprints that you would like to align, right-click and choose the option â€śAlign/Distributeâ€ť and "Distribute Horizontally as shown below. Also, please remember that coordindates for the first and last footprints should be calculated manually.

How then you make each resistor being connected with right one at a schematic?

This method places resistors. It does not connect them.

So how with schematic?
Are you speaking of working without schematic?

My guess would be to manually change the designators to the ones you want, then delete the footprints that came in when updating from the schematic, finally update from the schematic by reference designator to re-link the timecodes/UUIDs.

Hey; you beat me to it!! (I think that is sort of what I did.)

To be fair, I thought I should go through the effort of doing it. Unfortunately I use a 5.99 version. The attached zip includes

1. The Kicad files. And in case you cannot read the 5.99 files it also includes:
2. A .pdf of the schematic including step by step explanation of what I did.
3. A .png screen shot of the highly sophisticated pcb layout. (well not so much.)

Layout_Test_01.zip (72.5 KB)

But to be unfair, I think I will go have a beer. You cannot have one of mine.

Align seemed to work exactly how I wanted it, but distribute did not. All good, the PCB View looks great.