<?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: How to create a list of MXDs that have specific parameters? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-create-a-list-of-mxds-that-have-specific/m-p/876317#M4913</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shelby,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I played around with this idea and the way I can see someone doing it is getting a list of MXD file paths, creating Map Document objects, and then appending those objects to a list based on whether Data Drive Pages are enabled. Depending on what you plan on doing next, you may want to pull the file paths or MXD titles, and create a new list that are just unicode objects instead of MXDs. Hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;arcpy.env.workspace = r"C:\Users\username\Desktop"&lt;BR /&gt;list = arcpy.ListFiles("*.mxd")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mxdnames = []&lt;/P&gt;&lt;P&gt;for item in list:&lt;BR /&gt;... print (str(item))&lt;BR /&gt;... mxdnames.append(str(item))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mxds = []&lt;/P&gt;&lt;P&gt;for file in mxdnames:&lt;BR /&gt;... mxd = arcpy.mapping.MapDocument(r"{}\{}".format(arcpy.env.workspace,file))&lt;BR /&gt;... mxds.append(mxd)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;falselist = []&lt;/P&gt;&lt;P&gt;for&amp;nbsp;m&amp;nbsp;in mxds:&lt;BR /&gt;... print (type(m))&lt;BR /&gt;... if&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;m.isDDPEnabled == False:&lt;BR /&gt;...&amp;nbsp; &amp;nbsp; falselist.append(m)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for map in falselist:&lt;BR /&gt;... print (map.filePath)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Marisa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 May 2019 13:56:07 GMT</pubDate>
    <dc:creator>MarisaClaggett</dc:creator>
    <dc:date>2019-05-02T13:56:07Z</dc:date>
    <item>
      <title>How to create a list of MXDs that have specific parameters?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-create-a-list-of-mxds-that-have-specific/m-p/876315#M4911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm looking to create two lists of mxds, one where data driven pages is enabled, and one where it is not.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a single directory with 15 mxds inside, where 2-3 have data driven pages enabled. Is there a way for me to create two lists of MXDs based on whether or not ddp is enabled?&amp;nbsp;I couldn't get it to work but I imagine it would look something like this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #808080; border: 0px; font-weight: inherit; font-size: 12px;"&gt;#need to loop through mxd_list and grab mxds in a directory where ddpIsEnabled. If true the put in list
