<?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: Turn On/Off Data Driven Pages in Script in Mapping Questions</title>
    <link>https://community.esri.com/t5/mapping-questions/turn-on-off-data-driven-pages-in-script/m-p/675155#M7261</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You don't necessarily need DDP to do that. Your algorithm would be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- use a search cursor to loop through the features you want to print&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- use the methods and properties of the dataframe class to go to each area you want to print&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- use the print/export functions&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code would look something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;rows = arcpy.SearchCursor(mLayer, "WoodyAreasClip.ProtectedStatus = " + repr(theStatus))
for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; theOID = row.getValue(r"WoodyAreasClip.OBJECTID")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByAttribute_management(mLayer, "NEW_SELECTION", "WoodyAreasClip.OBJECTID = " + repr(theOID))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DF.zoomToSelectedFeatures()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.RefreshActiveView()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # print it (or export it)&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.ExportToJPEG(MXD, r"C:\temp" + "\\" + repr(theOID) + ".jpg")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You are correct - the code samples assume you have DDP turned on. There isn't a way to turn DDP on/off in Python. The following help topics touch on the differences between creating map books using python (like the example above) versus creating map books using DDP.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/DataDrivenPages/00s300000030000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/DataDrivenPages/00s300000030000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s90000002s000000.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s90000002s000000.htm&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 04:28:25 GMT</pubDate>
    <dc:creator>JeffMoulds</dc:creator>
    <dc:date>2021-12-12T04:28:25Z</dc:date>
    <item>
      <title>Turn On/Off Data Driven Pages in Script</title>
      <link>https://community.esri.com/t5/mapping-questions/turn-on-off-data-driven-pages-in-script/m-p/675154#M7260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi there,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm writing a script to select individual features in a user-defined area, and I need to use data driven pages to print each one with clipping. However I cannot find ANYWHERE the ability to turn on the datadriven pages. Surely there must be a way?&amp;nbsp; Every item I find when I google seems to assume datadrivenpages is already switched on when a script runs. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can someone advise?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Oct 2010 10:12:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/turn-on-off-data-driven-pages-in-script/m-p/675154#M7260</guid>
      <dc:creator>AndyBell</dc:creator>
      <dc:date>2010-10-08T10:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: Turn On/Off Data Driven Pages in Script</title>
      <link>https://community.esri.com/t5/mapping-questions/turn-on-off-data-driven-pages-in-script/m-p/675155#M7261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You don't necessarily need DDP to do that. Your algorithm would be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- use a search cursor to loop through the features you want to print&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- use the methods and properties of the dataframe class to go to each area you want to print&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- use the print/export functions&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code would look something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;rows = arcpy.SearchCursor(mLayer, "WoodyAreasClip.ProtectedStatus = " + repr(theStatus))
for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; theOID = row.getValue(r"WoodyAreasClip.OBJECTID")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByAttribute_management(mLayer, "NEW_SELECTION", "WoodyAreasClip.OBJECTID = " + repr(theOID))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DF.zoomToSelectedFeatures()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.RefreshActiveView()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # print it (or export it)&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.ExportToJPEG(MXD, r"C:\temp" + "\\" + repr(theOID) + ".jpg")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You are correct - the code samples assume you have DDP turned on. There isn't a way to turn DDP on/off in Python. The following help topics touch on the differences between creating map books using python (like the example above) versus creating map books using DDP.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/DataDrivenPages/00s300000030000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/DataDrivenPages/00s300000030000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s90000002s000000.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s90000002s000000.htm&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:28:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/turn-on-off-data-driven-pages-in-script/m-p/675155#M7261</guid>
      <dc:creator>JeffMoulds</dc:creator>
      <dc:date>2021-12-12T04:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: Turn On/Off Data Driven Pages in Script</title>
      <link>https://community.esri.com/t5/mapping-questions/turn-on-off-data-driven-pages-in-script/m-p/675156#M7262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dear Jeff,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;DDP is working with only one DF at atime. but we need to keep multiple dataframe in single page, so let me know what is the best approach to achive&amp;nbsp; this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Reg,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;AD&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jul 2011 05:51:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/turn-on-off-data-driven-pages-in-script/m-p/675156#M7262</guid>
      <dc:creator>AdhimoolamD</dc:creator>
      <dc:date>2011-07-26T05:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Turn On/Off Data Driven Pages in Script</title>
      <link>https://community.esri.com/t5/mapping-questions/turn-on-off-data-driven-pages-in-script/m-p/675157#M7263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This topic is going off on a tangent from the original title but ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you tried looking at the following help topic:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Customizing_your_map_extent/00s900000011000000/"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Customizing_your_map_extent/00s900000011000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Review the "Other Data Frame" section.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jul 2011 20:22:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/turn-on-off-data-driven-pages-in-script/m-p/675157#M7263</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2011-07-26T20:22:46Z</dc:date>
    </item>
  </channel>
</rss>

