<?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: Python Scripting Error Export Layout in ArcGIS Web AppBuilder Questions</title>
    <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/python-scripting-error-export-layout/m-p/1008380#M20057</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/151468"&gt;@ConnorBerry&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Quick question: what version of ArcGIS Server you are running your service?&lt;/P&gt;</description>
    <pubDate>Thu, 10 Dec 2020 07:22:59 GMT</pubDate>
    <dc:creator>TanuHoque</dc:creator>
    <dc:date>2020-12-10T07:22:59Z</dc:date>
    <item>
      <title>Python Scripting Error Export Layout</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/python-scripting-error-export-layout/m-p/554352#M14681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good morning! I am using ARCGIS Pro v2.3 to develop a web tool, part of which exports pdf to a created directory on our server. While the script runs perfectly in arcgis Pro, when I publish it as a web tool I receive OS Error: (path.)&amp;nbsp;This error occurs on the line lyt.ExportToPDF (path.) The path is dynamic, in the sense that a new folder is created in the directory each time, and changes each time the script is run. Additionally, I am able to write other files to the path, just not the pdf. I have tried changing paths, taking away transparency on the maps themselves, creating the pdf document before the output, etc. I am just so lost on this and would love some help/ideas. It makes no sense to me as well because the script runs perfectly up until I publish it as a web tool. Thanks!&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Nov 2020 15:19:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/python-scripting-error-export-layout/m-p/554352#M14681</guid>
      <dc:creator>ConnorBerry</dc:creator>
      <dc:date>2020-11-09T15:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: Python Scripting Error Export Layout</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/python-scripting-error-export-layout/m-p/554353#M14682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is the parent directory registered to the ArcGIS server, and is it an FQDN or drive mapped path?&lt;/P&gt;&lt;P&gt;Can you share the script?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Nov 2020 15:54:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/python-scripting-error-export-layout/m-p/554353#M14682</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2020-11-09T15:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: Python Scripting Error Export Layout</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/python-scripting-error-export-layout/m-p/554354#M14683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, the parent directory is registered and I believe it is a drive mapped path (though I am fairly new in this area so am not entirely sure.) I am unable to share the full script, but here are the parts I can share were it errors at&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;output_workspace = arcpy.GetParameterAsText(0) #folder&lt;BR /&gt;geodatabase_name = arcpy.GetParameterAsText(1) #string&lt;BR /&gt;os.mkdir(output_workspace + '//' + geodatabase_name)&lt;BR /&gt;output_workspace = output_workspace + '//' + geodatabase_name&lt;/P&gt;&lt;P&gt;def create_new_constraints_pdf(output_workspace, geodatabase_name, output_geodatabase):&lt;BR /&gt; aprx = arcpy.mp.ArcGISProject(path to aprx) #aprx gets copied to web tool&lt;BR /&gt; arcpy.env.workspace = output_geodatabase&lt;BR /&gt; map = aprx.listMaps()[0]&lt;BR /&gt; constraints_lyr = output_workspace + '//' + 'constraints' + '.Lyrx'&lt;BR /&gt; lyrFile = arcpy.mp.LayerFile(constraints_lyr)&lt;BR /&gt; lyt = aprx.listLayouts()[0]&lt;BR /&gt; legend = lyt.listElements("LEGEND_ELEMENT")[0] #Calls Legend Element&lt;BR /&gt; legend.syncNewLayer = True #Makes all newly added layers appear in legend&lt;BR /&gt; map.addLayer(lyrFile, 'Top')&lt;BR /&gt; for lyr in map.listLayers(): #For statement will properly color layers on map&lt;BR /&gt; if lyr.isFeatureLayer:&lt;BR /&gt; sym = lyr.symbology&lt;BR /&gt; if hasattr(sym, 'renderer'):&lt;BR /&gt; if sym.renderer.type == 'SimpleRenderer':&lt;BR /&gt; sym.updateRenderer('GraduatedColorsRenderer')&lt;BR /&gt; sym.renderer.classificationField = "total_score"&lt;BR /&gt; sym.renderer.breakCount = 5&lt;/P&gt;&lt;P&gt;lyr.symbology = sym&lt;BR /&gt; lyr = map.listLayers()[0]&lt;BR /&gt; lyr.transparency = 20 #Sets transparency to 20%&lt;BR /&gt; legend.syncLayerVisibility = True #Places all layers on map into legend&lt;BR /&gt; lyt.exportToPDF(output_workspace + '//' + 'transparent') #(Errors out here)&lt;BR /&gt; map.clearSelection()&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Nov 2020 16:10:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/python-scripting-error-export-layout/m-p/554354#M14683</guid>
      <dc:creator>ConnorBerry</dc:creator>
      <dc:date>2020-11-09T16:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: Python Scripting Error Export Layout</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/python-scripting-error-export-layout/m-p/554355#M14684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try an os.path.join instead of concatenation on&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: inherit; 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: normal; word-spacing: 0px;"&gt;lyt.exportToPDF(output_workspace + '//' + 'transparent')&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: inherit; 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: normal; word-spacing: 0px;"&gt;also are you missing the .pdf in the filename?&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: inherit; 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: normal; word-spacing: 0px;"&gt;The syntax highlighter would make this much more readable to others.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Nov 2020 16:18:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/python-scripting-error-export-layout/m-p/554355#M14684</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2020-11-09T16:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: Python Scripting Error Export Layout</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/python-scripting-error-export-layout/m-p/1008380#M20057</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/151468"&gt;@ConnorBerry&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Quick question: what version of ArcGIS Server you are running your service?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 07:22:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/python-scripting-error-export-layout/m-p/1008380#M20057</guid>
      <dc:creator>TanuHoque</dc:creator>
      <dc:date>2020-12-10T07:22:59Z</dc:date>
    </item>
  </channel>
</rss>

