Nurbs Surface Itration

Hi,

I'm trying to work on a python script that can iterate through the all the control vertices of a selected nurbs surface & return the position of the 1st cv and then moe onto all the cv's in the selected nurbs surface and get their respective point positions in space.

I went through the maya documentation and found out that we need to use the MItSurfaceCV class and its functions to access a nurbs object at the cv level.

CODE
import maya.OpenMaya as OpenMaya
import maya.cmds as cmds

def selectedObject(currentObject):
        objectSurface = OpenMaya.MItSurfaceCV()
    objectSurface.MItSurfaceCV(currentObject)
    objectSurface.reset()
    cvPosition=objectSurface.position()
        return cvPosition

print "Find the selected nurbs object";
selObject= cmds.ls(sl=True);
seObj=[selObject];
print seObj[0];
objectResult= [selectedObject(seObj[0])];

I'm a bit new to Python but I would really like to know how I can access such API classes for use in python scripts.

Thanks in advance,

Nikhil.

You cant mix scripting and api work. If you do api stuff you need to go the whole long haul of extending classes and so on. If you script then you script. No middle ground exists sorry. If you work with api you need to actually do a plug-in.

QUOTE
If you work with api you need to actually do a plug-in.

Thanks a lot for that piece of information.. I can now plan my work accordingly..

Cheers!