How to move curve point in python

Hi, I’m trying to adjust curve point by python. But I can’t make it works. Please help me, thanks!

import rhinoscriptsyntax as rs
import scriptcontext as sc
obj = rs.GetObject(“Select a curve”)
#3d point

I think the rs.CurvePoint() call probably created a copy of the list of control points
You need to somehow point directly to NurbsCurve.Point property
Here I have a (perhaps clumsy) solution…

import rhinoscriptsyntax as rs
import Rhino.Geometry as rhg
import Rhino as rh
import scriptcontext as sc

c = rs.GetCurveObject()[0]
robj = sc.doc.Objects.FindId(c)
crv = robj.Geometry
nurbs = crv.ToNurbsCurve()

# below line is an example; do what you need in your case
nurbs.Points[1] = rhg.Point3d(5,5,0)

sc.doc.Objects.AddCurve(nurbs, rh.DocObjects.ObjectAttributes())