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); } }
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.