Selecting a Face and Extruding a Cube in Blender Via Python API
<p>I am working on a project in which I will need to be able to extrude the faces of a cube via the python API.</p>

<p>I have managed to extrude a plane via the API:</p>

<pre><code>import bpy

bpy.data.objects['Cube'].select = True # Select the default Blender Cube
bpy.ops.object.delete() # Delete the selected objects (default blender Cube) 

#Define vertices and faces
verts = [(0,0,0),(0,5,0),(5,5,0),(5,0,0)]
faces = [(0,1,2,3)]

# Define mesh and object variables
mymesh = bpy.data.meshes.new("Plane")
myobject = bpy.data.objects.new("Plane", mymesh)  

#Set scene of object
bpy.context.scene.objects.link(myobject)

#Create mesh
mymesh.from_pydata(verts,[],faces)
mymesh.update(calc_edges=True)

bpy.context.scene.objects.active = bpy.context.scene.objects['Plane']

bpy.ops.object.mode_set(mode='OBJECT')
bpy.ops.object.select_all(action='DESELECT')
bpy.data.objects['Plane'].select = True # Select the default Blender Cube
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.extrude_region_move(TRANSFORM_OT_translate={"value":(0, 0, 2)})
</code></pre>

<p>I have built my Cube in a similar way but my issue is I can't work out how to select a face to extrude via the Python API</p>

<p>Please find my Cube Code <a href="http://pastebin.com/PQtMcRAh" rel="nofollow">http://pastebin.com/PQtMcRAh</a></p>

<p>All Help is Appreciated :)</p>