laptop and a wrench

Bug

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

Zuletzt veröffentlicht: August 19, 2020 ArcGIS for Desktop
Bug-ID-Nummer NIM070232
EingereichtJuly 6, 2011
Zuletzt geändertJune 5, 2024
Gilt fürArcGIS for Desktop
Gefunden in Version10.0
ProgrammspracheC#
StatusWill Not Be Addressed

Zusätzliche Informationen

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.

Workaround

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

Schritte zur Reproduzierung

Bug-ID: NIM070232

Software:

  • ArcGIS for Desktop

Benachrichtigung erhalten, wenn sich der Status eines Bugs ändert

Esri Support App herunterladen

Weitere Informationen zu diesem Thema erkunden

Unterstützung durch ArcGIS-Experten anfordern

An den technischen Support wenden

Esri Support App herunterladen

Zu Download-Optionen wechseln