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.

I have a custom extension which adds some custom transformations to the map. When turned off, the extension is supposed to remove all the added transformations.
However, when calling IGeoTransformationOperationSet.RemoveAll(), nothing happens. The transformations are removed from the set but nothing changes in the map - the transformed features stay in the same place and do not move back to their original position.

I'm using Arcgis desktop 10.0 and my code is written in c#.

How can I turn off/on the custom transformations? What am I missing? Thanks.

share|improve this question
    
Stupid question, but you are forcing a refresh of the data frame/active view, right? –  mkennedy Apr 24 '13 at 16:05
    
Not stupid at all, and yes I do. –  ItayMaoz Apr 25 '13 at 15:07
add comment

1 Answer

up vote 0 down vote accepted

As far as I know, there are two GeoTransformationOperationSet objects and you should remove both of it. The sample code is,

//Remove from Map Object
IMapGeographicTransformations pMapGeoTrans = pMap as IMapGeographicTransformations;
IGeoTransformationOperationSet pGeoTransSet =  pMapGeoTrans.GeographicTransformations;
pGeoTransSet.RemoveAll();

//Remove from SpatialReferenceEnvironment Object
ISpatialReferenceFactory2 pSRF = new SpatialReferenceEnvironmentClass();
pGeoTransSet = pSRF.GeoTransformationDefaults;
pGeoTransSet.RemoveAll();

//Refresh view
IActiveView pActiveView = pMap as IActiveView;
pActiveView.Refresh();

Hope this helps you.

share|improve this answer
    
Thanks, It works now. I needed to remove the transformations from the spatial reference environment class. –  ItayMaoz Apr 28 '13 at 11:46
add comment

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.