public static void Initialize()
{
Rhino.RhinoDoc.ReplaceRhinoObject += RhinoDoc_ReplaceRhinoObject;
Rhino.RhinoDoc.AddRhinoObject += RhinoDoc_AddRhinoObject;
}
public static void RhinoDoc_ReplaceRhinoObject(object sender, RhinoReplaceObjectEventArgs e)
{
if (e.OldRhinoObject is GradingCurve curve_o)
{
if (e.NewRhinoObject is CurveObject polycrv)
{
gripsToDelete = curve_o.GetGrips();
curve_o.GripsOn = false;
var res = Display.Doc.Objects.DeleteGrips(gripsToDelete); // Unable to delete these grips
var gradingCurve = new GradingCurve(polycrv.CurveGeometry);
Display.Doc.Objects.AddRhinoObject(gradingCurve,null);
}
}
}
how can I set the same grip to the newly created CustomCurveObject, so I can keep on editing the CustomCurveObject with ControlPoints without breaking?