Select vertices on one side of a cube The aim is to select the vertices of one side of a cube. 

My intention was to change the view's orientation using bpy.ops.view3d.viewnumpad and then select the vertices that are visible, using bpy.ops.vew3d.select_border.

    def changeView(view):
               for area in bpy.context.screen.areas:
                 if area.type == 'VIEW_3D':
                     override = bpy.context.copy()
                     override['area'] = area
                     bpy.ops.view3d.viewnumpad(override, type=view, align_active=False)
                  break   



    def select_border(mesh,context, view3dAreaAndRegion=None, extend=True):
          if not view3dAreaAndRegion:
            view3dAreaAndRegion = getView3dAreaAndRegion(context)
          view3dArea, view3dRegion = view3dAreaAndRegion

          override = context.copy()
          override['area'] = view3dArea
          override['region'] = view3dRegion

          #change orientation to Front side
          changeView('FRONT');

          bpy.ops.view3d.select_border(override,
                                       gesture_mode=3,
                                       xmin=0,
                                       xmax=view3dArea.width,
                                       ymin=0,
                                       ymax=view3dArea.height,
                                       extend=extend)
           return view3dAreaAndRegion


This works, so long as I click 'Run Script' twice, or if the View is already set manually by hitting 1 on the number pad. 

However the problem is, if I pan around,then hit 'Run Script' once, it selects all the vertices that are visible from that angle, before changing the view's orientation to Front.
You could use some vector math to select the right facing verts (deselect all verts and run this in object mode in the text editor, or paste in the console)

from bpy import context as C
from mathutils import Vector

for v in (v for v in C.object.data.vertices if v.normal.dot(Vector((1,0,0))) &gt; 0):
    v.select = True


alternately, to select the left side, change the Vector to (-1,0,0). Top, (0,0,1) etc.