<?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: Is this script possible? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/is-this-script-possible/m-p/282991#M21860</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;It is not possible in arcpy.mapping. The Python mapping module is very very simple: you can only move about and make (some) adjustements to elements already in existance, and apply symbolization already stored in a layer file.&lt;BR /&gt;&lt;BR /&gt;To create layout elements, and do the other stuff you want, you will need to use ArcObjects. For that you need the (free) VBA capability for Arc10 (knowing that VBA is slated to be lost forever in 10.1) OR use VB.Net or C#.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Python works with Arcobjects as well. &lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://www.pierssen.com/arcgis/upload/misc/python_arcobjects.pdf"&gt;http://www.pierssen.com/arcgis/upload/misc/python_arcobjects.pdf&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Nov 2011 18:37:39 GMT</pubDate>
    <dc:creator>AnthonyTimpson2</dc:creator>
    <dc:date>2011-11-29T18:37:39Z</dc:date>
    <item>
      <title>Is this script possible?</title>
      <link>https://community.esri.com/t5/python-questions/is-this-script-possible/m-p/282989#M21858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So I'm planning to write a script but doubt on it's feasibility. The script would be applied to one shapefile consisting of city districts with various characteristics, for example crime rates and percentage of people above the age of 60. The goal of this script is to select one of these characteristics and create a thematic map out of it, so it would show the city districts with various colours representing the amount or the percentage of the selected feature. It would also have to add a scalebar, a legend and a north-arrow. Any of you know if this is possible? Any good starting points or tips I could use?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Nov 2011 09:44:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-this-script-possible/m-p/282989#M21858</guid>
      <dc:creator>eliaperi</dc:creator>
      <dc:date>2011-11-24T09:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Is this script possible?</title>
      <link>https://community.esri.com/t5/python-questions/is-this-script-possible/m-p/282990#M21859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It is not possible in arcpy.mapping. The Python mapping module is very very simple: you can only move about and make (some) adjustements to elements already in existance, and apply symbolization already stored in a layer file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To create layout elements, and do the other stuff you want, you will need to use ArcObjects. For that you need the (free) VBA capability for Arc10 (knowing that VBA is slated to be lost forever in 10.1) OR use VB.Net or C#.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Nov 2011 18:14:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-this-script-possible/m-p/282990#M21859</guid>
      <dc:creator>markdenil</dc:creator>
      <dc:date>2011-11-29T18:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: Is this script possible?</title>
      <link>https://community.esri.com/t5/python-questions/is-this-script-possible/m-p/282991#M21860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;It is not possible in arcpy.mapping. The Python mapping module is very very simple: you can only move about and make (some) adjustements to elements already in existance, and apply symbolization already stored in a layer file.&lt;BR /&gt;&lt;BR /&gt;To create layout elements, and do the other stuff you want, you will need to use ArcObjects. For that you need the (free) VBA capability for Arc10 (knowing that VBA is slated to be lost forever in 10.1) OR use VB.Net or C#.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Python works with Arcobjects as well. &lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://www.pierssen.com/arcgis/upload/misc/python_arcobjects.pdf"&gt;http://www.pierssen.com/arcgis/upload/misc/python_arcobjects.pdf&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Nov 2011 18:37:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-this-script-possible/m-p/282991#M21860</guid>
      <dc:creator>AnthonyTimpson2</dc:creator>
      <dc:date>2011-11-29T18:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: Is this script possible?</title>
      <link>https://community.esri.com/t5/python-questions/is-this-script-possible/m-p/282992#M21861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think the following script should get me well under way. The only exception is that I don't need to zoom in to a selected parcel, right? So the bold part of the script I can leave out of the script I think? Will the rest of the script be the same? I tested it but kept running into the following error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN style="color:&amp;quot;red&amp;quot;;"&gt;Traceback (most recent call last):&lt;BR /&gt; File "&amp;lt;interactive input&amp;gt;", line 2, in &amp;lt;module&amp;gt;&lt;BR /&gt;IndexError: list index out of range&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; arcpy.mapping opens up many possibilities for the types of map books you can create. For example, you can create a thematic atlas with multiple pages specifying a different theme on each page. The following example zooms to a selected parcel, toggles on different layer visibility and exports the layout for multiple themes in order to create a parcel report with a soil map, a flood map and a zoning map:&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;import arcpy, os&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt;#Specify output path and final output PDF&amp;nbsp; &lt;BR /&gt;outPath = r"C:\MyProject\output\\"&amp;nbsp; &lt;BR /&gt;finalPdf = arcpy.mapping.PDFDocumentCreate(outPath + "ParcelReport.pdf")&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt;#Specify the map document and the data frame&amp;nbsp; &lt;BR /&gt;mxd = arcpy.mapping.MapDocument(r"C:\MyProject\MyParcelMap.mxd")&amp;nbsp; &lt;BR /&gt;df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; &lt;STRONG&gt;#Select a parcel using the LocAddress attribute and zoom to selected&lt;BR /&gt;parcelLayer = arcpy.mapping.ListLayers(mxd, "Parcels", df)[0]&lt;BR /&gt;arcpy.SelectLayerByAttribute_management(parcelLayer, "NEW_SELECTION", "\"LocAddress\" = '519 Main St'")&lt;BR /&gt;df.zoomToSelectedFeatures()&lt;/STRONG&gt; &lt;BR /&gt; &lt;BR /&gt;#Turn on visibility for each theme and export the page&amp;nbsp; &lt;BR /&gt;lyrList = ["Soils", "Floodplains", "Zones"]&amp;nbsp; &lt;BR /&gt;for lyrName in lyrList:&amp;nbsp; &lt;BR /&gt; lyr = arcpy.mapping.ListLayers(mxd, lyrName, df)[0]&amp;nbsp; &lt;BR /&gt; lyr.visible = True&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; #Export each theme to a temporary PDF and append to the final PDF&amp;nbsp; &lt;BR /&gt; tmpPdf = outPath + lyrName + "_temp.pdf"&amp;nbsp; &lt;BR /&gt; if os.path.exists(tmpPdf):&amp;nbsp; &lt;BR /&gt; os.remove(tmpPdf)&amp;nbsp; &lt;BR /&gt; arcpy.mapping.ExportToPDF(mxd, tmpPdf)&amp;nbsp; &lt;BR /&gt; finalPdf.appendPages(tmpPdf)&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt; #Turn off layer visibility and clean up for next pass through the loop&amp;nbsp; &lt;BR /&gt; lyr.visible = False&amp;nbsp; &lt;BR /&gt; del lyr, tmpPdf&amp;nbsp; &lt;BR /&gt;del mxd, df, finalPdf&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt;from:&amp;nbsp;&amp;nbsp; &lt;A href="http://blogs.esri.com/dev/blogs/arcgisdesktop/archive/2010/12/14/combining-data-driven-pages-with-python-and-arcpy.mapping.aspx" rel="nofollow"&gt;http://blogs.esri.com/dev/blogs/arcgisdesktop/archive/2010/12/14/combining-data-driven-pages-with-python-and-arcpy.mapping.aspx&lt;/A&gt; &lt;BR /&gt; &lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2011 09:26:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-this-script-possible/m-p/282992#M21861</guid>
      <dc:creator>eliaperi</dc:creator>
      <dc:date>2011-12-01T09:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: Is this script possible?</title>
      <link>https://community.esri.com/t5/python-questions/is-this-script-possible/m-p/282993#M21862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've gotten this far and the result are two .pdf file. One is called perc_old_temp.pdf and is suprisingly showing the map for perc_nwa and the other .pdf file is called ParcelReport.pdf and is showing the map of perc_nwa as well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, two problems: one, the script didn't deliver a .pdf file showing both the layers (perc_old and perc_nwa). And two, it seems it is confusing the two layers since the temp.pdf file it created showed the wrong layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any clue on solving this? I don't get what I'm doing wrong, it shouldn't be too hard to create a thematic map booklet from a .mxd file with two layers right???&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&amp;gt;&amp;gt;&amp;gt; import arcpy, os&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; outPath=r"F:\projectx\\"&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; finalPdf=arcpy.mapping.PDFDocumentCreate(outPath + "ParcelReport.pdf")&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; mxd=arcpy.mapping.MapDocument(r"F:\projectx\testscript.mxd")&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; df=arcpy.mapping.ListDataFrames(mxd, "Layers")[0]&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; lyrList=["perc_nwa", "perc_old"]&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; for lyrName in lyrList:&lt;BR /&gt;...&amp;nbsp; lyr=arcpy.mapping.ListLayers(mxd, lyrName, df)[0]&lt;BR /&gt;...&amp;nbsp; lyr.visible=True&lt;BR /&gt;...&amp;nbsp; &lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; tmpPdf=outPath + lyrName + "_temp.pdf"&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; if os.path.exists(tmpPdf):&lt;BR /&gt;...&amp;nbsp; os.remove(tmpPdf)&lt;BR /&gt;...&amp;nbsp; &lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; arcpy.mapping.ExportToPDF(mxd, tmpPdf)&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; finalPdf.appendPages(tmpPdf)&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; lyr.visible=False&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; del lyr, tmpPdf&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; del mxd, df, finalPdf&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Dec 2011 08:25:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-this-script-possible/m-p/282993#M21862</guid>
      <dc:creator>eliaperi</dc:creator>
      <dc:date>2011-12-05T08:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: Is this script possible?</title>
      <link>https://community.esri.com/t5/python-questions/is-this-script-possible/m-p/282994#M21863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Found another sample script but can't get it to work either. Maybe the problem lies in the way my data is structured? I'm testing it on a .mxd file with two layers. My goal is to create a script that creates a thematic map booklet. So in this case it would create two pages, one showing the perc_old layer and one showing the perc_nwa layer. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have at least identified one problem. The data driven pages functionality won't let me switch between layers, it will only let me switch between the several citydistricts the shapefile is made of. Anyone know a solution for this or a solution to the overall problem of writing a script that makes a thematic map booklet?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;A href="&amp;lt;/span&amp;gt;&amp;lt;a" target="_blank"&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;IMG src="http://img580.imageshack.us/img580/9615/helpt.th.jpg" /&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;Uploaded with [URL=&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://imageshack.us]ImageShack.us[/URL" rel="nofollow" target="_blank"&gt;http://imageshack.us]ImageShack.us[/URL&lt;/A&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;#This script will take an mxd and export a pdf mapbook for&lt;BR /&gt;#each thematic layer in the map. The subtitle of the map &lt;BR /&gt;#will be dynamically changed with each mapbook.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;#Import the arcpy package&lt;BR /&gt;import arcpy&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;#Assign the Western States Mapping Document to variable mxd &lt;BR /&gt;mxd = arcpy.mapping.MapDocument(r"C:\ArcPy_Training\Map_Documents\Western_States.mxd")&lt;BR /&gt;&lt;BR /&gt;#Create a data driven pages object using "mxd" and assign it to variable "ddp"&lt;BR /&gt;ddp = mxd.dataDrivenPages&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;#Create a list of all text elements in the map layout&lt;BR /&gt;textlist = arcpy.mapping.ListLayoutElements(mxd,"TEXT_ELEMENT")&lt;BR /&gt;&lt;BR /&gt;#Cycle through the text elements&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;for txt in textlist:&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #When you find one whose text says "MAP SUBTITLE"...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if txt.text == r"MAP SUBTITLE":&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #....Assign it to variable "subtitle"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; subtitle = txt&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;#Create a list of the layers in the map document&lt;BR /&gt;layerlist = arcpy.mapping.ListLayers(mxd)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;#Cycle through each layer&lt;BR /&gt;for lyr in layerlist:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #If the layer is NOT visible...&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if lyr.visible == False:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #...Turn the layer on&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lyr.visible = True&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Change the Subtitle text element to match the layer's name&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; subtitle.text = lyr.name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Create a string showing the path of the pdf that will be written out&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pdfpath = "C:\\arcpy_training\\pdfs\\" + lyr.name + r" mapbook.pdf" &lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Print that we are exporting a mapbook&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Exporting " + pdfpath + "....."&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Export the mapbook to pdf&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd.dataDrivenPages.exportToPDF(pdfpath,"ALL")&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Turn the layer off again&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lyr.visible = False&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;#Delete variables to clean up memory usage&lt;BR /&gt;del ddp, mxd&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;print "Done!" &lt;BR /&gt;&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Dec 2011 10:00:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-this-script-possible/m-p/282994#M21863</guid>
      <dc:creator>eliaperi</dc:creator>
      <dc:date>2011-12-05T10:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: Is this script possible?</title>
      <link>https://community.esri.com/t5/python-questions/is-this-script-possible/m-p/282995#M21864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;have you tried this without data driven pages enabled?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i´m using practically the same script (the one from the esri blog) and it works fine here (as long as there are no layers with the same name within different grouplayers...if there are, it gets complicated).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Dec 2011 14:17:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-this-script-possible/m-p/282995#M21864</guid>
      <dc:creator>RaphaelR</dc:creator>
      <dc:date>2011-12-05T14:17:26Z</dc:date>
    </item>
  </channel>
</rss>

