Get; Set; Control Points / Grips with Python

Thanks Lukas + Anders. I’ll post my example here to save double posting.

I have a blue curve and cyan curve in the attached file. The blue curve is a MorphControl for the surface. Both curves have the same structure.I want to amend XY locations of each point on the blue curve to the XY locations of the Cyan curve, for each associated control point. Below is my isolated example.

set_points_example.3dm (143.7 KB)

NB This is a simplified example, that I want to translate to doing a CageEdit: Local to a polysurface

This is what I have so far. I can set the location of the control point, but it doesn’t actually seem to redraw and make the change. I would appreciate any ideas on how to approach this differently and correctly.

# Match Control Point Locations
# V1.0
# Designed for matching control points of a Control cage to a target location
#Matching XY locations

import rhinoscriptsyntax as rs
import Rhino as rh
import scriptcontext as sc

#My Test Target Location for Setting Point [0]
target_location = rs.CreatePoint(-342,79,52)

#Pick MorphControlType
source_guid = rs.GetObject("Pick Morph Control with points to transform", filter = 131072)
source_object = rs.coercerhinoobject(source_guid)
morphcontrol_curve = source_object.Geometry.Curve

print "Location Before:", morphcontrol_curve.Points [0].Location

points_list = morphcontrol_curve.Points
result = points_list.SetPoint(0, target_location)

if result:
    print "Location was changed behind the curtain"

print "Location After:", morphcontrol_curve.Points [0].Location

#Rhino.Geometry.Transform.Translation() # between each original/offset point

# Rhino.Geometry.Collections.NurbsCurvePointList.SetPoint(0, target_location)
"""
rs.AddPoint(morphcontrol_curve.Points [0].Location)
rs.AddPoint(morphcontrol_curve.Points [1].Location)
"""

# Maybe can just use Replace?
# Maybe transform points? sc.doc.Objects.Transform()
# Eventually match all points on a curve as below
# target = rs.GetObject( "Pick curve to match to", filter = 4 )