Private Function ReturnFLayer(ByVal inName As String) As IFeatureClass Try Dim pDoc As ESRI.ArcGIS.ArcMapUI.IMxDocument Dim pMap As ESRI.ArcGIS.Carto.IMap Dim pLayer As ESRI.ArcGIS.Carto.IFeatureLayer Dim dataset As IDataset Dim i As Short 'Layer name to find Dim sLayerName As String = inName Dim Name As String pDoc = m_application.Document pMap = pDoc.FocusMap For i = 0 To pMap.LayerCount - 1 pLayer = pMap.Layer(i) dataset = pLayer.FeatureClass Name = dataset.Name If Name = sLayerName Then pLayer = pMap.Layer(i) Exit For End If Next Return pLayer.FeatureClass Catch ex As Exception MsgBox(ex.ToString) Return Nothing End Try End Function
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.