I am developing a toolbar for ArcMap with .NET ArcObjects and I made an option to round vertices coordinates to meters (no decimals). So I change X and Y of each vertex on each feature. The problem is that if I do a Check Geometry after, I get bad envelope on all features. I guess that it's because the envelope doesn't update itself after changing the vertices.
Is there a way to update envelopes without using Repair Geometry?
I don't want to use it because it does a lot more than just updating envelopes.
Here is the code I am using
lIGeometryCollection = layerFeature.Shape For idx_geometrie As Integer = 0 To lIGeometryCollection.GeometryCount - 1 Dim pointCollection As IPointCollection = lIGeometryCollection.Geometry(idx_geometrie) For idx_point As Integer = pointCollection.PointCount - 1 To 0 Step -1 Dim lPoint As IPoint = New ESRI.ArcGIS.Geometry.Point lPoint.PutCoords( Math.Round(pointCollection.Point(idx_point).X / ResolutionXY, 0, MidpointRounding.AwayFromZero) * ResolutionXY, Math.Round(pointCollection.Point(idx_point).Y / ResolutionXY, 0, MidpointRounding.AwayFromZero) * ResolutionXY) pointCollection.UpdatePoint(idx_point, lPoint) System.Runtime.InteropServices.Marshal.ReleaseComObject(lPoint) Next Next layerFeature.Store()