I need the end coordinates of a curve to update in Rhino when the curve is modified. I am using Rhino events to capture the changes, but it gives me the coordinates of the line before the modification."
private void OnReplaceRhinoObject(object sender, RhinoReplaceObjectEventArgs e)
{
curveId = e.ObjectId;
ExpireSolution(true);
}
protected override void SolveInstance(IGH_DataAccess DA)
{
var findcurve = RhinoDoc.ActiveDoc.Objects.Find(curveId);
if (findcurve.Geometry != null && findcurve.Geometry is Curve CurveFromEvent)
{
RhinoDoc.ActiveDoc.Objects.AddSphere(new Sphere(CurveFromEvent.PointAtEnd, 5));
}
}