<?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 Python script to zoom to object and export screen (GeoTIFF) for ArcGIS pro in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/python-script-to-zoom-to-object-and-export-screen/m-p/759851#M33184</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm looking to build a script for ArcGIS pro which takes a feature class, zooms into the objects, and export a GeoTIFF named by an attribute&amp;nbsp;from the feature. I'm new to ArcGIS pro and haven't done any scripting in it before but have the script below which I built for ArcMap. I'm having trouble bringing this script into ArcGIS pro and I'd appreciate any help with transitioning the script. Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import os&lt;BR /&gt;import arcpy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;path = arcpy.GetParameterAsText (0)&lt;BR /&gt;lyr_prnt = arcpy.GetParameterAsText (1)&lt;BR /&gt;fld_name = arcpy.GetParameterAsText (2)&lt;BR /&gt;scale = None&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mxd = arcpy.mapping.MapDocument("CURRENT")&lt;BR /&gt;df = arcpy.mapping.ListDataFrames(mxd)[0]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with arcpy.da.SearchCursor(lyr_prnt, [fld_name, "SHAPE@"]) as cursor:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;for id, shape in cursor:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;selx = "{}".format(fld_name) + " = " + "'{}'".format(id)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.SelectLayerByAttribute_management (lyr_prnt,"NEW_SELECTION", selx)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;df.extent = shape.extent&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if scale:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;df.scale = scale&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.RefreshActiveView()&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.mapping.ExportToTIFF(mxd, os.path.join(path, "{}.tif".format(id)), df, df_export_width=2000, &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;df_export_height=2000, geoTIFF_tags=True)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Oct 2020 15:24:00 GMT</pubDate>
    <dc:creator>SadraDehghan1</dc:creator>
    <dc:date>2020-10-05T15:24:00Z</dc:date>
    <item>
      <title>Python script to zoom to object and export screen (GeoTIFF) for ArcGIS pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-script-to-zoom-to-object-and-export-screen/m-p/759851#M33184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm looking to build a script for ArcGIS pro which takes a feature class, zooms into the objects, and export a GeoTIFF named by an attribute&amp;nbsp;from the feature. I'm new to ArcGIS pro and haven't done any scripting in it before but have the script below which I built for ArcMap. I'm having trouble bringing this script into ArcGIS pro and I'd appreciate any help with transitioning the script. Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import os&lt;BR /&gt;import arcpy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;path = arcpy.GetParameterAsText (0)&lt;BR /&gt;lyr_prnt = arcpy.GetParameterAsText (1)&lt;BR /&gt;fld_name = arcpy.GetParameterAsText (2)&lt;BR /&gt;scale = None&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mxd = arcpy.mapping.MapDocument("CURRENT")&lt;BR /&gt;df = arcpy.mapping.ListDataFrames(mxd)[0]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with arcpy.da.SearchCursor(lyr_prnt, [fld_name, "SHAPE@"]) as cursor:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;for id, shape in cursor:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;selx = "{}".format(fld_name) + " = " + "'{}'".format(id)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.SelectLayerByAttribute_management (lyr_prnt,"NEW_SELECTION", selx)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;df.extent = shape.extent&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if scale:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;df.scale = scale&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.RefreshActiveView()&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.mapping.ExportToTIFF(mxd, os.path.join(path, "{}.tif".format(id)), df, df_export_width=2000, &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;df_export_height=2000, geoTIFF_tags=True)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Oct 2020 15:24:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-script-to-zoom-to-object-and-export-screen/m-p/759851#M33184</guid>
      <dc:creator>SadraDehghan1</dc:creator>
      <dc:date>2020-10-05T15:24:00Z</dc:date>
    </item>
  </channel>
</rss>

