<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Refering the layers by name in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/refering-the-layers-by-name/m-p/586056#M15858</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In my TOC, i have four feature classes with the following names "watershed", "temperature", "watchtowers" and "precipitation". Here, we want the "watershed"&amp;nbsp; which is a polygon feature class and "watchtowers" which is a point feature class to be used for the analysis.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you please tell me, how can i programmatically refer the above two layers by "name", so that i can use the "watershed" and "watchtower" layer for the analysis (using C#)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 Nov 2010 01:59:30 GMT</pubDate>
    <dc:creator>shravanshravan</dc:creator>
    <dc:date>2010-11-26T01:59:30Z</dc:date>
    <item>
      <title>Refering the layers by name</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/refering-the-layers-by-name/m-p/586056#M15858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In my TOC, i have four feature classes with the following names "watershed", "temperature", "watchtowers" and "precipitation". Here, we want the "watershed"&amp;nbsp; which is a polygon feature class and "watchtowers" which is a point feature class to be used for the analysis.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you please tell me, how can i programmatically refer the above two layers by "name", so that i can use the "watershed" and "watchtower" layer for the analysis (using C#)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Nov 2010 01:59:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/refering-the-layers-by-name/m-p/586056#M15858</guid>
      <dc:creator>shravanshravan</dc:creator>
      <dc:date>2010-11-26T01:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: Refering the layers by name</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/refering-the-layers-by-name/m-p/586057#M15859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You have to loop through the table of contents.&amp;nbsp; You do this with a For loop:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;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 &amp;lt;= pMap.LayerCount; i++) {
&amp;nbsp; pFeatureLayer = pMap.Layer(i);
&amp;nbsp; Interaction.MsgBox("The name of layer is: " + pFeatureLayer.name);
 }
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SO you match the name you want with teh one that is returned in the loop instance and go from there..hope this helps.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:12:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/refering-the-layers-by-name/m-p/586057#M15859</guid>
      <dc:creator>RuchiraWelikala</dc:creator>
      <dc:date>2021-12-12T01:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: Refering the layers by name</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/refering-the-layers-by-name/m-p/586058#M15860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks a lot for helping me.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Nov 2010 14:10:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/refering-the-layers-by-name/m-p/586058#M15860</guid>
      <dc:creator>shravanshravan</dc:creator>
      <dc:date>2010-11-26T14:10:45Z</dc:date>
    </item>
  </channel>
</rss>

