Grasshopper Python SubD script (got getsetter_descriptor)

Hey all,

I have been playing around with Rhino 7 and it’s SubD possibilties. To make the modeling easier I have been trying out to generate the SubD from a mesh through Grasshopper python. One of the functions within Rhino ToSubD is to InterpolateMeshPoints. I wanted to try this within Grasshopper as well however when I define the SubDCreationOptions and call InterpolateMeshVertices I get a getsetter_descriptor error.

Specifically:

Runtime error (ArgumentTypeException): expected SubDCreationOptions, got getset_descriptor

Script:

import rhinoscriptsyntax as rs
import Rhino.Geometry as rg

geometry = rs.coercemesh(x)
options = rg.SubDCreationOptions.InterpolateMeshVertices

a = rg.SubD.CreateFromMesh(geometry, options)

Any one has experience with this?

Hi @h.h.c.manders,

Its all in the error message, the function takes a mesh and an optional options input of Type SubDCreationOptions .

I don’t have access to WiP on this PC so i can’t look at the internal documentation which is shown in the _EditPythonScript Editor but I assume the code should look like this:

import rhinoscriptsyntax as rs
import Rhino.Geometry as rg

geometry = rs.coercemesh(x)
options = rg.SubDCreationOptions()
options.InterpolateMeshVertices = True

a = rg.SubD.CreateFromMesh(geometry, options)

Hope to help