Create Surface from Points in Rhino Python, Message: expected IEnumerable[Point3d], got list

There’s a lot going on there that I can’t really comment on (mac, rhinoscriptsyntax etc.). But, occasionally the underlying RhinoCommon method (i.e. this one) requires an explicit list type (i.e. a regular Python list won’t do). In this case of type Point3d. When this happens I usually just wrap my Python list in a Point3dList. Something like this:

import Rhino as rc

ptsPyList = [rc.Geometry.Point3d(0,0,0),rc.Geometry.Point3d(1,2,3)]
ptsList3d = rc.Collections.Point3dList(pts)

Also, welcome to the forum. We encourage people to provide an example file that demonstrates their issue. This helps tremendously when trouble-shooting etc. :slight_smile:

Edit: A more general solution that’ll work with other types, is something like this:

import Rhino as rc
from System.Collections.Generic import List

ptsPyList = [rc.Geometry.Point3d(0,0,0),rc.Geometry.Point3d(1,2,3)]
ptsList3d = List[rc.Geometry.Point3d](ptsPyList)
4 Likes