Click or drag to resize

CurveDuplicateCurve Method

Constructs an exact duplicate of this curve.

Namespace:  Rhino.Geometry
Assembly:  RhinoCommon (in RhinoCommon.dll)
Since: 5.0
public Curve DuplicateCurve()

Return Value

Type: Curve
An exact copy of this curve.
using Rhino;
using Rhino.Commands;
using Rhino.Input;
using Rhino.DocObjects;

namespace examples_cs
  public class ReverseCurveCommand : Command
    public override string EnglishName { get { return "csReverseCurve"; } }

    protected override Result RunCommand(RhinoDoc doc, RunMode mode)
      ObjRef[] obj_refs; 
      var rc = RhinoGet.GetMultipleObjects("Select curves to reverse", true, ObjectType.Curve, out obj_refs);
      if (rc != Result.Success)
        return rc;

      foreach (var obj_ref in obj_refs)
        var curve_copy = obj_ref.Curve().DuplicateCurve();
        if (curve_copy != null)
          doc.Objects.Replace(obj_ref, curve_copy);
      return Result.Success;
import rhinoscriptsyntax as rs
from scriptcontext import *
import Rhino

def ReverseCurves():
    crvs = rs.GetObjects("Select curves to reverse", rs.filter.curve)
    if not crvs: return

    for crvid in crvs:
        crv = rs.coercecurve(crvid)
        if not crv: continue
        dup = crv.DuplicateCurve()
        if dup:
        doc.Objects.Replace(crvid, dup)

if __name__ == "__main__":
See Also