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 allows you to flip one feature at a time.

What's the ArcObjects equivalent to ArcMap's Flip button?

enter image description here

share|improve this question

1 Answer 1

up vote 7 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
    
@vinayan I am trying to accomplish the same thing, but in VB.NET. Were you able to use ReverseOrientation while editing, that is, in an active edit session, not by starting an edit operation programatically? –  Barbarossa Jun 19 at 2:35
1  
@Barbarossa I did use ReverseOrientation inside an active edit session. However, I "StartEditOperation" (which starts a bunch of edits within an actual edit session) on the Editor object is mandatory. Otherwise, it would mess up your undo stack. What prevents you to use that method? –  Goldorak84 Jun 22 at 17:46
    
Thank you for the response. I was not considering the undo stack. Everything is functioning properly now. –  Barbarossa Jun 22 at 21:10

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.