laptop and a wrench

Error

Deleting a topology results in the inability to edit feature classes that had participated in that topology, unless ArcMap is closed and launched again.

Última publicación: August 19, 2020 ArcGIS for Desktop
Número de ID del error NIM070232
EnviadoJuly 6, 2011
Última modificaciónJune 5, 2024
Relacionado conArcGIS for Desktop
Versión encontrada10.0
Lenguaje del programaC#
EstadoWill Not Be Addressed

Información adicional

We apologize that we were unable to address this issue within the current product support cycle.  If the issue continues to affect your work in a supported release, please contact Technical Support.

Solución alternativa

//ArcMap.Document is used because this workaround was tested in an Add-In button for Arcmap.IMxDocument pDoc = ArcMap.Document; IMap pMap = pDoc.FocusMap;IDataset pDataset = null;IFeatureLayer pFeaLayer = (IFeatureLayer)pMap.get_Layer(0);string lName = pFeaLayer.Name;IFeatureClass pFeaClass = pFeaLayer.FeatureClass; ITopologyClass pTopoClass = (ITopologyClass)pFeaClass; ITopology pTopo = (ITopology)pTopoClass.Topology;IDataset pFCDataset = (IDataset)pFeaClass;string name = pFCDataset.Name;IWorkspace pWorkspace = pFCDataset.Workspace;IDataset pWsDataset = (IDataset)pWorkspace;IWorkspaceName pWSName = (IWorkspaceName)pWsDataset.FullName;IGxDatabase pGxDatabase = new GxDatabase();pGxDatabase.WorkspaceName = pWSName;IGxObject pObject = (IGxObject)pGxDatabase;pDataset = (IDataset)pTopo;if (pDataset.CanDelete()){ pDataset.Delete(); //At times objects will inherit from a given object and there will be several //instances in memory. We need to dump all of the references to the object //in memory by placing the releaser in a while loop, until all the references are gone //the Releaser will keep going. while (Marshal.ReleaseComObject(pDataset) > 0) { };}pObject.Refresh();while (Marshal.ReleaseComObject(pFeaClass) > 0) { };//disconnect and delete the layer from the mapIDataLayer2 dl = (IDataLayer2)pFeaLayer;dl.Disconnect();pMap.DeleteLayer(pFeaLayer);while (Marshal.ReleaseComObject(pFeaLayer) > 0) { };//the workspace reference does not seem to impact this so we can continue to use this referenceIFeatureWorkspace fw = (IFeatureWorkspace)pWorkspace;IFeatureClass fc = fw.OpenFeatureClass(name);//we got the name of the feature class and layer but they could also look at options to preserve //other aspects of the layers state...symbology, ect. if necessaryIFeatureLayer fl2 = new FeatureLayer(){ FeatureClass = fc, Name = lName, ShowTips = true};//the re-added layer should be editablepMap.AddLayer(fl2);

Pasos para reproducir

ID del error: NIM070232

Software:

  • ArcGIS for Desktop

Recibir notificaciones cuando cambie el estado de un error

Descargar la aplicación de soporte de Esri

Descubrir más sobre este tema

Obtener ayuda de expertos en ArcGIS

Contactar con el soporte técnico

Descargar la aplicación de soporte de Esri

Ir a opciones de descarga