<?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: Use Python to zoom into Active Data Frame in ModelBuilder Questions</title>
    <link>https://community.esri.com/t5/modelbuilder-questions/use-python-to-zoom-into-active-data-frame/m-p/774544#M1888</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It redraws but it does not appear to be resulting in the desired behavior (zoom into the new map extent).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 May 2018 22:27:01 GMT</pubDate>
    <dc:creator>RichardDaniels</dc:creator>
    <dc:date>2018-05-03T22:27:01Z</dc:date>
    <item>
      <title>Use Python to zoom into Active Data Frame</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/use-python-to-zoom-into-active-data-frame/m-p/774542#M1886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to automate some tasks for unit test. Once of these tasks is zooming into a map a fixed amount and forcing ArcMap to redraw at the new extent. The Data Frame is named Raster Data Sets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The display is refreshing but it does not appear to honor the panToExtent() method. The AddMessage command shows that the value for the&amp;nbsp;extent class was changed as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;zoomScale=arcpy.GetParameterAsText(0)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;mxd = arcpy.mapping.MapDocument("CURRENT")&lt;BR /&gt;df = arcpy.mapping.ListDataFrames(mxd, "Raster Data Sets")[0] &lt;BR /&gt;lyr = arcpy.mapping.ListLayers(mxd, 'County Boundaries*', df)[0] &lt;BR /&gt;ext = lyr.getExtent() &lt;BR /&gt;arcpy.AddMessage("Old xmin, ymin, xmax, ymax: " + str(ext.XMin) + ", " + str(ext.YMin) + ", " + str(ext.XMax) + ", " + str(ext.YMax))&lt;/P&gt;&lt;P&gt;# change extent&lt;BR /&gt;temp = ext.XMin + float(zoomScale)&lt;BR /&gt;ext.XMin = temp&lt;BR /&gt;temp = ext.YMin + float(zoomScale)&lt;BR /&gt;ext.YMin =&amp;nbsp; temp&lt;BR /&gt;temp = ext.XMax - float(zoomScale)&lt;BR /&gt;ext.XMax = temp&lt;BR /&gt;temp = ext.YMax - float(zoomScale)&lt;BR /&gt;ext.YMax = temp&lt;BR /&gt;arcpy.AddMessage("New xmin, ymin, xmax, ymax: " + str(ext.XMin) + ", " + str(ext.YMin) + ", " + str(ext.XMax) + ", " + str(ext.YMax))&lt;/P&gt;&lt;P&gt;df.panToExtent(ext)&lt;BR /&gt;arcpy.RefreshActiveView()&lt;/P&gt;&lt;P&gt;sys.argv[2]=True&lt;BR /&gt;arcpy.SetParameter(1,"True")&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2018 17:49:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/use-python-to-zoom-into-active-data-frame/m-p/774542#M1886</guid>
      <dc:creator>RichardDaniels</dc:creator>
      <dc:date>2018-05-03T17:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: Use Python to zoom into Active Data Frame</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/use-python-to-zoom-into-active-data-frame/m-p/774543#M1887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So it doesn't recenter?&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #4c4c4c; font-family: 'Avenir Next W01','Avenir Next W00','Avenir Next','Avenir','Helvetica Neue',sans-serif; font-size: 14.8px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: 0px; 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;Pans and centers the &lt;/SPAN&gt;&lt;SPAN style="background-color: transparent; color: #4c4c4c; font-family: &amp;amp;quot; consolas&amp;amp;quot;,&amp;amp;quot;andale mono&amp;amp;quot;,&amp;amp;quot;lucida console&amp;amp;quot;,&amp;amp;quot;monaco&amp;amp;quot;,monospace; font-size: 14.8px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: 0px; 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;MapFrame&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #4c4c4c; font-family: 'Avenir Next W01','Avenir Next W00','Avenir Next','Avenir','Helvetica Neue',sans-serif; font-size: 14.8px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: 0px; 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; using a new &lt;/SPAN&gt;&lt;A href="http://pro.arcgis.com/en/pro-app/arcpy/classes/extent.htm" style="background-color: transparent; color: #0074b8; 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: 14.8px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: 0px; 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;Extent&lt;/A&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #4c4c4c; font-family: 'Avenir Next W01','Avenir Next W00','Avenir Next','Avenir','Helvetica Neue',sans-serif; font-size: 14.8px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: 0px; 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; object without changing the map frame's scale.&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2018 21:02:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/use-python-to-zoom-into-active-data-frame/m-p/774543#M1887</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-05-03T21:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: Use Python to zoom into Active Data Frame</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/use-python-to-zoom-into-active-data-frame/m-p/774544#M1888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It redraws but it does not appear to be resulting in the desired behavior (zoom into the new map extent).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2018 22:27:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/use-python-to-zoom-into-active-data-frame/m-p/774544#M1888</guid>
      <dc:creator>RichardDaniels</dc:creator>
      <dc:date>2018-05-03T22:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Use Python to zoom into Active Data Frame</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/use-python-to-zoom-into-active-data-frame/m-p/774545#M1889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you might have a weird combo of extents... give&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 17px; font-style: normal; font-variant: normal; font-weight: 500; letter-spacing: 0px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre-wrap; word-spacing: 0px;"&gt;zoomToAllLayers ({selection_only}, {symbolized_extent})&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 17px; font-style: normal; font-variant: normal; font-weight: 500; letter-spacing: 0px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre-wrap; word-spacing: 0px;"&gt;from &lt;A href="http://pro.arcgis.com/en/pro-app/arcpy/mapping/mapframe-class.htm"&gt;http://pro.arcgis.com/en/pro-app/arcpy/mapping/mapframe-class.htm&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #4c4c4c; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 17px; font-style: normal; font-variant: normal; font-weight: 500; letter-spacing: 0px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre-wrap; word-spacing: 0px;"&gt;there is an equivalent for arcmap's arcpy mapping module&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2018 22:40:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/use-python-to-zoom-into-active-data-frame/m-p/774545#M1889</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-05-03T22:40:51Z</dc:date>
    </item>
  </channel>
</rss>

