11
\$\begingroup\$

Is it possible to automatically position parts in Kicad, relative to each other?

I'm making a board that plugs into an Arduino Nano, and I'm finding it difficult to position the straight headers at the exact 17.76 mm span to match the space between Nano's pin rows. If necessary, I can do this manually, but is there any built-in tool where I can select two parts and tell it to space them by a specific amount along a specific axis?

Is it also possible to center a part relative to the "Edge.Cuts" layer? I'd like to center these headers, and again, using the mouse while looking at the coordinates is very tedious and error prone.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Change to imperial (inch) coordinates, and you should have no problem spacing the headers 0.7 inches apart. \$\endgroup\$ Commented Aug 12, 2017 at 22:56
  • 1
    \$\begingroup\$ Or use a custom grid. Also pick a point and press the spacebar - this sets the "local origin" and moving the mouse from that spot shows a delta x/y in the bottom right relative from that point. \$\endgroup\$
    – rdtsc
    Commented Aug 12, 2017 at 23:11
  • 1
    \$\begingroup\$ @rdtsc, Yeah, I was using the spacebar to zero-out the local origin, but it's still very difficult to use the mouse to get the position exactly right. You can set a part's absolute position via the right-click menu, but that's only in absolute coordinates. Even changing the global origin in Grid Properties doesn't change that. \$\endgroup\$
    – Cerin
    Commented Aug 13, 2017 at 12:46

3 Answers 3

12
\$\begingroup\$

The easiest way is to use the "Position Relative To" command. On a Mac, it is ⌘-R, under Linux, it is Ctrl-R. Or, you can access it using the right-click on a part or group.

Position Relative

Once you have selected this, you can choose an object for the reference

Position Relative Dialog

You will need to be running version 5 or higher for this function.

\$\endgroup\$
5
  • \$\begingroup\$ Is the "position relative" feature only in the nightly release? I'm using 4.0.7 and I don't see that option in the right-click menu. \$\endgroup\$
    – Cerin
    Commented Aug 13, 2017 at 12:43
  • 1
    \$\begingroup\$ Yes, it's only in the nighties for now (see end of my answer. :). But the nighties are pretty stable and really the way to go, feature-wise for now \$\endgroup\$
    – Seth
    Commented Aug 13, 2017 at 21:40
  • 1
    \$\begingroup\$ I'm using Version: 5.0.0-rc2-dev-unknown-73b9a5~65~ubuntu14.04.1, release build and this option appears to be broken. I can click "Position Relative To..." in the right-click menu, but nothing happens. No pop-up window like you show here. \$\endgroup\$ Commented Jun 25, 2018 at 6:13
  • \$\begingroup\$ @GabrielStaples Please report this as a bug. It should be working as described although the window will look a bit different than it did back in August. \$\endgroup\$
    – Seth
    Commented Jun 25, 2018 at 18:27
  • \$\begingroup\$ Done! bugs.launchpad.net/kicad/+bug/1778624 \$\endgroup\$ Commented Jun 26, 2018 at 3:30
1
\$\begingroup\$

In KiCad 5, on Windows, not automatically but ...

In properties set the x,y of your first pin header, e.g. 100,100.

enter image description here

Do alt-v, s to specify the grid origin, giving the same x,y coordinates.

enter image description here

The pin header footprint now looks like this.

enter image description here

Place the second pin header and enter it's relative x,y coordinates, e.g. 117.76,100, (or ctrl-m on the parts to move exactly, setting the radio button "relative to grid origin").

enter image description here

Ending up with the two headers aligned the correct distance apart.

enter image description here

In your case you'd set the edge cut as the grid origin and position the two headers relative to there.

\$\endgroup\$
0
\$\begingroup\$

If anyone else has this specific problem I made a tool that takes position and rotation of parts and exports them as a group with the specified relative placement. You can then place the parts like a footprint without having to make one. https://github.com/snhobbs/kicad-parts-placer.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.