ERROR
A coding practice has been identified that could lead to geometric network inconsistencies, and the following error may be displayed as a result of guards against this coding practice that have been installed in ArcGIS 9.3.
"The modified geometry must be a different geometry instance from the feature's original geometry (e.g., a copy or new instance)"
The following is a summary of the coding practice: Getting the geometry of a feature through the IFeature.Shape property, updating the reference to the feature, and using that same reference to set the geometry to the feature, may cause geometric network inconsistencies.
The error is due to a fix that was made to guard against a coding practice, which could lead to geometric network inconsistencies.
Note:
The correct coding practice of using IFeature.ShapeCopy is being used, while the line that may cause the error to appear has been commented out.
Code:
pEditor.StartOperation
Set pEdLayers = pEditor
Set pFeatures = pEditor.EditSelection
pFeatures.Reset
Set pFeature = pFeatures.Next
Dim pGeom As IGeometry
'This line is incorrect
'Set pGeom = pFeature.Shape
'This is the correct way to access the geometry for modification
Set pGeom = pFeature.ShapeCopy
Dim pGeomColl As IGeometryCollection
Set pGeomColl = pGeom
Dim pPointColl As IPointCollection
Set pPointColl = pGeomColl
Dim pPoint1 As IPoint
Dim pPoint2 As IPoint
Set pPoint1 = Create_PointGeometry(-5959.167882, 5667307.034188)
Set pPoint2 = Create_PointGeometry(-5983.323227, 5667300.739636)
pPointColl.AddPoint pPoint1
pPointColl.AddPoint pPoint2
Set pFeature.Shape = pGeom
pFeature.Store
pEditor.StopOperation ("Update geometry of edge feature")
Get help from ArcGIS experts
Download the Esri Support App