<?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 Re: Get the layer ID within a map with Python in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/get-the-layer-id-within-a-map-with-python/m-p/1203751#M58753</link>
    <description>&lt;P&gt;Ah I see, yes you can get that:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;aprx = arcpy.mp.ArcGISProject("CURRENT")
m = aprx.listMaps()[0]
lyrs = m.listLayers()
for lyr in lyrs:
    print(lyr.getDefinition("V3").serviceLayerID)&lt;/LI-CODE&gt;&lt;P&gt;Have a look at &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm" target="_self"&gt;CIM access&lt;/A&gt;, it's quite useful, there is much more you can do with it besides this&lt;/P&gt;</description>
    <pubDate>Wed, 17 Aug 2022 14:56:58 GMT</pubDate>
    <dc:creator>HannesZiegler</dc:creator>
    <dc:date>2022-08-17T14:56:58Z</dc:date>
    <item>
      <title>Get the layer ID within a map with Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/get-the-layer-id-within-a-map-with-python/m-p/1191307#M57128</link>
      <description>&lt;P&gt;Hi!, I need to get the layer id within a map in ArcGIS Pro.&amp;nbsp; It need to be done with Python, but can't find the way to do it.&amp;nbsp; Any idea ? Impossible ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2022 17:39:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/get-the-layer-id-within-a-map-with-python/m-p/1191307#M57128</guid>
      <dc:creator>FrancisMoisan1</dc:creator>
      <dc:date>2022-07-11T17:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: Get the layer ID within a map with Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/get-the-layer-id-within-a-map-with-python/m-p/1202398#M58561</link>
      <description>&lt;P&gt;Take a look at arcpy.mp, I think this gets you what you want:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;aprx = arcpy.mp.ArcGISProject("CURRENT")
m = aprx.listMaps()[0]
lyrs = m.listLayers()
[(i, lyr.name) for i, lyr in enumerate(lyrs)]&lt;/LI-CODE&gt;&lt;P&gt;returns&lt;/P&gt;&lt;LI-CODE lang="python"&gt;[(0, 'TestLine'), (1, 'TestPoint'), (2, 'TestPoint_Raster'), (3, 'TestPoly'), (4, 'TestPoint'), (5, 'World Topographic Map'), (6, 'World Hillshade')]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2022 15:04:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/get-the-layer-id-within-a-map-with-python/m-p/1202398#M58561</guid>
      <dc:creator>HannesZiegler</dc:creator>
      <dc:date>2022-08-12T15:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: Get the layer ID within a map with Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/get-the-layer-id-within-a-map-with-python/m-p/1203300#M58691</link>
      <description>&lt;P&gt;Thanks for the info, but that "id" is just the order within the project.&amp;nbsp; I look to get the ID that is attached to the layer within the properties.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image_id_couche_layer_prop.png" style="width: 660px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/48731i2062D7E86B9AC347/image-size/large?v=v2&amp;amp;px=999" role="button" title="image_id_couche_layer_prop.png" alt="image_id_couche_layer_prop.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 14:57:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/get-the-layer-id-within-a-map-with-python/m-p/1203300#M58691</guid>
      <dc:creator>FrancisMoisan1</dc:creator>
      <dc:date>2022-08-16T14:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: Get the layer ID within a map with Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/get-the-layer-id-within-a-map-with-python/m-p/1203751#M58753</link>
      <description>&lt;P&gt;Ah I see, yes you can get that:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;aprx = arcpy.mp.ArcGISProject("CURRENT")
m = aprx.listMaps()[0]
lyrs = m.listLayers()
for lyr in lyrs:
    print(lyr.getDefinition("V3").serviceLayerID)&lt;/LI-CODE&gt;&lt;P&gt;Have a look at &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm" target="_self"&gt;CIM access&lt;/A&gt;, it's quite useful, there is much more you can do with it besides this&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2022 14:56:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/get-the-layer-id-within-a-map-with-python/m-p/1203751#M58753</guid>
      <dc:creator>HannesZiegler</dc:creator>
      <dc:date>2022-08-17T14:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Get the layer ID within a map with Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/get-the-layer-id-within-a-map-with-python/m-p/1204719#M58890</link>
      <description>&lt;P&gt;That was it!&amp;nbsp; thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2022 20:08:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/get-the-layer-id-within-a-map-with-python/m-p/1204719#M58890</guid>
      <dc:creator>FrancisMoisan1</dc:creator>
      <dc:date>2022-08-19T20:08:59Z</dc:date>
    </item>
  </channel>
</rss>

