Mesh.SplitWithProjectedPolylines

Hello Everyone,

I want to use the command Mesh.SplitWithProjectedPolylines and I get this error.

  1. Error (CS0120): An object reference is required for the non-static field, method, or property ‘Rhino.Geometry.Mesh.SplitWithProjectedPolylines(System.Collections.Generic.IEnumerable<Rhino.Geometry.PolylineCurve>, double)’

Any idea how to solve this?

Here is my script:
private void RunScript(Mesh mesh, List curve, ref object A)
{
var curveTwo = new List();

for(int i = 0; i < curve.Count; i++)
{
  var polyLineC = curve[i].ToPolylineCurve();
  curveTwo.Add(polyLineC);
}


A = Rhino.Geometry.Mesh.SplitWithProjectedPolylines(curveTwo, 0.01);

Hi Mahan,
you forgot to reference the Mesh you want to split.
Something like “myMesh.SplitWithProjectedPolylines(curveTwo, 0.01)”

You can find more information here: SplitWithProjectedPolylines

1 Like

Thanks Dormaius.

1 Like