<?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 Legend is not displaying all active features/layers in ArcGIS Pro using ArcPy? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/legend-is-not-displaying-all-active-features/m-p/248813#M19216</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I created a script tool that positions the north arrow, legend, scale bar, and title in a layout; and then zooms to a bookmark and exports the layout as a PDF. But when I go and look at the PDF, the legend does not display the graduated color symbology from the results of a summarize with-in. However, when I go and look at the layout in ArcGIS Pro the graduated color symbology is displayed in the layout legend.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the custom script tool I'm using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#input layer&lt;BR /&gt;lyr = arcpy.GetParameterAsText(0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# input name of layout&lt;BR /&gt;p = arcpy.mp.ArcGISProject("CURRENT")&lt;BR /&gt;lyt = p.listLayouts("Layout_King")[0]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Reposition the scale bar&lt;BR /&gt;scaleBar = lyt.listElements("MAPSURROUND_ELEMENT", "Scale Bar")[0]&lt;BR /&gt;mf = scaleBar.mapFrame&lt;BR /&gt;scaleBar.elementPositionX = mf.elementPositionX + 0.0&lt;BR /&gt;scaleBar.elementPositionY = mf.elementPositionY - 0.5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Reposition the north arrow&lt;BR /&gt;northArrow = lyt.listElements("MAPSURROUND_ELEMENT", "North Arrow")[0]&lt;BR /&gt;mf = northArrow.mapFrame&lt;BR /&gt;northArrow.elementPositionX = mf.elementPositionX + 8.8&lt;BR /&gt;northArrow.elementPositionY = mf.elementPositionY + 0.7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Align the title with the center of the map frame&lt;BR /&gt;title = lyt.listElements("TEXT_ELEMENT", "Name of Map Text")[0]&lt;BR /&gt;mf = lyt.listElements('MAPFRAME_ELEMENT',"Map Frame")[0]&lt;BR /&gt;title.elementPositionX = mf.elementPositionX + (mf.elementWidth / 3.7)&lt;BR /&gt;title.elementPositionY = mf.elementPositionY + (mf.elementHeight / 0.98)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Reposition the Legend and fix legend title&lt;BR /&gt;legend = lyt.listElements("LEGEND_ELEMENT", "Legend")[0]&lt;BR /&gt;legend.title = "Legend"&lt;BR /&gt;legend.elementPositionX = mf.elementPositionX + 4.8&lt;BR /&gt;legend.elementPositionY = mf.elementPositionY + 6.15&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# setting layout to bookmark&lt;BR /&gt;aprx = arcpy.mp.ArcGISProject("Current")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# add name of layout&lt;BR /&gt;lyt = aprx.listLayouts("Layout_King")[0]&lt;BR /&gt;mf = lyt.listElements("MAPFRAME_ELEMENT")[0]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# add name of bookmark&lt;BR /&gt;bkmks = mf.map.listBookmarks()&lt;BR /&gt;bkmks.sort(key=lambda x: x.name, reverse=True)&lt;BR /&gt;for bkmk in bkmks:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mf.zoomToBookmark(bkmk)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;lyt.exportToPDF(r"C:\arcGIS_Shared\Exports" + "\\" + bkmk.name + ".pdf")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there something I'm doing wrong, or missing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also I'm using this custom script tool ModelBuilder&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Nov 2017 21:07:26 GMT</pubDate>
    <dc:creator>Business_IntelligenceSoftware</dc:creator>
    <dc:date>2017-11-28T21:07:26Z</dc:date>
    <item>
      <title>Legend is not displaying all active features/layers in ArcGIS Pro using ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/legend-is-not-displaying-all-active-features/m-p/248813#M19216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I created a script tool that positions the north arrow, legend, scale bar, and title in a layout; and then zooms to a bookmark and exports the layout as a PDF. But when I go and look at the PDF, the legend does not display the graduated color symbology from the results of a summarize with-in. However, when I go and look at the layout in ArcGIS Pro the graduated color symbology is displayed in the layout legend.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the custom script tool I'm using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#input layer&lt;BR /&gt;lyr = arcpy.GetParameterAsText(0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# input name of layout&lt;BR /&gt;p = arcpy.mp.ArcGISProject("CURRENT")&lt;BR /&gt;lyt = p.listLayouts("Layout_King")[0]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Reposition the scale bar&lt;BR /&gt;scaleBar = lyt.listElements("MAPSURROUND_ELEMENT", "Scale Bar")[0]&lt;BR /&gt;mf = scaleBar.mapFrame&lt;BR /&gt;scaleBar.elementPositionX = mf.elementPositionX + 0.0&lt;BR /&gt;scaleBar.elementPositionY = mf.elementPositionY - 0.5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Reposition the north arrow&lt;BR /&gt;northArrow = lyt.listElements("MAPSURROUND_ELEMENT", "North Arrow")[0]&lt;BR /&gt;mf = northArrow.mapFrame&lt;BR /&gt;northArrow.elementPositionX = mf.elementPositionX + 8.8&lt;BR /&gt;northArrow.elementPositionY = mf.elementPositionY + 0.7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Align the title with the center of the map frame&lt;BR /&gt;title = lyt.listElements("TEXT_ELEMENT", "Name of Map Text")[0]&lt;BR /&gt;mf = lyt.listElements('MAPFRAME_ELEMENT',"Map Frame")[0]&lt;BR /&gt;title.elementPositionX = mf.elementPositionX + (mf.elementWidth / 3.7)&lt;BR /&gt;title.elementPositionY = mf.elementPositionY + (mf.elementHeight / 0.98)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Reposition the Legend and fix legend title&lt;BR /&gt;legend = lyt.listElements("LEGEND_ELEMENT", "Legend")[0]&lt;BR /&gt;legend.title = "Legend"&lt;BR /&gt;legend.elementPositionX = mf.elementPositionX + 4.8&lt;BR /&gt;legend.elementPositionY = mf.elementPositionY + 6.15&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# setting layout to bookmark&lt;BR /&gt;aprx = arcpy.mp.ArcGISProject("Current")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# add name of layout&lt;BR /&gt;lyt = aprx.listLayouts("Layout_King")[0]&lt;BR /&gt;mf = lyt.listElements("MAPFRAME_ELEMENT")[0]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# add name of bookmark&lt;BR /&gt;bkmks = mf.map.listBookmarks()&lt;BR /&gt;bkmks.sort(key=lambda x: x.name, reverse=True)&lt;BR /&gt;for bkmk in bkmks:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mf.zoomToBookmark(bkmk)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;lyt.exportToPDF(r"C:\arcGIS_Shared\Exports" + "\\" + bkmk.name + ".pdf")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there something I'm doing wrong, or missing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also I'm using this custom script tool ModelBuilder&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Nov 2017 21:07:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/legend-is-not-displaying-all-active-features/m-p/248813#M19216</guid>
      <dc:creator>Business_IntelligenceSoftware</dc:creator>
      <dc:date>2017-11-28T21:07:26Z</dc:date>
    </item>
  </channel>
</rss>

