How to get a RhinoObject from the GUID of an array of curves ? (Python)

Hopefully simple question here:

I am creating an array of curves by projecting a single curve onto a mesh. This fragments the original curve into multiple curves. I then want to access the array of 3D points that comprise each of the curves.

I can easily create the projected curves.

newProjectedCurves = rs.ProjectCurveToMesh(randomCurveGuid,mesh,(0,0,-1))

This returns an array of guids. How do I use these guids to access each of the curves and iterate through their 3D points?

I found these related posts, but still haven’t found a clear way forward:

http://wiki.mcneel.com/developer/rhinocommonsamples/findobjectsbyname

Hi,have you tried using rs.coercecurve(newProjectedCurves)? this gives you access to the geometry

Rhinoscriptsyntax methods work on GUIDS. So all you need to do is loop through the list of GUIDS and extract their control points:

for crvID in newProjectedCurves:
    crv_pt_list=rs.CurvePoints(crvID)
    #do something with the list of 3d points
    #etc.

–Mitch

I tried

newProjectedCurves = rs.ProjectCurveToMesh(randomCurveGuid,mesh,(0,0,-1))
for guid in newProjectedCurves:
        print guid
        pnts = rs.curvePoints(guid)
        print pnts

The result was the following error:
Message: ‘module’ object has no attribute ‘curvePoints’

What ended up working was a combination of both suggestions:

newProjectedCurves = rs.ProjectCurveToMesh(randomCurveGuid,mesh,(0,0,-1))

for guid in newProjectedCurves:
    curve = rs.coercecurve(guid)
    pnts = rs.CurvePoints(curve)
    for pnt in pnts:
        print pnt

Thank you both!

That’s because you missed the capital “C” in CurvePoints. Python is case-sensitive. --Mitch