A quick guide on how to create an object, select and then extrude a face by a specified value.
We’ll jump straight in to some commented code:
# Import the Maya commands library from maya import cmds # Create a cube cube = cmds.polyCube() # Save the object name in a new variable cubeShape = cube[0] # Select a face (face 1 for a cube is the top face) targetFace = cmds.select(cubeShape+'.f[1]') # Extrude the face by a specified translate Z value extrude = cmds.polyExtrudeFacet(localTranslateZ=4)
In terms of Python