<?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 to get  current legend column count using arcpy? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-to-get-current-legend-column-count-using/m-p/532472#M41693</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I'm understanding your question you are looking to get a total count of layers represented in the legend? If so then you could use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;mxd = arcpy.mapping.MapDocument("Current")
df = mxd.activeDataFrame
legendCount = len(arcpy.mapping.ListLayoutElements(mxd, "LEGEND_ELEMENT", "Legend")[0].items)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 23:09:37 GMT</pubDate>
    <dc:creator>LukeSturtevant</dc:creator>
    <dc:date>2021-12-11T23:09:37Z</dc:date>
    <item>
      <title>How to to get  current legend column count using arcpy?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-to-get-current-legend-column-count-using/m-p/532471#M41692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Is there anyway to get current legend column count using arcpy? like legegend.columncount&amp;nbsp;&amp;nbsp; OR legend.getcolumncount ? I couldn't see these properties in documentation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to increment&amp;nbsp; column count conditionally using&amp;nbsp; legend.adjustColumnCount &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Nov 2015 20:44:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-to-get-current-legend-column-count-using/m-p/532471#M41692</guid>
      <dc:creator>SurendranNeelakantan</dc:creator>
      <dc:date>2015-11-03T20:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to to get  current legend column count using arcpy?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-to-get-current-legend-column-count-using/m-p/532472#M41693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I'm understanding your question you are looking to get a total count of layers represented in the legend? If so then you could use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;mxd = arcpy.mapping.MapDocument("Current")
df = mxd.activeDataFrame
legendCount = len(arcpy.mapping.ListLayoutElements(mxd, "LEGEND_ELEMENT", "Legend")[0].items)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:09:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-to-get-current-legend-column-count-using/m-p/532472#M41693</guid>
      <dc:creator>LukeSturtevant</dc:creator>
      <dc:date>2021-12-11T23:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to to get  current legend column count using arcpy?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-to-get-current-legend-column-count-using/m-p/532473#M41694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I&amp;nbsp;&amp;nbsp; want to know how many columns in the&amp;nbsp; legend element.&amp;nbsp; Not how many items in the legend.&lt;/P&gt;&lt;P&gt;I hope It is clear now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Nov 2015 21:12:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-to-get-current-legend-column-count-using/m-p/532473#M41694</guid>
      <dc:creator>SurendranNeelakantan</dc:creator>
      <dc:date>2015-11-03T21:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to to get  current legend column count using arcpy?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-to-get-current-legend-column-count-using/m-p/532474#M41695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you explain why incrementing &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;adjustColumnCount doesn't work? It seems like you should be able to:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;1.) make any changes to your legend&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;2.) record the current (original) legend elementWidth&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;3.) increment the number of columns using adjustColumnCount&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;4.) when the incremented legend elementWidth = the original legend elementWidth, you know the number of columns&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Nov 2015 22:15:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-to-get-current-legend-column-count-using/m-p/532474#M41695</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2015-11-03T22:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to to get  current legend column count using arcpy?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-to-get-current-legend-column-count-using/m-p/532475#M41696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The default for column count is 1 if your trying to increment a legend simply start or reset the legend to 1&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-mapping/legendelement-class.htm" title="http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-mapping/legendelement-class.htm"&gt;LegendElement—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Nov 2015 14:55:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-to-get-current-legend-column-count-using/m-p/532475#M41696</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2015-11-30T14:55:50Z</dc:date>
    </item>
  </channel>
</rss>

