This document is archived and information here might be outdated.  Recommended version.


ICurve Interface (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (Geometry)  

ICurve Interface

Provides access to properties and methods of all 1 dimensional curves (polylines, segments, boundaries of polygons, etc.). Note: the ICurve interface has been superseded byICurve3. Please consider using the more recent version.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

A curve is an abstract one-dimensional geometry between specific From and To points.  A curve can be composed of a single Segment, a Path of connected segments, or a Polycurve containing many paths of segments.  The properties and methods of the curve allow the user to query information about the entire curve or points along the curve.  The distance along the curve can be specified in a fixed unit of measure or as a ratio of the Length of the curve.  The user can obtain information about Tangents, Normals, Subcurves, and Points along the curve.

Members

Description
Read-only property Dimension The topological dimension of this geometry.
Read-only property Envelope Creates a copy of this geometry's envelope and returns it.
Read/write property FromPoint The 'from' point of the curve.
Read-only property GeometryType The type of this geometry.
Method GeoNormalize Shifts longitudes, if need be, into a continuous range of 360 degrees.
Method GeoNormalizeFromLongitude Normalizes longitudes into a continuous range containing the longitude. This method is obsolete.
Method GetSubcurve Extracts a portion of this curve into a new curve.
Read-only property IsClosed Indicates if 'from' and 'to' points (of each part) are identical.
Read-only property IsEmpty Indicates whether this geometry contains any points.
Read-only property Length The length of the curve.
Method Project Projects this geometry into a new spatial reference.
Method QueryEnvelope Copies this geometry's envelope properties into the specified envelope.
Method QueryFromPoint Copies this curve's 'from' point to the input point.
Method QueryNormal Constructs a line normal to a curve from a point at a specified distance along the curve.
Method QueryPoint Copies to outPoint the properties of a point on the curve at a specified distance from the beginning of the curve.
Method QueryPointAndDistance Finds the point on the curve closest to inPoint, then copies that point to outPoint; optionally calculates related items.
Method QueryTangent Constructs a line tangent to a curve from a point at a specified distance along the curve.
Method QueryToPoint Copies the curve's 'to' point into the input point.
Method ReverseOrientation Reverses the parameterization of the curve ('from' point becomes 'to' point, first segment becomes last segment, etc).
Method SetEmpty Removes all points from this geometry.
Method SnapToSpatialReference Moves points of this geometry so that they can be represented in the precision of the geometry's associated spatial reference system.
Read/write property SpatialReference The spatial reference associated with this geometry.
Read/write property ToPoint The 'to' point of the curve.

Inherited Interfaces

Interfaces Description
IGeometry Provides access to members that describe properties and behavior of all geometric objects.

CoClasses that implement ICurve

CoClasses and Classes Description
BezierCurve A cubic Bezier curve defined between two points; optionally has measure, height and ID attributes at each endpoint.
CircularArc A portion of a circle that connects two points optionally has measure, height and ID attributes at each endpoint.
EllipticArc A portion of the boundary of a 2D ellipse that connects two points; optionally has measure, height and ID attributes at each endpoint.
Line A 2D straight line between a pair of 2D endpoints; can optionally have height, measure and ID attributes at each endpoint.
Path A sequence of connected segments.
Polygon A collection of rings ordered by their containment relationship; optionally has measure, height and ID attributes.
Polyline An ordered collection of paths; optionally has measure, height and ID attributes.
Ring An area bounded by one, closed sequence of connected segments; optionally has measure, height and ID attributes at each vertex.
[C#]

//The example shows how to get the ICurve properties of a polygon feature
public void GetCurveProperties(IFeature currentFeature)
{
    if (currentFeature.Shape.GeometryType == esriGeometryType.esriGeometryPolygon)
    {
        ICurve curve=currentFeature.Shape as ICurve;
        System.Windows.Forms.MessageBox.Show("Polygon::ICurve properties..." + "\n" +
        "Curve.Length=" + curve.Length + "\n" +
        "Curve.IsClosed=" + curve.IsClosed + "\n" +
        "Curve.FromPoint.X=" + curve.FromPoint.X + "\n" +
        "Curve.FromPoint.Y=" + curve.FromPoint.Y + "\n" +
        "Curve.ToPoint.X=" + curve.ToPoint.X + "\n" +
        "Curve.ToPoint.Y=" + curve.ToPoint.Y
        );
    }
}

[Visual Basic .NET]

    ' The example shows how to get the ICurve properties of a polygon feature
    Public Sub t_ICurve_polygon(ByVal pFeature As IFeature)
        Dim pCurve As ICurve
        If pFeature.Shape.GeometryType=esriGeometryType.esriGeometryPolygon Then
            pCurve=pFeature.Shape
            MsgBox("+++Polygon::ICurve properties..." & vbCrLf _
              & "Curve.Length=" & pCurve.Length & vbCrLf _
              & "Curve.IsClosed=" & pCurve.IsClosed _
              & "Curve.FromPoint.X=" & pCurve.FromPoint.X & vbCrLf _
              & "Curve.FromPoint.Y=" & pCurve.FromPoint.Y & vbCrLf _
              & "Curve.ToPoint.X=" & pCurve.ToPoint.X & vbCrLf _
              & "Curve.ToPoint.Y=" & pCurve.ToPoint.Y)
        End If
    End Sub

See Also

IPoint Interface | IGeometry Interface | ISegment Interface | ILine Interface | IEllipticArc Interface | ICircularArc Interface | IBezierCurve Interface | IPath Interface | IRing Interface | IPolycurve Interface | IPolygon Interface | IPolyline Interface | IPolycurve2 Interface

.NET Snippets

Flip Line Direction

.NET Samples

Curve conversion add-in (Code Files: CurveConversionDockWin) | Tabbed feature inspector (Code Files: TabbedInspector) | Move a graphic along a path in ArcMap (Code Files: AnimationUtils) | ArcGIS Network Analyst extension barrier location editor (Code Files: EditorForm) | Tabbed feature inspector (Code Files: ObjectInspector)