<?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: code for checking whether data driven pages enabled in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/code-for-checking-whether-data-driven-pages/m-p/382076#M30113</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;yes, the below code is working fine to check whether the DDP enabled in the MXD.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But the DDP can be enabled with only one Map Dataframe. in otherway, if the MXD have more than one Dataframe, then let me know the DDP enabled to which dataframe.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd = arcpy.mapping.MapDocument(r"C:\Projects\Untitled_new.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if hasattr(mxd, "dataDrivenPages"):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "yes"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;else :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "No"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Aug 2011 06:32:18 GMT</pubDate>
    <dc:creator>AdhimoolamD</dc:creator>
    <dc:date>2011-08-04T06:32:18Z</dc:date>
    <item>
      <title>code for checking whether data driven pages enabled</title>
      <link>https://community.esri.com/t5/python-questions/code-for-checking-whether-data-driven-pages/m-p/382072#M30109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there a means of checking, in Python, whether data driven pages are enabled in a particular MXD?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;All the code and help I can find seems to imply this verification must take place manually, and if I call&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;mxd.dataDrivenPages&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for a map document object that doesn't have DDP, I get an error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Traceback (most recent call last):
&amp;nbsp; File "&amp;lt;interactive input&amp;gt;", line 1, in &amp;lt;module&amp;gt;
&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\arcobjects\mixins.py", line 447, in dataDrivenPages
&amp;nbsp;&amp;nbsp;&amp;nbsp; return convertArcObjectToPythonObject(self._arc_object.pageLayout.dataDrivenPages)
AttributeError: PageLayoutObject: Get attribute dataDrivenPages does not exist&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 15:48:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/code-for-checking-whether-data-driven-pages/m-p/382072#M30109</guid>
      <dc:creator>ErinIverson</dc:creator>
      <dc:date>2011-04-01T15:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: code for checking whether data driven pages enabled</title>
      <link>https://community.esri.com/t5/python-questions/code-for-checking-whether-data-driven-pages/m-p/382073#M30110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Maybe creating a try that catches the specific AttributeError and informs the user? It really isn't checking for DDP enabled, but will provide the same end result.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Apr 2011 13:43:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/code-for-checking-whether-data-driven-pages/m-p/382073#M30110</guid>
      <dc:creator>StevenArebalo</dc:creator>
      <dc:date>2011-04-04T13:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: code for checking whether data driven pages enabled</title>
      <link>https://community.esri.com/t5/python-questions/code-for-checking-whether-data-driven-pages/m-p/382074#M30111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Use either&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;if mxd.supports("dataDrivenPages"):
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;or&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;if hasattr(mxd, "dataDrivenPages"):
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:36:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/code-for-checking-whether-data-driven-pages/m-p/382074#M30111</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2021-12-11T17:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: code for checking whether data driven pages enabled</title>
      <link>https://community.esri.com/t5/python-questions/code-for-checking-whether-data-driven-pages/m-p/382075#M30112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is it still the case that there isn't a way to turn DDP on/off within Python?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Apr 2011 17:11:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/code-for-checking-whether-data-driven-pages/m-p/382075#M30112</guid>
      <dc:creator>JonPedder</dc:creator>
      <dc:date>2011-04-05T17:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: code for checking whether data driven pages enabled</title>
      <link>https://community.esri.com/t5/python-questions/code-for-checking-whether-data-driven-pages/m-p/382076#M30113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;yes, the below code is working fine to check whether the DDP enabled in the MXD.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But the DDP can be enabled with only one Map Dataframe. in otherway, if the MXD have more than one Dataframe, then let me know the DDP enabled to which dataframe.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd = arcpy.mapping.MapDocument(r"C:\Projects\Untitled_new.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if hasattr(mxd, "dataDrivenPages"):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "yes"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;else :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "No"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2011 06:32:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/code-for-checking-whether-data-driven-pages/m-p/382076#M30113</guid>
      <dc:creator>AdhimoolamD</dc:creator>
      <dc:date>2011-08-04T06:32:18Z</dc:date>
    </item>
  </channel>
</rss>

