<?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: Multiple Data Driven Frames Using Python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/multiple-data-driven-frames-using-python/m-p/710559#M55083</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It just doesn't actually read the available IDs. It assumes that every ID exists between 1 and the length of the list. If you happened to have IDs 1, 2, 3, 5 (missing 4), when the loop is on 3 it will look for value 4 (pageNum+1), but since it's not there, there will be an error. If all your IDs exist, there should be no problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Aug 2016 18:07:53 GMT</pubDate>
    <dc:creator>DarrenWiens2</dc:creator>
    <dc:date>2016-08-04T18:07:53Z</dc:date>
    <item>
      <title>Multiple Data Driven Frames Using Python</title>
      <link>https://community.esri.com/t5/python-questions/multiple-data-driven-frames-using-python/m-p/710556#M55080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been trying to write a script that can do the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;BR /&gt;-Two frames on a layout, one on top and one on the bottom&lt;BR /&gt;-10 data driven pages&lt;BR /&gt;-It would display DDP's 1, 3, 5, 7, 9 top frame and DDP's 2, 4, 6, 8, 10 on the bottom frame, for a total of 5 sheets of paper.&lt;/P&gt;&lt;P&gt;Below is what I have come up with so far. The script runs them one at a time instead of together. Anyone know what I am missing?&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
import time

mxd = arcpy.mapping.MapDocument("CURRENT")

#Lists all dataframes within the mxd
df1 = arcpy.mapping.ListDataFrames(mxd,"Layers")[0]
df2 = arcpy.mapping.ListDataFrames(mxd,"Layer 02")[0]
lyr = arcpy.mapping.ListLayers(mxd, "", df2)[0]
rows = arcpy.SearchCursor(lyr,"CATEGORY = 'Even'",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fields="Shape; Id; CATEGORY; 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; sort_fields="Id A")

for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1,2):&amp;nbsp; 
&amp;nbsp; mxd.dataDrivenPages.currentPageID = pageNum
&amp;nbsp; for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; df2.extent = row.Shape.extent
&amp;nbsp;&amp;nbsp;&amp;nbsp; df2.scale = 2400
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.RefreshActiveView()
&amp;nbsp;&amp;nbsp;&amp;nbsp; time.sleep(2)
&amp;nbsp;&amp;nbsp;&amp;nbsp; print row.getValue("Name")
del mxd


&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 06:27:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/multiple-data-driven-frames-using-python/m-p/710556#M55080</guid>
      <dc:creator>Johnkelly4</dc:creator>
      <dc:date>2021-12-12T06:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Data Driven Frames Using Python</title>
      <link>https://community.esri.com/t5/python-questions/multiple-data-driven-frames-using-python/m-p/710557#M55081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This seems to work using a modern cursor. This works for 'nice' data, but you may have to do some work if you're missing IDs or something.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; import time
