I just created a curve using C#. How can I get the code to find the curve I just made without clicking on it? Rhino student needs help!

So far, I’m know to use:

doc.Objects.AddCurve(Rhino.Geometry.Curve.CreateInterpolatedCurve( points, degree, knotStyle ));
doc.Objects.Delete( doc.Objects.Find(???), true );

but that’s about it. I’ve looked this up on the internet, and all I found was to use the Find method to search for the object’s ID. Am I using the right commands? If so, how do I get or assign an ID to a Rhino object?

The AddCurve function returns the ID of the Rhino object.

Thank you, it works great now!