laptop and a wrench

Bogue

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

Dernière publication: August 19, 2020 ArcGIS for Desktop
Numéro d’ID de bogue NIM070232
EnvoiJuly 6, 2011
Dernière modificationJune 5, 2024
S’applique àArcGIS for Desktop
Version trouvée10.0
Langue du programmeC#
StatutWill Not Be Addressed

Informations supplémentaires

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.

Solution de contournement

//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);

Étapes pour reproduire

ID de bogue: NIM070232

Logiciel:

  • ArcGIS for Desktop

Recevoir une notification lorsque le statut d’un bogue change

Télécharger l’application Esri Support

En savoir plus sur ce sujet

Obtenir de l’aide auprès des experts ArcGIS

Contacter le support technique

Télécharger l’application Esri Support

Accéder aux options de téléchargement