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


ICurve.ReverseOrientation Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Interfaces > IC > ICurve Interface > ICurve.ReverseOrientation Method
ArcGIS Developer Help

ICurve.ReverseOrientation Method

Reverses the parameterization of the curve ('from' point becomes 'to' point, first segment becomes last segment, etc).

[Visual Basic .NET]
Public Sub ReverseOrientation ( _
)
[C#]
public void ReverseOrientation (
);
[C++]
HRESULT ReverseOrientation(
void
);

Product Availability

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

Description

ReverseOrientation changes the direction of the curve without changing the spatial position of the curve.  The From Point and To Point of each Segment in each part of the curve are interchanged.

Remarks

The ReverseOrientation method works the same way as the Arcedit FLIP command. It reverses the order of the vertices in the Curve.

Caution should be taken in using ReverseOrientation on Polygons.  Since ReverseOrientation changes the direction of each Ring within the Polygon, all Exterior Rings become Interior Rings and vice versa.

Reverse Orientation Example

[C#]

    public void ReverseOrientation(IFeatureClass featureClass, int oidToEdit)
    {
        IFeature feature = featureClass.GetFeature(oidToEdit);
        if (feature.Shape.GeometryType == esriGeometryType.esriGeometryPolygon)
        {
            IArea area = feature.Shape as IArea;
            double beforeReverse = area.Area;
            ICurve curve = feature.Shape as ICurve;
            curve.ReverseOrientation();
            double afterReverse = area.Area;
            System.Windows.Forms.MessageBox.Show(String.Format("The polygon area is originally {0}, after the orientation was reversed the area is {1}.",beforeReverse,afterReverse));
        }
    }

See Also

ICurve Interface