Align to grid - can't figure out how (scroll down to see version info)

I know this sounds so obvious but I can’t figure out how to align a part to the grid. Please see my attached image. I have (4) TO-220 power resistors, all the same symbol. I select one, move it around, and put it down. Same for the other 3. But there are 2 sets of alignment and they don’t change. See picture - the white reference line shows that they are not aligned to the same grid. I tried searching the forums and found stuff about the schematic but not the PCB. Any suggestions appreciated. Thanks,

Lloyd

Application: Pcbnew
Version: (5.1.9)-1, release build
Libraries:
wxWidgets 3.0.5
libcurl/7.71.0 OpenSSL/1.1.1g (Schannel) zlib/1.2.11 brotli/1.0.7 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.3.0) libssh2/1.9.0 nghttp2/1.41.0
Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
wxWidgets: 3.0.5 (wchar_t,wx containers,compatible with 2.8)
Boost: 1.73.0
OpenCASCADE Community Edition: 6.9.1
Curl: 7.71.0
Compiler: GCC 10.2.0 with C++ ABI 1014

Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=OFF
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=OFF
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON

(IMHO) It is a fine point (pun not intended) of operation as to how easily a footprint can align to a coarse grid once it has been moved off of that grid. I am using 5.99 and I think it will easily snap footprints to the operating grid regardless of whether it was on or off initially. But I seem to recall that that may not have been the case with 5.1x. One option…if you do a context menu click (a right click for most users but not for me) on your footprint and select properties, can you then type in coordinates for the footprint so as to get it onto any desired grid?

This is my dialog box in 5.99; 5.1x is probably different but also probably gives you that option.

If you move a footprint in Pcbnew, then the “attachment point” with which you grabbed it is put on the grid.

This means that if you grab a footprint by a pad, then the center of the pad is put on the grid. If you grab it by the center of the footprint, then that center is put on the grid. End result is that if you have a bunch of identical footprints, but you select them differently, then they will not line up.

1 Like

Probably the easiest way to fix this situation is to change your grid to something very fine, zoom right in, move the offending pair 'till they align, then change your grid setting back to what you normally use.
Grid settings are at the top of the PCB page just under the Ladybug symbol.

Then in future, as @paulvdh mentions, be consistent with where you grab a component.

Another thought: delete the offending pair and just copy the good pair.

You can also use context menu -> Align/Distribute -> Align functions. It’s a matter of personal taste if it feels intuitive to use, but it should work. Select all those footprints, hover the mouse cursor onto the footprint you want to use as the unmoved reference, use Align to Top or Align to Bottom.

there is a plugin to snap footprints to grid:
image
kicad-action-tools/Snap2Grid

  • Snap Selected Footprint(s) to Grid

Tool to move the selected footprint module(s) to the Grid.
The Modules can be easily aligned to GridOrigin or to Auxiliary Origin.

This is the secret sauce that I was looking for. Thanks very much.

Thanks, I was aware of this but hoping for a less typing-intensive solution. Paulvdh gave me the secret, see below.
Lloyd

Thanks, yes, @paulvdh gave me the secret and I’ll use that going forward.
Lloyd

Thanks @maui, but I couldn’t figure out what to do with the repository that your link points to (how to install it). For now I’ll use the knowledge about where to click on a symbol to control its alignment to the grid.
Lloyd

If you already aligned one of the components and want to align the a second one, you can grab the second component and put it on top of the first one until they snap, even if they are not in the same grid (you notice this, when you get a circle on the grabbing point) to each other, then you just move it in X or Y as you desire.

Thanks. I prefer to align them both to the grid, which was explained to me above.
Thanks for the info,
Lloyd

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.