&lt;/SPAN&gt;mxd_list = arcpy.ListFiles(&lt;SPAN style="color: #a5c261; border: 0px; font-weight: inherit; font-size: 12px;"&gt;"*.mxd"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; border: 0px; font-weight: inherit; font-size: 12px;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #aa4926; border: 0px; font-weight: inherit; font-size: 12px;"&gt;isddpEnabled &lt;/SPAN&gt;= &lt;SPAN style="color: #8888c6; border: 0px; font-weight: inherit; font-size: 12px;"&gt;False&lt;/SPAN&gt;)
ddp_list = arcpy.ListFiles(&lt;SPAN style="color: #a5c261; border: 0px; font-weight: inherit; font-size: 12px;"&gt;"*.mxd'"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; border: 0px; font-weight: inherit; font-size: 12px;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #aa4926; border: 0px; font-weight: inherit; font-size: 12px;"&gt;isddpEnabled &lt;/SPAN&gt;= &lt;SPAN style="color: #8888c6; border: 0px; font-weight: inherit; font-size: 12px;"&gt;True&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:59:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-create-a-list-of-mxds-that-have-specific/m-p/876315#M4911</guid>
      <dc:creator>ShelbyZemken1</dc:creator>
      <dc:date>2021-12-12T10:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a list of MXDs that have specific parameters?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-create-a-list-of-mxds-that-have-specific/m-p/876316#M4912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/58730"&gt;Shelby Zemken&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In ArcPy the MapDocument class has a property&amp;nbsp;&lt;SPAN style="color: #4d4d4d; background-color: #ffffff;"&gt;dataDrivenPages that returns a DataDrivenPages object that can then be used to manage the pages in a Data Driven Pages enabled map document.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; background-color: #ffffff;"&gt;Is this something you could use? If an empty object is returned, Data Driven Pages is most probably turned off or something like that...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; background-color: #ffffff;"&gt;Here's the documentation:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; background-color: #ffffff;"&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/mapdocument-class.htm" title="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/mapdocument-class.htm"&gt;MapDocument—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; background-color: #ffffff;"&gt;HTH,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; background-color: #ffffff;"&gt;Egge-Jan&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2019 13:02:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-create-a-list-of-mxds-that-have-specific/m-p/876316#M4912</guid>
      <dc:creator>Egge-Jan_Pollé</dc:creator>
      <dc:date>2019-04-11T13:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a list of MXDs that have specific parameters?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-create-a-list-of-mxds-that-have-specific/m-p/876317#M4913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shelby,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I played around with this idea and the way I can see someone doing it is getting a list of MXD file paths, creating Map Document objects, and then appending those objects to a list based on whether Data Drive Pages are enabled. Depending on what you plan on doing next, you may want to pull the file paths or MXD titles, and create a new list that are just unicode objects instead of MXDs. Hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;arcpy.env.workspace = r"C:\Users\username\Desktop"&lt;BR /&gt;list = arcpy.ListFiles("*.mxd")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mxdnames = []&lt;/P&gt;&lt;P&gt;for item in list:&lt;BR /&gt;... print (str(item))&lt;BR /&gt;... mxdnames.append(str(item))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mxds = []&lt;/P&gt;&lt;P&gt;for file in mxdnames:&lt;BR /&gt;... mxd = arcpy.mapping.MapDocument(r"{}\{}".format(arcpy.env.workspace,file))&lt;BR /&gt;... mxds.append(mxd)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;falselist = []&lt;/P&gt;&lt;P&gt;for&amp;nbsp;m&amp;nbsp;in mxds:&lt;BR /&gt;... print (type(m))&lt;BR /&gt;... if&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;m.isDDPEnabled == False:&lt;BR /&gt;...&amp;nbsp; &amp;nbsp; falselist.append(m)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for map in falselist:&lt;BR /&gt;... print (map.filePath)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Marisa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 May 2019 13:56:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-create-a-list-of-mxds-that-have-specific/m-p/876317#M4913</guid>
      <dc:creator>MarisaClaggett</dc:creator>
      <dc:date>2019-05-02T13:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a list of MXDs that have specific parameters?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-create-a-list-of-mxds-that-have-specific/m-p/876318#M4914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you &lt;A href="https://community.esri.com/migrated-users/228236" target="_blank"&gt;Marisa Claggett&lt;/A&gt; and &lt;A href="https://community.esri.com/migrated-users/331608" target="_blank"&gt;Egge-Jan Pollé&lt;/A&gt; for your assistance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm so close having this in working order. Now that the map documents are stored in lists, I can't get this to export to the output folder, only to the environment/workspace. Can someone take a look at this and maybe see where my small error is? It has to do with my output directory in the if/else loop.If I fix it one way, it breaks it in another way. I think it has something to do with how map documents are treated, but I'm still a struggling novice.&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT: Does this issue potentially stem from working with unicode objects instead of MXDs?&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #808080;"&gt;# Script takes all .mxd files in a user defined directory and
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;# exports them to another user defined directory
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;# This script accounts for map documents with data driven pages
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;os&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;arcpy

&lt;SPAN style="color: #808080;"&gt;# user sets input and output directories
&lt;/SPAN&gt;input_dir = arcpy.GetParameterAsText(&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;)
output_dir = arcpy.GetParameterAsText(&lt;SPAN style="color: #6897bb;"&gt;1&lt;/SPAN&gt;)
arcpy.env.workspace = ws = &lt;SPAN style="color: #8888c6;"&gt;str&lt;/SPAN&gt;(input_dir)

list = arcpy.ListFiles(&lt;SPAN style="color: #6a8759;"&gt;"*.mxd"&lt;/SPAN&gt;)
mxdnames = []
&lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;item &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;list:
    &lt;SPAN style="color: #8888c6;"&gt;print&lt;/SPAN&gt;(&lt;SPAN style="color: #8888c6;"&gt;str&lt;/SPAN&gt;(item))
    mxdnames.append(&lt;SPAN style="color: #8888c6;"&gt;str&lt;/SPAN&gt;(item))
&lt;SPAN style="color: #8888c6;"&gt;print&lt;/SPAN&gt;(&lt;SPAN style="color: #6a8759;"&gt;'All Mxds - ' &lt;/SPAN&gt;+ &lt;SPAN style="color: #8888c6;"&gt;str&lt;/SPAN&gt;(mxdnames))

&lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;mxd &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;mxdnames:
    input = os.path.join(ws&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;mxd)
    mxd = arcpy.mapping.MapDocument(input)
    output_name = (os.path.join(output_dir&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;mxd[:-&lt;SPAN style="color: #6897bb;"&gt;4&lt;/SPAN&gt;]) + &lt;SPAN style="color: #6a8759;"&gt;".pdf"&lt;/SPAN&gt;)
    &lt;SPAN style="color: #cc7832;"&gt;if &lt;/SPAN&gt;&lt;SPAN style="color: #8888c6;"&gt;hasattr&lt;/SPAN&gt;(mxd&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"dataDrivenPages"&lt;/SPAN&gt;):
        ddp = mxd.dataDrivenPages
        ddp.exportToPDF(output_name&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"ALL"&lt;/SPAN&gt;)
        arcpy.AddMessage(&lt;SPAN style="color: #6a8759;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;\t&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;' &lt;/SPAN&gt;+ &lt;SPAN style="color: #8888c6;"&gt;str&lt;/SPAN&gt;(mxd) + &lt;SPAN style="color: #8888c6;"&gt;str&lt;/SPAN&gt;(&lt;SPAN style="color: #6a8759;"&gt;' exported successfully (Data Driven Pages Enabled).'&lt;/SPAN&gt;))
        &lt;SPAN style="color: #cc7832;"&gt;del &lt;/SPAN&gt;mxd
    &lt;SPAN style="color: #cc7832;"&gt;else&lt;/SPAN&gt;:
        arcpy.mapping.ExportToPDF(mxd&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;output_name)
        arcpy.AddMessage(&lt;SPAN style="color: #6a8759;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;\t&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;' &lt;/SPAN&gt;+ &lt;SPAN style="color: #8888c6;"&gt;str&lt;/SPAN&gt;(mxd) + &lt;SPAN style="color: #8888c6;"&gt;str&lt;/SPAN&gt;(&lt;SPAN style="color: #6a8759;"&gt;' exported successfully.'&lt;/SPAN&gt;))
        &lt;SPAN style="color: #cc7832;"&gt;del &lt;/SPAN&gt;mxd

arcpy.AddMessage((&lt;SPAN style="color: #6a8759;"&gt;'Exports complete!'&lt;/SPAN&gt;))
complete = os.startfile(output_dir)
complete

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:59:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-create-a-list-of-mxds-that-have-specific/m-p/876318#M4914</guid>
      <dc:creator>ShelbyZemken1</dc:creator>
      <dc:date>2021-12-12T10:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a list of MXDs that have specific parameters?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-create-a-list-of-mxds-that-have-specific/m-p/876319#M4915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've figured out a working solution for this problem. Working code is below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you Marisa and Egge-Jan!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# This script prompts a user for an input directory containing MXDs,&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# and prompts for an output directory where PDFs are batch exported&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# This script exports both normal MXDs and MXDs with data driven pages enabled.&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; arcpy
&lt;SPAN class="comment token"&gt;# user sets input and output directories&lt;/SPAN&gt;
input_dir &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetParameterAsText&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
output_dir &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetParameterAsText&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ws &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; input_dir
mxdnames &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListFiles&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"*.mxd"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; documentname &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; mxdnames&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    input &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ws&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; documentname&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    mxd &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MapDocument&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;input&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    output_name &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;output_dir&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; documentname&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;".pdf"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; hasattr&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mxd&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"dataDrivenPages"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        ddp &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; mxd&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;dataDrivenPages
        ddp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;exportToPDF&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;output_name&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ALL"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddMessage&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'\t'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; str&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;documentname&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;' DDP enabled mxd exported successfully.'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; mxd
    &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ExportToPDF&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mxd&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; output_name&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddMessage&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'\t'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; str&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;documentname&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;' exported successfully.'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; mxd
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddMessage&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Exports complete!'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
complete &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;startfile&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;output_dir&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
complete&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:59:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-create-a-list-of-mxds-that-have-specific/m-p/876319#M4915</guid>
      <dc:creator>ShelbyZemken1</dc:creator>
      <dc:date>2021-12-12T10:59:24Z</dc:date>
    </item>
  </channel>
</rss>

