@dave

I tried to convert your Macro to PythonScript just for fun:

```
-_RunPythonScript (
from Rhino import *
from Rhino.Input import *
from Rhino import *
from Rhino.DocObjects import *
from Rhino.Geometry import *
import math
def test():
go = Input.Custom.GetObject()
go.SetCommandPrompt("Select Curve")
go.GeometryFilter = DocObjects.ObjectType.Curve;
go.GetMultiple(1,0)
if go.CommandResult()!=Commands.Result.Success:
return go.CommandResult()
objrefs = go.Objects()
if not objrefs: return Commands.Result.Nothing
for i, objref in enumerate(objrefs):
# get the curve geometry
curve = objref.Curve().ToNurbsCurve()
(res, plane) = curve.TryGetPlane()
(res, con1 ) = curve.GetNextDiscontinuity( Continuity.C0_continuous, curve.Domain.Min , curve.Domain.Max)
(res, con2 ) = curve.GetNextDiscontinuity( Continuity.C0_continuous, 0.1, curve.Domain.Max)
seamMoved = False
if con1 <= curve.Domain.Min and curve.IsClosed:
if curve.ChangeClosedCurveSeam(con1 + con2):
seamMoved = True
cp = curve.Points.ControlPolygon()
cp.ReduceSegments(RhinoDoc.ActiveDoc.ModelAbsoluteTolerance)
cpNurbs = cp.ToNurbsCurve()
curves = cpNurbs.Offset(plane.PointAt(1000,1000), plane.ZAxis, 2.0, RhinoDoc.ActiveDoc.ModelAbsoluteTolerance, CurveOffsetCornerStyle.Sharp)
# Use this to flip direction
#curves = cpNurbs.Offset(plane.PointAt(0,0), plane.ZAxis, 2.0, RhinoDoc.ActiveDoc.ModelAbsoluteTolerance, CurveOffsetCornerStyle.Sharp)
joinCurves = Curve.JoinCurves(curves, 0.1)
maxLength = 0;
joinedCurve = joinCurves[maxLength].ToNurbsCurve()
(res, newCP) = joinedCurve.TryGetPolyline()
mul = 0.5;
while newCP.Count > cp.Count:
newCP.ReduceSegments(RhinoDoc.ActiveDoc.ModelAbsoluteTolerance * mul)
mul = mul + .5
#RhinoApp.WriteLine( str(newCP.Count) + ":" + str(cp.Count))
for j, p in enumerate(curve.Points):
param1 = cp.ClosestParameter(curve.Points[j].Location)
normParam1 = param1 / cp.Count
curve.Points[j] = ControlPoint(newCP.PointAt(math.floor(normParam1 * newCP.Count)) , curve.Points[j].Weight)
#newRef = RhinoDoc.ActiveDoc.Objects.AddPolyline(cp)
#newRef = RhinoDoc.ActiveDoc.Objects.AddPolyline(newCP)
RhinoDoc.ActiveDoc.Objects.Select(objref, False)
newRef = RhinoDoc.ActiveDoc.Objects.AddCurve(curve)
RhinoDoc.ActiveDoc.Objects.Select(newRef, True)
test()
)
```

It is not 100%, but maybe someone else can run with it.