... mxd = arcpy.mapping.MapDocument("CURRENT")
... df1 = arcpy.mapping.ListDataFrames(mxd,"Layers1")[0]
... df2 = arcpy.mapping.ListDataFrames(mxd,"Layers2")[0] 
... index = 'buff' # my DDP index layer
... features = {row[0]:row[1] for row in arcpy.da.SearchCursor(index,['ID','SHAPE@'])} # all index features
... for pageNum in range(1,mxd.dataDrivenPages.pageCount,2):
...&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd.dataDrivenPages.currentPageID = pageNum
...&amp;nbsp;&amp;nbsp;&amp;nbsp; df1.extent = features[pageNum].extent
...&amp;nbsp;&amp;nbsp;&amp;nbsp; df2.extent = features[pageNum+1].extent
...&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.RefreshActiveView
...&amp;nbsp;&amp;nbsp;&amp;nbsp; time.sleep(2)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 06:27:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/multiple-data-driven-frames-using-python/m-p/710557#M55081</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-12T06:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Data Driven Frames Using Python</title>
      <link>https://community.esri.com/t5/python-questions/multiple-data-driven-frames-using-python/m-p/710558#M55082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you sir! Your version seemed to work (and was much cleaner). What exactly did you mean by 'nice' data and missing IDs? What kinds of problems do you see with this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2016 17:58:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/multiple-data-driven-frames-using-python/m-p/710558#M55082</guid>
      <dc:creator>Johnkelly4</dc:creator>
      <dc:date>2016-08-04T17:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Data Driven Frames Using Python</title>
      <link>https://community.esri.com/t5/python-questions/multiple-data-driven-frames-using-python/m-p/710559#M55083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It just doesn't actually read the available IDs. It assumes that every ID exists between 1 and the length of the list. If you happened to have IDs 1, 2, 3, 5 (missing 4), when the loop is on 3 it will look for value 4 (pageNum+1), but since it's not there, there will be an error. If all your IDs exist, there should be no problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2016 18:07:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/multiple-data-driven-frames-using-python/m-p/710559#M55083</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2016-08-04T18:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Data Driven Frames Using Python</title>
      <link>https://community.esri.com/t5/python-questions/multiple-data-driven-frames-using-python/m-p/710561#M55085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;You would need to add the scale value into the features dictionary. Before, the dictionary had the form: {ID1:SHAPE1, ID2:SHAPE2,...}. Below, I've changed it to be like: {ID1:[SHAPE1,SCALE1], ID2:[SHAPE2,SCALE2]...}. So, later on, you can reference by ID (features[pageNum]) and get either the shape ([0]), or scale ([1]).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;import&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; time&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;mxd = arcpy.mapping.MapDocument(&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"CURRENT"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;)&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;df1 = arcpy.mapping.ListDataFrames(mxd,&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"Layers"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;)[&lt;/SPAN&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important; background-color: inherit;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;]&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;df2 = arcpy.mapping.ListDataFrames(mxd,&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"Layer02"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;)[&lt;/SPAN&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important; background-color: inherit;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;]&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;fc = &lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"D:\Practice\Arcpy\New_Shapefile.shp"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;index = fc &lt;SPAN class="comment" style="font-weight: inherit; font-style: inherit; color: #008200; font-size: 9pt !important; background-color: inherit;"&gt;# my DDP index layer&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;features = {row[&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important; background-color: inherit;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;]:[row[&lt;/SPAN&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important; background-color: inherit;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;],row[2]] &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;for&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; row &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; arcpy.da.SearchCursor&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (index,[&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;'ID','SHAPE@','Scale'&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;])} &lt;/SPAN&gt;&lt;SPAN class="comment" style="font-weight: inherit; font-style: inherit; color: #008200; font-size: 9pt !important; background-color: inherit;"&gt;# all index features&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;for&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; pageNum &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; range(&lt;/SPAN&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important; background-color: inherit;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;,mxd.dataDrivenPages.pageCount,&lt;/SPAN&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important; background-color: inherit;"&gt;2&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;):&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd.dataDrivenPages.currentPageID = pageNum&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; df1.extent = features[pageNum][0].extent&amp;nbsp; &lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; df1.scale = features[pageNum][1]&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; df2.extent = features[pageNum+&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important; background-color: inherit;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;][0].extent&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; df2.scale = features[pageNum+1][1]&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.RefreshActiveView&amp;nbsp; &lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;print&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; [&lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;'ID'&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;]&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.ExportToPDF(mxd, r&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"D:\Practice\Arcpy\Page_"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; + str(pageNum) + &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;".pdf"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;)&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; time.sleep(&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important; background-color: inherit;"&gt;2&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;)&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;del&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; mxd&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 06:27:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/multiple-data-driven-frames-using-python/m-p/710561#M55085</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-12T06:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Data Driven Frames Using Python</title>
      <link>https://community.esri.com/t5/python-questions/multiple-data-driven-frames-using-python/m-p/710562#M55086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you! It worked out great! Sorry I am new to arcpy. So just to make sure I understand what happened - &lt;/P&gt;&lt;P&gt;The dictionary part is this?: features = {row[&lt;SPAN class="number"&gt;0]:[row[&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;],row[&lt;SPAN class="number"&gt;2&lt;/SPAN&gt;]]...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (row[0] is attached to 'ID' and row[1] to 'Scale'?)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="number"&gt;This part specifies what goes in each row? (index,[&lt;SPAN class="string"&gt;'ID','SHAPE@','Scale'])} &lt;SPAN class="comment"&gt;# all index features&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2016 19:11:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/multiple-data-driven-frames-using-python/m-p/710562#M55086</guid>
      <dc:creator>Johnkelly4</dc:creator>
      <dc:date>2016-08-04T19:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Data Driven Frames Using Python</title>
      <link>https://community.esri.com/t5/python-questions/multiple-data-driven-frames-using-python/m-p/710563#M55087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important;"&gt;Yes, this is the line that builds the dictionary. It uses some shorthand called a &lt;A href="https://www.python.org/dev/peps/pep-0274/" rel="nofollow noopener noreferrer" target="_blank"&gt;dictionary comprehension&lt;/A&gt;:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important;"&gt;features = {row[&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important;"&gt;]:[row[&lt;/SPAN&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important;"&gt;],row[&lt;/SPAN&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important;"&gt;2&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important;"&gt;]] &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important;"&gt;for&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important;"&gt; row &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important;"&gt; arcpy.da.SearchCursor&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important;"&gt;(index,[&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important;"&gt;'ID','SHAPE@','Scale'&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important;"&gt;])}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This line is equivalent to:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;features = {}
