Answer

OptionExplicitSub AddCurveEndPoints()
Const rhCurve = 4
' Get all the curve objects in the document
Dim arrCurves
arrCurves = Rhino.ObjectsByType(rhCurve)
If IsNull(arrCurves) ThenExitSub' For better performance, turn off screen redrawing
Call Rhino.EnableRedraw(False)
' Process each curve
Dim strCurve
ForEach strCurve In arrCurves
' Add a point at the start of the curve
Call Rhino.AddPoint(Rhino.CurveStartPoint(strCurve))
' If not closed, add a point at the end of the curve
IfNot Rhino.IsCurveClosed(strCurve) ThenCall Rhino.AddPoint(Rhino.CurveEndPoint(strCurve))
EndIfNext' Turn screen redrawing back on
Call Rhino.EnableRedraw(True)
EndSub

import rhinoscriptsyntax as rs
def AddCurveEndPoints():
# Get all the curve objects in the document
curves = rs.ObjectsByType(rs.filter.curve)ifnot curves: return# For better performance, turn off screen redrawing
rs.EnableRedraw(False)# Process each curve for curve in curves:
# Add a point at the start of the curve
rs.AddPoint(rs.CurveStartPoint(curve))# If not closed, add a point at the end of the curveifnot rs.IsCurveClosed(curve):
rs.AddPoint(rs.CurveEndPoint(curve))# Turn screen redrawing back on
rs.EnableRedraw(True)
AddCurveEndPoints()