# How to distribute / align objects in a line or grid with even spacing?

Very often, when importing multiple objects from an asset kit they are all centered in a scene and need to be manually distributed, so it is easier to work with them.

I was trying to find an option for this in blender, but couldn't get close to any good solution. Hence wanted to ask here if it is possible to somehow select all of these objects and automatically distribute them in a line (say on x axis) or even better some sort of grid (rows and columns) with even spacing?

For example, how to get from this (multiple objects centered together)

To this, objects evenly distributed in a grid (or line). I did this manually, but ideally this should be automatic?

• Hello :). Blender can't distribute objects right now. You can use the Oscurart Tools addon or the Distribute Objects addon May 7, 2021 at 13:49
• Maybe enabling "snap to grid" and grabbing them by hands can be fast enough? May 7, 2021 at 14:33
• You can actually use Python and do it programmatically Feb 3 at 23:14

There's an ol'-school method to distribute your objects on a grid made for the purpose, here with 'Faces Only' deleted:

• Give your display grid a particle system, set to emit [ its vertex-count ] particles, all at frame 1. Non-random, from vertices, particles with a long life.
• Particle Physics : 'None'.
• In the system's 'Render' panel, set to render the collection, scale 1, no randomness
• In the (collection-context) 'Collection' panel, check 'Object Scale' and 'Use Count', with default (1-per-item) setting.

In the grid's modifier stack, you can convert the particles to real instances.

• With a bit of fiddling with Mesh > Sort Elements on the grid, you can even order the instances rationally, as you wish, in the 'Count' panel May 7, 2021 at 16:38

For your purposes, this ought to work:

1. Select all objects. Use a randomize transform operation (which I use the search function to access.) On the operator box (f6 or f9, depending on initial setup settings), adjust the Y and X values to something appropriate to your scene-- for the four objects shown in your pic, let's say 5.

2. Optionally, snap selection to grid, which I access from the shift-s snap menu.

This isn't perfect. There's a chance that objects will occupy the same space. That chance goes down as you use a larger random transform. Not all grid spaces will be occupied. It's just, something fast and easy to do in order to distribute a bunch of stuff so that you can see it.

You could do it programmatically in Python.

Here is how to generate equally spaced pillars.

You can adapt it by creating an array of references to your existing objects.

import bpy
import math

pegboardDiameter=100
pegboardHeight=3

pillarDiameter=1.85
pillarHeight=2

pitch=5

gridSize=14

for xi in range(0, gridSize):
for yi in range(0, gridSize):
xPos=-(gridSize-1)*pitch/2.0+xi*pitch
yPos=-(gridSize-1)*pitch/2.0+yi*pitch