<?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: how to get the hightlighted layers in TOC ? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-get-the-hightlighted-layers-in-toc/m-p/1347144#M69189</link>
    <description>&lt;P&gt;You could check them (uncheck the others you don't want) and then use the lyr.visible property to separate them.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;aprx = arcpy.mp.ArcGISProject(r'C:\.aprx')
m = aprx.listMaps("Map")[0]
checked_layers = [lyr for lyr in m.listLayers() if lyr.visible]

#for lyr in m.listLayers():
#    if lyr.visible:
#        arcpy.AddMessage(f"{lyr.name} is selected.")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Nov 2023 14:21:05 GMT</pubDate>
    <dc:creator>StaticK</dc:creator>
    <dc:date>2023-11-08T14:21:05Z</dc:date>
    <item>
      <title>how to get the hightlighted layers in TOC ?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-get-the-hightlighted-layers-in-toc/m-p/1347025#M69187</link>
      <description>&lt;P&gt;How to get&amp;nbsp; the selected layers in the TOC (i.e. clicked via the mouse and is now highlighted)&amp;nbsp; with arcpy? thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 05:47:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-get-the-hightlighted-layers-in-toc/m-p/1347025#M69187</guid>
      <dc:creator>pyfans</dc:creator>
      <dc:date>2023-11-08T05:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the hightlighted layers in TOC ?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-get-the-hightlighted-layers-in-toc/m-p/1347066#M69188</link>
      <description>&lt;P&gt;there is no arcpy functionality to do this&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 10:21:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-get-the-hightlighted-layers-in-toc/m-p/1347066#M69188</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-11-08T10:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the hightlighted layers in TOC ?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-get-the-hightlighted-layers-in-toc/m-p/1347144#M69189</link>
      <description>&lt;P&gt;You could check them (uncheck the others you don't want) and then use the lyr.visible property to separate them.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;aprx = arcpy.mp.ArcGISProject(r'C:\.aprx')
m = aprx.listMaps("Map")[0]
checked_layers = [lyr for lyr in m.listLayers() if lyr.visible]

#for lyr in m.listLayers():
#    if lyr.visible:
#        arcpy.AddMessage(f"{lyr.name} is selected.")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 14:21:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-get-the-hightlighted-layers-in-toc/m-p/1347144#M69189</guid>
      <dc:creator>StaticK</dc:creator>
      <dc:date>2023-11-08T14:21:05Z</dc:date>
    </item>
  </channel>
</rss>

