private void LayerName() { IMxDocument pMxDoc = default(IMxDocument); IMap pMap = default(IMap); IFeatureLayer pFeatureLayer = default(IFeatureLayer); //Assign the mxDocument here..however you retrieved it...I usually use the snippet for retrieving the MxDoc from ArcMap pMxDoc = ThisDocument; pMap = pMxDoc.FocusMap; // Loop through each layer, and report its name. for (i = 1; i <= pMap.LayerCount; i++) { pFeatureLayer = pMap.Layer(i); Interaction.MsgBox("The name of layer is: " + pFeatureLayer.name); } }
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.