pymel.core.general.align

align(*args, **kwargs)

Align or spread objects along X Y and Z axis.

Flags:

Long Name / Short Name Argument Types Properties
alignToLead / atl bool ../../../_images/create.gif
  When set, the min, center or max values are computed from the lead object. Otherwise, the values are averaged for all objects. Default is false
coordinateSystem / cs PyNode ../../../_images/create.gif
  Defines the X, Y, and Z coordinates. Default is the world coordinates
xAxis / x unicode ../../../_images/create.gif
  Any of none, min, mid, max, dist, stack. This defines the kind of alignment to perfom, default is none.
yAxis / y unicode ../../../_images/create.gif
  Any of none, min, mid, max, dist, stack. This defines the kind of alignment to perfom, default is none.
zAxis / z unicode ../../../_images/create.gif
  Any of none, min, mid, max, dist, stack. This defines the kind of alignment to perfom, default is none. Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.align

Example:

import pymel.core as pm

# align the selected objects to their average mid-point in x
pm.align(x='mid')
# align the selected objects to the mid-point in x of the first select object
pm.align(x='mid', alignToLead=True)