Curve.DivideByCount Method C#

Hey everyone!

Curve.DivideBy… is not suggesting in grasshopper C# component!
Even there’s no suggestion after Curve.Di… !
Anyone experiencing the same problem? Or anyone can help me fix this?

Thanks a lot

Divisions are not Static methods in Curve Class.

You have to use the selected curve object and then you can implement the division on it. Something like this

 private void RunScript(Curve inputCrv, double iLength, int iCount, string iDivideBy, ref object A)

    List<Point3d> divisionPts = new List<Point3d>();
    Point3d[] divPts;
    if(iDivideBy == "Count")
      inputCrv.DivideByCount(iCount, true, out divPts);
    else if(iDivideBy == "Length")
      inputCrv.DivideByLength(iLength, false, out divPts);


    A = divisionPts;


DivideCurve (7.6 KB)

1 Like

It’s working perfectly!