ERROR

The feature is mutually exclusive. Cannot update shape

Last Published: April 25, 2020

Error Message

The following error is a result of guards installed in ArcGIS Service Pack 6 to prevent the use of certain coding practices which lead to geometric network inconsistencies:

"The feature is mutually exclusive. Cannot update shape."

The coding practice is summarized as getting the geometry of a feature through the IFeature.Shape property, updating the reference to the feature and then using that same reference to set the geometry to the feature. This may cause geometric network inconsistencies.

Cause

The error is returned due to a fix included in ArcGIS 9.2 Service Pack 6 to guard against a coding practice which could lead to geometric network inconsistencies.

Solution or Workaround

If the error is being raised through one the ArcGIS tools or commands with no custom code, contact ESRI Technical Support, so they can create a new incident and try to reproduce the problem.

If the error is being raised through the use of custom code, modify a copy of the geometry instead of the geometry itself. This can be done through the use of IFeature.ShapeCopy instead of IFeature.Shape, so that a copy of the feature’s shape is modified.

The code example listed below shows the changes necessary to circumvent the error message.

Note:
The correct coding practice for using IFeature.ShapeCopy is being used, while the line that may cause the error to appear has been commented out.



pEditor.StartOperation

Set pEdLayers = pEditor
Set pFeatures = pEditor.EditSelection

pFeatures.Reset
Set pFeature = pFeatures.Next

Dim pGeom As IGeometry
' Set pGeom = pFeature.Shape
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")

    Article ID:000010097

    Software:
    • ArcMap 9 x

    Get help from ArcGIS experts

    Contact technical support

    Download the Esri Support App

    Go to download options

    Discover more on this topic