<?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 turn off headings from legend using python? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-turn-off-headings-from-legend-using-python/m-p/1059683#M41125</link>
    <description>&lt;P&gt;Thanks a lot, Jeff!&lt;/P&gt;</description>
    <pubDate>Wed, 19 May 2021 20:47:31 GMT</pubDate>
    <dc:creator>WesleyCosta</dc:creator>
    <dc:date>2021-05-19T20:47:31Z</dc:date>
    <item>
      <title>How to turn off headings from legend using python?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-turn-off-headings-from-legend-using-python/m-p/1059604#M41109</link>
      <description>&lt;P&gt;Well, I'm using ArcGIS Pro 2.7 and I want to turn off the 'Headings' from Legend Item. I know how to do it manually, but I need to make a script. Thanks by attention!&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 19:10:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-turn-off-headings-from-legend-using-python/m-p/1059604#M41109</guid>
      <dc:creator>WesleyCosta</dc:creator>
      <dc:date>2021-05-19T19:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to turn off headings from legend using python?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-turn-off-headings-from-legend-using-python/m-p/1059618#M41112</link>
      <description>&lt;P&gt;Did you look at the CIM class?&amp;nbsp; For example&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/legendelement-class.htm" target="_blank"&gt;LegendElement—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/legenditem-class.htm" target="_blank"&gt;LegendItem—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;plus others.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You didn't indicate what you had looked at.&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 19:29:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-turn-off-headings-from-legend-using-python/m-p/1059618#M41112</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-05-19T19:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to turn off headings from legend using python?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-turn-off-headings-from-legend-using-python/m-p/1059627#M41115</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sem título.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/13677i71E7CD7F1986CB73/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sem título.png" alt="Sem título.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I've ever seen the Documentation above.&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 19:40:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-turn-off-headings-from-legend-using-python/m-p/1059627#M41115</guid>
      <dc:creator>WesleyCosta</dc:creator>
      <dc:date>2021-05-19T19:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to turn off headings from legend using python?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-turn-off-headings-from-legend-using-python/m-p/1059632#M41117</link>
      <description>&lt;P&gt;If it isn't on the CIM stuff, it may not be available yet.&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 19:44:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-turn-off-headings-from-legend-using-python/m-p/1059632#M41117</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-05-19T19:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to turn off headings from legend using python?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-turn-off-headings-from-legend-using-python/m-p/1059668#M41122</link>
      <description>&lt;P&gt;Hello Wesley,&lt;/P&gt;&lt;P&gt;This can be accomplished using Python CIM Access:&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Here is a snippet of code that does what you need.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;p = arcpy.mp.ArcGISProject('current')
lyt = p.listLayouts()[0]
#Get the layout's CIM definition
lyt_cim = lyt.getDefinition('V2')

#Iterate though all layout elements to find the Legend element
for elm in lyt_cim.elements:
  if elm.name == "Legend":
    #Legend item changes
    for itm in elm.items:
      if itm.name == "GreatLakes":
        #Update visibility
          itm.showLayerName = True
          itm.showHeading = False   

#Set the CIM changes back to the layout
lyt.setDefinition(lyt_cim)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are many Python CIM Access samples located here (including legenditem changes):&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.arcgis.com/home/item.html?id=8772f61319584882bb697ba003030636" target="_blank"&gt;https://www.arcgis.com/home/item.html?id=8772f61319584882bb697ba003030636&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jeff - arcpy.mp and Layout teams&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 20:25:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-turn-off-headings-from-legend-using-python/m-p/1059668#M41122</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2021-05-19T20:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to turn off headings from legend using python?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-turn-off-headings-from-legend-using-python/m-p/1059683#M41125</link>
      <description>&lt;P&gt;Thanks a lot, Jeff!&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 20:47:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-turn-off-headings-from-legend-using-python/m-p/1059683#M41125</guid>
      <dc:creator>WesleyCosta</dc:creator>
      <dc:date>2021-05-19T20:47:31Z</dc:date>
    </item>
  </channel>
</rss>

