<?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: Printing Template - Dynamic Legend in Mapping Questions</title>
    <link>https://community.esri.com/t5/mapping-questions/printing-template-dynamic-legend/m-p/630989#M6830</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: gabrielnespoli&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Help me, please!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Jun 2013 18:15:09 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2013-06-27T18:15:09Z</dc:date>
    <item>
      <title>Printing Template - Dynamic Legend</title>
      <link>https://community.esri.com/t5/mapping-questions/printing-template-dynamic-legend/m-p/630988#M6829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: gabrielnespoli&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am not quite sure if this is the right sub-forum. Sorry if it is not.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Lets go to the point..I know how to define a dynamic legend to a map, there isn't problem with this and it works fine:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]25241[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But, the problem happens when I try to publish a printing template. In templates, there isn't layer in the .mxd, so when I try to check "&lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;Only show classes that are visible in current map extent&lt;/SPAN&gt;&lt;SPAN&gt;, this checkbox isn't editable, because in templates the map doesn't have any layer:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]25247[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The result of not setting the legend dynamically is this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]25249[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As you can see, the legends of all layers are displayed, even the ones that are not in the map extent.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, if anyone knows how can I set dynamic legend to printing templates, help me please!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 17:40:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/printing-template-dynamic-legend/m-p/630988#M6829</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-06-13T17:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: Printing Template - Dynamic Legend</title>
      <link>https://community.esri.com/t5/mapping-questions/printing-template-dynamic-legend/m-p/630989#M6830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: gabrielnespoli&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Help me, please!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2013 18:15:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/printing-template-dynamic-legend/m-p/630989#M6830</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-06-27T18:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: Printing Template - Dynamic Legend</title>
      <link>https://community.esri.com/t5/mapping-questions/printing-template-dynamic-legend/m-p/630990#M6831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Gabriel,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the problem is that the proprerty "visible in current extent" is a layer proprerty, not a legend proprerty. So, in yuor geoprocessing model, after you load layer in MXD document and before export map as PDF, you have to loop throught every item in legend and set property "use_visible_extent" to TRUE, with a code like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;for lyr in legend.listLegendItemLayers():
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; legend.updateItem(lyr, use_visible_extent = True)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Stefano&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:50:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/printing-template-dynamic-legend/m-p/630990#M6831</guid>
      <dc:creator>StefanoMauri</dc:creator>
      <dc:date>2021-12-12T02:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: Printing Template - Dynamic Legend</title>
      <link>https://community.esri.com/t5/mapping-questions/printing-template-dynamic-legend/m-p/630991#M6832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: fandre12345&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Stefano,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your answer, but i need to do this in Esri Toolbox:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]26929[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If it were our toolbox could do as he said. Any other suggestion?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 17:03:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/printing-template-dynamic-legend/m-p/630991#M6832</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-08-23T17:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Printing Template - Dynamic Legend</title>
      <link>https://community.esri.com/t5/mapping-questions/printing-template-dynamic-legend/m-p/630992#M6833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have the same problem,&amp;nbsp; who can help me?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Nov 2013 17:37:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/printing-template-dynamic-legend/m-p/630992#M6833</guid>
      <dc:creator>ChristophSinn</dc:creator>
      <dc:date>2013-11-22T17:37:24Z</dc:date>
    </item>
  </channel>
</rss>

