How to get a mesh from meshobject

Starting with getting objects on a layer, I am trying to combine into a mesh.

objs = Rhino.RhinoDoc.ActiveDoc.Objects.FindByLayer(layername)

When going through the objs and running into a mesh:
rs.coercemesh(obj) returns None
obj.ObjectType returns MeshObject: (unamed)(-xxxxx)
rs.IsMesh(obj) returns False
mesh.Append(obj) returns an Error: Expected Mesh, got MeshObject

hi @Mat_S,

The MeshObject class has a MeshGeometry property which returns a mesh. Try calling that and see if it helps :slight_smile:

1 Like