<?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 Batch Export Layers to TIF Toolkit Error in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/batch-export-layers-to-tif-toolkit-error/m-p/1348594#M75110</link>
    <description>&lt;P&gt;I used this code for batch exporting different layers:&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;import arcpy&lt;/P&gt;&lt;P&gt;def export_layers_to_tiff(selected_layers, output_folder)::&lt;BR /&gt;# Get the current ArcGIS project&lt;BR /&gt;project = arcpy.mp.ArcGISProject("CURRENT")&lt;/P&gt;&lt;P&gt;# Get the first layout in the project&lt;BR /&gt;layout = project.listLayouts()[0]&lt;/P&gt;&lt;P&gt;# Iterate over the layers selected by the user&lt;BR /&gt;for layer in selected_layers: # Enable layer visibility.&lt;BR /&gt;# Enable layer visibility&lt;BR /&gt;layer.visible = True&lt;/P&gt;&lt;P&gt;# Modify layer name, remove ' g/kg'.&lt;BR /&gt;modified_layer_name = layer.name.replace(" g/kg", "")&lt;/P&gt;&lt;P&gt;# Export layout to TIF format&lt;BR /&gt;output_path = os.path.join(output_folder, f"{modified_layer_name}.tif")&lt;BR /&gt;layout.exportToTIFF(output_path)&lt;/P&gt;&lt;P&gt;# Turn off layer visibility&lt;BR /&gt;layer.visible = False&lt;/P&gt;&lt;P&gt;arcpy.AddMessage("Export complete")&lt;/P&gt;&lt;P&gt;# Receive the output folder path parameter&lt;BR /&gt;output_folder = arcpy.GetParameterAsText(0)&lt;/P&gt;&lt;P&gt;# Receive the layers selected by the user&lt;BR /&gt;selected_layers = arcpy.GetParameter(1)&amp;nbsp;&lt;/P&gt;&lt;P&gt;export_layers_to_tiff(selected_layers, output_folder)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But keep getting this error:&amp;nbsp;&lt;BR /&gt;File "G:\GISPRO\ Toolbox/Toolkit.atbx#Script_atbx.py", line 35, in &amp;lt;module&amp;gt;&lt;BR /&gt;File "G:\GISPRO\ Toolbox/Toolbox.atbx#Script_atbx.py", line 22, in export_layers_to_tiff&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro/Resources\ArcPy\arcpy\utils.py", line 191, in fn_&lt;BR /&gt;return fn(*args, **kw)&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro/Resources\ArcPy\arcpy\_mp.py", line 1807, in exportToTIFF&lt;BR /&gt;return convertArcObjectToPythonObject(self._arc_object.exportToTIFF(*gp_fixargs((out_tif, resolution, color_mode, tiff_compression, )))&lt;BR /&gt;OSError: G:\Drawing\cen\SOC_upper_020.tif&lt;/P&gt;&lt;P&gt;Can you&amp;nbsp;please&amp;nbsp;tell me which part I should modify to complete this toolbox?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Nov 2023 11:04:52 GMT</pubDate>
    <dc:creator>chenjizhenchen</dc:creator>
    <dc:date>2023-11-13T11:04:52Z</dc:date>
    <item>
      <title>Batch Export Layers to TIF Toolkit Error</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/batch-export-layers-to-tif-toolkit-error/m-p/1348594#M75110</link>
      <description>&lt;P&gt;I used this code for batch exporting different layers:&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;import arcpy&lt;/P&gt;&lt;P&gt;def export_layers_to_tiff(selected_layers, output_folder)::&lt;BR /&gt;# Get the current ArcGIS project&lt;BR /&gt;project = arcpy.mp.ArcGISProject("CURRENT")&lt;/P&gt;&lt;P&gt;# Get the first layout in the project&lt;BR /&gt;layout = project.listLayouts()[0]&lt;/P&gt;&lt;P&gt;# Iterate over the layers selected by the user&lt;BR /&gt;for layer in selected_layers: # Enable layer visibility.&lt;BR /&gt;# Enable layer visibility&lt;BR /&gt;layer.visible = True&lt;/P&gt;&lt;P&gt;# Modify layer name, remove ' g/kg'.&lt;BR /&gt;modified_layer_name = layer.name.replace(" g/kg", "")&lt;/P&gt;&lt;P&gt;# Export layout to TIF format&lt;BR /&gt;output_path = os.path.join(output_folder, f"{modified_layer_name}.tif")&lt;BR /&gt;layout.exportToTIFF(output_path)&lt;/P&gt;&lt;P&gt;# Turn off layer visibility&lt;BR /&gt;layer.visible = False&lt;/P&gt;&lt;P&gt;arcpy.AddMessage("Export complete")&lt;/P&gt;&lt;P&gt;# Receive the output folder path parameter&lt;BR /&gt;output_folder = arcpy.GetParameterAsText(0)&lt;/P&gt;&lt;P&gt;# Receive the layers selected by the user&lt;BR /&gt;selected_layers = arcpy.GetParameter(1)&amp;nbsp;&lt;/P&gt;&lt;P&gt;export_layers_to_tiff(selected_layers, output_folder)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But keep getting this error:&amp;nbsp;&lt;BR /&gt;File "G:\GISPRO\ Toolbox/Toolkit.atbx#Script_atbx.py", line 35, in &amp;lt;module&amp;gt;&lt;BR /&gt;File "G:\GISPRO\ Toolbox/Toolbox.atbx#Script_atbx.py", line 22, in export_layers_to_tiff&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro/Resources\ArcPy\arcpy\utils.py", line 191, in fn_&lt;BR /&gt;return fn(*args, **kw)&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro/Resources\ArcPy\arcpy\_mp.py", line 1807, in exportToTIFF&lt;BR /&gt;return convertArcObjectToPythonObject(self._arc_object.exportToTIFF(*gp_fixargs((out_tif, resolution, color_mode, tiff_compression, )))&lt;BR /&gt;OSError: G:\Drawing\cen\SOC_upper_020.tif&lt;/P&gt;&lt;P&gt;Can you&amp;nbsp;please&amp;nbsp;tell me which part I should modify to complete this toolbox?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2023 11:04:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/batch-export-layers-to-tif-toolkit-error/m-p/1348594#M75110</guid>
      <dc:creator>chenjizhenchen</dc:creator>
      <dc:date>2023-11-13T11:04:52Z</dc:date>
    </item>
  </channel>
</rss>

