Python rs.CurveEditPoints() return value

@Alain,

just stumbled over this while not beeing able to slice without using coerce3dpointlist:

pts = rs.CurveEditPoints(id) 

returns a type of ‘Point3dList’ while

pts = rs.CurvePoints(id)

returns a regular python ‘list’. Is there any reason for the difference ?

thanks,
c.

Hi Clement
rs.CurvePoints(id) return control points,Like the picture right command.rs.CurveEditPoints(id) return edit point,Like the picture left command

Hi Clement,

I’ve seen this happen before in a couple of places - I think this is just that the two RhinoCommon methods are written slightly differently. IIRC, you can just use list(rs.CurveEditPoints(id)) as a workaround if you want to slice the list…

@alain, this probably should be looked at anyway?

–Mitch

Hi,

I think that returning a list is the right thing to do and is more consistent with RhinoScript.

Logged.

Thanks

Thanks, that makes sense.

c.

I have noticed this occurs in a couple of places too. To one that comes to mind is rs.coercemesh. This produces a number of arrays that are not normal python lists (MeshVertexList, MeshVertexNormalList etc).

This may be intended but it seems inconsistent with how other functions work.

@Helvetosaur

I like this one, much simpler than my current workaround!