When you perform an action on an object in the Maya user interface, you are using Maya commands to change the attributes of selected objects. You can use the same Maya commands explicitly to edit the attributes of objects in the scene.
move 3 2 1;
The polygonal cube is moved to the XYZ co-ordinates 3,2,1.
The move command has set the translate attributes to the specified arguments of the command. These arguments are called command arguments as they are not used with flags.
When a command is typed into the Script Editor, it acts on the current selection, unless an object name is provided as an argument to the command.
move -1 -2 -3 -relative;
The polygonal cube moved relative to its current position by -1,-2,-3 in XYZ.
The move command is used with the relative flag to change the method in which the command executes. The relative flag does not have any arguments; the values -1,-2,-3 are command arguments used with the move command. The values are prefaced by a negative sign, but are not recognized as flags as they do not contain any of the flag keywords.
This is equivalent to using the Move tool in the Maya interface.
To specify attributes of geometry with flags
polySphere -radius 2 -subdivisionsX 4;
The radius flag allows you to specify a value for the radius of the sphere. The value 2 is associated with the radius flag, and is not a command argument.
This is equivalent to specifying values within the Polygon Sphere Options dialog in the Maya interface.
Some flags have the same short names, but they are used in different contexts so it does not affect the execution of the script. For example: -r is the short name of the -relative flag, used with the move command, -r is also the short name of the -radius flag, used with the sphere command.
rename test_Sphere;
The rename command changes the name of the currently selected object. If multiple objects are selected, the rename command renames the selected objects to the specified name with a numerical index appended, as every object must have a unique name.
This is equivalent to renaming an object with the Attribute Editor or the Channel Box in the Maya interface.
Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License