with arcpy.da.S&lt;SPAN style="color: black; font-weight: inherit; font-size: 9pt !important; font-style: inherit;"&gt;earchCursor&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important;"&gt;(index,[&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important;"&gt;'ID','SHAPE@','Scale'&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important;"&gt;]) as cursor:&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="color: black; font-weight: inherit; font-size: 9pt !important; font-style: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in rows:&lt;/SPAN&gt;
&lt;SPAN style="color: black; font-weight: inherit; font-size: 9pt !important; font-style: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; features[row[0]] = [row[1],row[2]] # I think this is right, but may get key error, I can't remember&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And, yes, you're mostly right about which part specifies what in row. The first value ('ID') becomes the first item in row (row[0]), second value ('SHAPE@') goes into row[1], and third value ('Scale') goes into row[2]. If you listed more fields, they would go into row[3], row[4], etc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 06:27:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/multiple-data-driven-frames-using-python/m-p/710563#M55087</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-12T06:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Data Driven Frames Using Python</title>
      <link>https://community.esri.com/t5/python-questions/multiple-data-driven-frames-using-python/m-p/710564#M55088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Got it! Thanks again for all your help!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2016 20:16:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/multiple-data-driven-frames-using-python/m-p/710564#M55088</guid>
      <dc:creator>Johnkelly4</dc:creator>
      <dc:date>2016-08-04T20:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Data Driven Frames Using Python</title>
      <link>https://community.esri.com/t5/python-questions/multiple-data-driven-frames-using-python/m-p/710560#M55084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah ok, I think I will be fine in that case. Will I be able to call on different field information with this? For example: I have a field called scale that determines the scale for each extent (1:2,400, 1:3,600, etc). So could something like this work:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import time&amp;nbsp; 
mxd = arcpy.mapping.MapDocument("CURRENT")&amp;nbsp; 
df1 = arcpy.mapping.ListDataFrames(mxd,"Layers")[0]&amp;nbsp; 
df2 = arcpy.mapping.ListDataFrames(mxd,"Layer02")[0]
fc = "D:\Practice\Arcpy\New_Shapefile.shp"
index = fc # my DDP index layer

features = {row[0]:row[1] for row in arcpy.da.SearchCursor
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (index,['ID','SHAPE@','Scale'])} # all index features&amp;nbsp; 
for pageNum in range(1,mxd.dataDrivenPages.pageCount,2):&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd.dataDrivenPages.currentPageID = pageNum&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; df1.extent = features[pageNum].extent
&amp;nbsp;&amp;nbsp;&amp;nbsp; df1.scale = Scale
&amp;nbsp;&amp;nbsp;&amp;nbsp; df2.extent = features[pageNum+1].extent
&amp;nbsp;&amp;nbsp;&amp;nbsp; df2.scale = Scale
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.RefreshActiveView
&amp;nbsp;&amp;nbsp;&amp;nbsp; print ['ID']
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.ExportToPDF(mxd, r"D:\Practice\Arcpy\Page_" + str(pageNum) + ".pdf")
&amp;nbsp;&amp;nbsp;&amp;nbsp; time.sleep(2)
del mxd
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 06:27:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/multiple-data-driven-frames-using-python/m-p/710560#M55084</guid>
      <dc:creator>Johnkelly4</dc:creator>
      <dc:date>2021-12-12T06:27:21Z</dc:date>
    </item>
  </channel>
</rss>

