<?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 Is Toggle Visibility accessible in arcpy ArcGIS Pro in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/is-toggle-visibility-accessible-in-arcpy-arcgis/m-p/1034493#M60316</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Is the below 'Toggle Visibility' accessible from arcpy for ArcGIS Pro?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="anamanvil_0-1615304249359.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/7947i55E2040D430DC1C7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="anamanvil_0-1615304249359.png" alt="anamanvil_0-1615304249359.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Would like to make some items within the legend invisible even though they are shown in the Map Frame without the need of modifying it manually in ArcGIS Pro.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Tue, 09 Mar 2021 15:48:02 GMT</pubDate>
    <dc:creator>anamanvil</dc:creator>
    <dc:date>2021-03-09T15:48:02Z</dc:date>
    <item>
      <title>Is Toggle Visibility accessible in arcpy ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/is-toggle-visibility-accessible-in-arcpy-arcgis/m-p/1034493#M60316</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Is the below 'Toggle Visibility' accessible from arcpy for ArcGIS Pro?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="anamanvil_0-1615304249359.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/7947i55E2040D430DC1C7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="anamanvil_0-1615304249359.png" alt="anamanvil_0-1615304249359.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Would like to make some items within the legend invisible even though they are shown in the Map Frame without the need of modifying it manually in ArcGIS Pro.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 15:48:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-toggle-visibility-accessible-in-arcpy-arcgis/m-p/1034493#M60316</guid>
      <dc:creator>anamanvil</dc:creator>
      <dc:date>2021-03-09T15:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: Is Toggle Visibility accessible in arcpy ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/is-toggle-visibility-accessible-in-arcpy-arcgis/m-p/1034496#M60317</link>
      <description>&lt;P&gt;A &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/legenditem-class.htm" target="_self"&gt;&lt;STRONG&gt;LegendItem&lt;/STRONG&gt;&lt;/A&gt; object has a read/write property &lt;STRONG&gt;visible&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Simply call "LegendItem.visible = true / false" to toggle the visibility.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 15:53:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-toggle-visibility-accessible-in-arcpy-arcgis/m-p/1034496#M60317</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-03-09T15:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: Is Toggle Visibility accessible in arcpy ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/is-toggle-visibility-accessible-in-arcpy-arcgis/m-p/1034515#M60318</link>
      <description>&lt;P&gt;Thanks for your reply&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure if I've explained myself properly.&lt;/P&gt;&lt;P&gt;I am not trying to make the legend invisible but the 'US_74762_SiteBoundary_ply' layer as per above screenshot so that is visible in the MapFrame but invisible in the Legend.&lt;/P&gt;&lt;P&gt;Could you please give me an example on how would you use the 'LegendItem.visible' to change its visibility?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 16:29:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-toggle-visibility-accessible-in-arcpy-arcgis/m-p/1034515#M60318</guid>
      <dc:creator>anamanvil</dc:creator>
      <dc:date>2021-03-09T16:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: Is Toggle Visibility accessible in arcpy ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/is-toggle-visibility-accessible-in-arcpy-arcgis/m-p/1034521#M60319</link>
      <description>&lt;P&gt;A Legend and a LegendItem are related, but not the same. We can get individual LegendItem objects from the Legend itself, using the &lt;STRONG&gt;items&lt;/STRONG&gt; property.&lt;/P&gt;&lt;P&gt;Here's an example:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;aprx = arcpy.mp.ArcGISProject('CURRENT')
lyt = aprx.listLayouts()[0]
the_legend = lyt.listElements('LEGEND_ELEMENT')[0]

lyr_list = ['the', 'layers', 'i', 'want']

for i in the_legend.items:
    if i.name in [l.name for l in lyr_list]:
        i.visible = True
    else:
        i.visible = False&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the example given, I'm also checking the name of each LegendItem against a defined list of layer names that I want.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 16:46:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-toggle-visibility-accessible-in-arcpy-arcgis/m-p/1034521#M60319</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-03-09T16:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: Is Toggle Visibility accessible in arcpy ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/is-toggle-visibility-accessible-in-arcpy-arcgis/m-p/1035374#M60334</link>
      <description>&lt;P&gt;Thank you so much&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;, it worked as magic!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Mar 2021 10:25:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-toggle-visibility-accessible-in-arcpy-arcgis/m-p/1035374#M60334</guid>
      <dc:creator>anamanvil</dc:creator>
      <dc:date>2021-03-11T10:25:01Z</dc:date>
    </item>
  </channel>
</rss>

