# Distalign plugin

Two actions for aligning and distributing elements in pcb-rnd

## Action Syntax

Align(X/Y, [Lefts/Rights/Tops/Bottoms/Centers/Marks, [First/Last/pcb_crosshair/Average[, Gridless]]])

Distribute(Y, [Lefts/Rights/Tops/Bottoms/Centers/Marks/Gaps, [First/Last/pcb_crosshair, First/Last/pcb_crosshair[, Gridless]]])

## Description

align() aligns selected elements along the X or Y axis, relative to user selected reference points (like specific element edges, their centers, or marks)

distribute() distributes selected elements evenly between the first or last element or to the pcb crosshairs

## Examples

### Build a linear array of tactile switch parts

Command | description | image
--- | --- | ---
import | Import an array of 8 TACT_6x6_4p footprints needed for a 1x8 grid. Place the first part at the exact X,Y coord to start the array Place the last part at the X position where the array will end |
align(y) | The user aligns the TACT_6x6_4p footprints along a Y axis The center of the first part is the default reference point |
distribute(x,centers,first,last) | Note user places last part in position Parts are distributed between the first and last along the X axis |

### Align & distribute a mix of parts

Command | description | image
--- | --- | ---
import | A small set of nonhomogenous parts are imported |
align(x,centers,last) | The parts are aligned to each other along an x axis with resepect to their centers The chosen x axis is determined from the 'last' part location |
distribute(y,gaps) | The parts are evenly distibuted by the gaps between them |
copy, align(), distribute() | The parts in the first step are copied to create an array The align and distribute commands are used for each row of the array in turn |