Python Examples of Rhino.Geometry.Curve.SetEndPoint

Hi,

Are there any examples out there that use Rhino.Geometry.Curve.SetEndPoint. I want to move the end point of a curve to a new location.

Thanks in Advance,

Eric

Do you mean something like this?

import rhinoscriptsyntax as rs
import Rhino
from scriptcontext import doc

# let user pick a curve
picked_crv = rs.GetCurveObject(
                        "Please select a curve for moving endpoint",
                        True,
                        False)

# let user pick new endpoint
picked_pt = rs.GetPoint("Please select the new endpoint of the curve")

# coerce GUID to get the curve geometry
rg_crv = rs.coercecurve(picked_crv[0])

# call SetEndPoint using RhinoCommon
rg_crv.SetEndPoint(picked_pt)

# add the modified curve to the document
doc.Objects.Add(rg_crv)
1 Like

YES!!! Perfect. Thank you so much.

Eric