<?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: ArcGIS Pro Export python in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-export-python/m-p/21367#M755</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;so not getting the aprx object was the issue then. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image" height="204" src="https://community.esri.com/legacyfs/online/436109_current_project.png" width="699" /&gt;&lt;/P&gt;&lt;P&gt;with the extra path stuff cut out&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Jan 2019 23:43:16 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2019-01-29T23:43:16Z</dc:date>
    <item>
      <title>ArcGIS Pro Export python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-export-python/m-p/21362#M750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to export a project to pdf.&lt;/P&gt;&lt;P&gt;With arcpy.mapping i had the following and worked&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy, os, sys 

mxd = arcpy.mapping.MapDocument("CURRENT")
folder = os.path.dirname(mxd.filePath) # H:/GIS_Data
fullfilename = os.path.basename(mxd.filePath) # junk.mxd
filename = os.path.splitext(fullfilename) # [junk, mxd]
name = filename[0] # junk
pdfname = name + '.pdf' # junk.pdf
outpdf = folder + "/" + pdfname # H:/GIS_Data/junk.pdf
arcpy.mapping.ExportToPDF(mxd, pdfname, "PAGE_LAYOUT",0 ,0 ,"210")&lt;SPAN class=""&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;/PRE&gt;&lt;P&gt;I am attempting to do this with ArcGIS Pro &lt;SPAN class=""&gt;arcpy.mp and have the following but having a hard time getting it started.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;I get AttributeError: 'str' object has no attribute 'listLayouts' with the following.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy, os, sys 

p = arcpy.mp.ArcGISProject("CURRENT").filePath
l = p.listLayouts()[0]
l.exportToPDF(R"C:\temp\Ex1_WA.pdf", 'CURRENT',0 ,0 ,"210")&lt;SPAN class=""&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;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:52:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-export-python/m-p/21362#M750</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2021-12-10T20:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Export python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-export-python/m-p/21363#M751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;TABLE style="background-color: #ffffff; border-collapse: collapse; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; border-spacing: 0px; color: #4c4c4c; font-family: &amp;amp;quot; avenir next w01&amp;amp;quot;,&amp;amp;quot;avenir next w00&amp;amp;quot;,&amp;amp;quot;avenir next&amp;amp;quot;,&amp;amp;quot;avenir&amp;amp;quot;,&amp;amp;quot;helvetica neue&amp;amp;quot;,sans-serif; font-size: 0.87rem; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.55rem; margin-bottom: 1.55rem; orphans: 2; overflow: auto; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; width: 100%; word-spacing: 0px; border: 1px solid #cccccc;"&gt;&lt;TBODY style="overflow: auto; width: 100%;"&gt;&lt;TR style="border-bottom-color: #cccccc; border-bottom-style: solid; border-bottom-width: 1px; text-align: left;"&gt;&lt;TD style="border-left-color: #cccccc; border-left-style: solid; border-left-width: 1px; border-right-color: #cccccc; border-right-style: solid; border-right-width: 1px; font-weight: 300; padding: 0.51rem;"&gt;ilePath&lt;DIV&gt;(Read Only)&lt;/DIV&gt;&lt;/TD&gt;&lt;TD style="border-left-color: #cccccc; border-left-style: solid; border-left-width: 1px; border-right-color: #cccccc; border-right-style: solid; border-right-width: 1px; font-weight: 300; padding: 0.51rem;"&gt;&lt;P style="margin-bottom: 0px; margin-top: 0px;"&gt;Returns a string value that reports the fully qualified project path and file name.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So it should work unless you are not running it from with a toolbox in an open session of Pro or from Pro's python window.&lt;/P&gt;&lt;P&gt;To test, just throw the actual path in there, because 'CURRENT' doesn't seem to be returning anything other than a string (perhaps None)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2019 19:14:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-export-python/m-p/21363#M751</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-01-29T19:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Export python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-export-python/m-p/21364#M752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was trying to run it in Pro's Python window, is this not allowed?&lt;/P&gt;&lt;P&gt;can you not set the os.path.dirname so you won't have to give the full path name?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2019 22:19:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-export-python/m-p/21364#M752</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2019-01-29T22:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Export python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-export-python/m-p/21365#M753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;perhaps you are shortcutting&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;p = arcpy.mp.ArcGISProject("CURRENT")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;pth = p.filePath&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;the first line, assuming it works, should return a project&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;the second line returns the path to the project&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;the way you had it&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;p = arcpy.mp.ArcGISProject("CURRENT").filePath&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;just returns the path to the project and not the actual project which is needed later on.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2019 22:28:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-export-python/m-p/21365#M753</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-01-29T22:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Export python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-export-python/m-p/21366#M754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got it to work the the following, thanks for the help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;import arcpy, os, sys 

p = arcpy.mp.ArcGISProject("CURRENT")
folder = os.path.dirname(p.filePath)
fullfilename = os.path.basename(p.filePath)
filename = os.path.splitext(fullfilename)
name = filename[0]
pdfname = name + '.pdf' 
outpdf = folder + "/" + pdfname
l = p.listLayouts()[0]
l.exportToPDF(pdfname,resolution = 300)&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:52:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-export-python/m-p/21366#M754</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2021-12-10T20:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Export python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-export-python/m-p/21367#M755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;so not getting the aprx object was the issue then. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image" height="204" src="https://community.esri.com/legacyfs/online/436109_current_project.png" width="699" /&gt;&lt;/P&gt;&lt;P&gt;with the extra path stuff cut out&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2019 23:43:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-export-python/m-p/21367#M755</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-01-29T23:43:16Z</dc:date>
    </item>
  </channel>
</rss>

