<?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: Exporting to PDF: Multiple feature classes with common values as separate PDFs in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/exporting-to-pdf-multiple-feature-classes-with/m-p/235203#M18252</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/blogs/dan_patterson/2016/08/14/script-formatting"&gt;/blogs/dan_patterson/2016/08/14/script-formatting&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;would provide line numbers and enable easier syntax checking&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 23 May 2020 17:47:52 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2020-05-23T17:47:52Z</dc:date>
    <item>
      <title>Exporting to PDF: Multiple feature classes with common values as separate PDFs</title>
      <link>https://community.esri.com/t5/python-questions/exporting-to-pdf-multiple-feature-classes-with/m-p/235202#M18251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #242729; background-color: #ffffff; border: 0px; margin: 0px 0px 1em;"&gt;Hi, I have a list of feature classes used as facilities in network analysis to find out walking and cycling time. So for example, schools, hospitals, pharmacies etc. I therefore want to export a PDF with the schools plus the study area, hospitals plus the study area etc. as separate PDFs for each facility and associated analysis:&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Get the MXD&lt;BR /&gt;m = arcpy.mapping.MapDocument("CURRENT")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Get the data frame&lt;BR /&gt;d = arcpy.mapping.ListDataFrames(m, "")[0]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Get the layer list in the data frame&lt;BR /&gt;ls = arcpy.mapping.ListLayers(m, "", d)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Set layer dictionary&lt;BR /&gt;layer_dict = {"layer_name" : ["turn_on_lyr_1", "turn_on_lyr_2"]}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Get the folder you want to save your PDF files into&lt;BR /&gt;PDFPath = r'C:\Users\Charlie-x.Churchill\Documents\PyTrial'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Create empty list&lt;BR /&gt;layerList = []&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#add layer names to the list&lt;BR /&gt;for l in ls:&lt;BR /&gt; layerList.append(l.name)&lt;/P&gt;&lt;P&gt;for lyr in arcpy.mapping.ListLayers(m, '',d):&lt;BR /&gt; for lname in layerList:&lt;BR /&gt; if lname in layer_dict:&lt;BR /&gt; for lyr in layer_dict[layer_name]: lyr.visible = True&lt;BR /&gt; lyr.visible = True&lt;BR /&gt; arcpy.RefreshActiveView()&lt;BR /&gt; arcpy.mapping.ExportToPDF(m, PDFPath + "\\" + lyr.name + ".PDF")&lt;BR /&gt; lyr.visible = False&lt;/P&gt;&lt;P&gt;del m&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 May 2020 16:07:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/exporting-to-pdf-multiple-feature-classes-with/m-p/235202#M18251</guid>
      <dc:creator>CChurchill</dc:creator>
      <dc:date>2020-05-23T16:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting to PDF: Multiple feature classes with common values as separate PDFs</title>
      <link>https://community.esri.com/t5/python-questions/exporting-to-pdf-multiple-feature-classes-with/m-p/235203#M18252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/blogs/dan_patterson/2016/08/14/script-formatting"&gt;/blogs/dan_patterson/2016/08/14/script-formatting&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;would provide line numbers and enable easier syntax checking&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 May 2020 17:47:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/exporting-to-pdf-multiple-feature-classes-with/m-p/235203#M18252</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-05-23T17:47:52Z</dc:date>
    </item>
  </channel>
</rss>

