creating a surface plane

i’d like to create a surface plane through python. so basicaly 4 ‘verts’ and a face inbetween. the following code is making a nurbs curve, but i need a nurbs surface (different thing). after a afternoon experimenting i keep getting curves, without faces, and i can’t make the faces manually either. any thoughts?

import bpy
from mathutils import Vector


coords = [(-.5,-.5,0,0),(-.5,.5,0,0),(.5,.5,0,0),(.5,-.5,0,0)]


 
surfdata = bpy.data.curves.new(name = 'SurfPlane',type = 'SURFACE')


objectdata = bpy.data.objects.new('SurfPlane', surfdata)
objectdata.location = (0,0,0)
bpy.context.scene.objects.link(objectdata)

SurfacePlane = surfdata.splines.new('NURBS')
SurfacePlane.points.add(len(coords)-1)

for num in range(len(coords)):
    SurfacePlane.points[num].co=(coords[num])

the code is mainly from zeffii’s blog, for creating a curve.

and another question: what is the curve/nurbs equivelant of:
tuple(bpy.data.meshes[‘Plane’].vertices[1].co)?

A curve object will have a single or multiple splines…
each of those splines will have bezier points
and each of those will have a coordinate, handle_left, and handle_right

here is an example for my object ‘BezierCurve.’ This is the coordinate of the first bezier point in the first spline. I remember when I was trying to figure this out. Took ages of autocomplete and reading through the options (this was before I started going to the API documentation routinely)

bpy.data.objects['BezierCurve'].data.splines[0].bezier_points[0].co

yea but nurbs surface’s don’t have those bezier points, so i need the coords of the splines themselves…