Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

In an ArcMap extension, I need to flip multiple lines from a selection.

The ArcMap Flip button only allow to flip one feature at a time.

What's the ArcObjects equibalent to the ArcMap's flip button?

enter image description here

share|improve this question

1 Answer 1

up vote 5 down vote accepted

ICurve.ReverseOrientation should do what you want.

Actually there is a full snippet Flip Line Direction Snippet , available in the ESRI online documentation.

Here is a small extract from it:

ESRI.ArcGIS.Geometry.ICurve curve = feature.Shape as ESRI.ArcGIS.Geometry.ICurve;
curve.ReverseOrientation();
feature.Shape = curve;
feature.Store();
share|improve this answer
    
Thanks! By the way, there's an error in the Flip Line snippet. the line "if(!(feature is ESRI.ArcGIS.Geometry.ICurve))" should be "if(!(feature.Shape is ESRI.ArcGIS.Geometry.ICurve))" –  Goldorak84 Jan 9 '13 at 19:06
    
@Goldorak84 - yes thats correct..quite a few of them are lurking in the samples :) –  vinayan Jan 10 '13 at 5:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.