Help, I don't understand Rhino.Geometry.Nurbscurve.Simplify

Hi guys,

it appears I don’t understand how to use this, can you please take a look?

import rhinoscriptsyntax as rs
import scriptcontext
import Rhino

curve=rs.GetObject("")
segments=int(rs.CurveLength(curve)*5+1)
points=rs.DivideCurve(curve, segments)
nc = Rhino.Geometry.NurbsCurve.Create(False, 1, points)
nc.Simplify(0, 0, 0)
newCurve = scriptcontext.doc.Objects.AddCurve(nc)

I am after the same result as if I add this line:

rs.SimplifyCurve(newCurve,0)

But I want to simplify it before I add it to the document.

Something like this:

tol = sc.doc.ModelAbsoluteTolerance
options = Rhino.Geometry.CurveSimplifyOptions.All
crv_simplified = nc.Simplify(options, tol, 0)
id_simplified = sc.doc.Objects.AddCurve(crv_simplified)

I wrote this on my phone so maybe some typos.

Hope to help

Wicked!
I am not used to having to define sooo much more stuff when working with Rhino Common compared to python yet… so THANK YOU!