Go to: Synopsis. Return value. Flags. Python examples.

Synopsis

autoPlace([useMouse=boolean])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

autoPlace is undoable, NOT queryable, and NOT editable.

This command takes a point in the centre of the current modeling pane and projects it onto the live surface. This produces a point in 3 space which is returned. If the um/useMouse flag is set the current mouse position is used rather than the centre of the modeling pane.

Return value

float[]Placement location in 3D space

Flags

useMouse
Long name (short name) Argument types Properties
useMouse(um) boolean create
Use the current mouse position rather than the centre of the active view.

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

#    Move the scene around a bit so the grid is no longer
#    centered in the view.
#
cmds.track( right=10 )
cmds.track( down=10 )

#    Create a sphere.
#
sphere = cmds.sphere()

#    Reposition the sphere so that it is in the center of the
#    view.
#
position = cmds.autoPlace()
cmds.move( position[0], position[1], position[2], sphere[0], relative=True )