<?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 Toolbox - set extent working when run through IDE, not when run through toolbox in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-toolbox-set-extent-working-when-run-through/m-p/1198337#M65114</link>
    <description>&lt;P&gt;Having an odd issue with a python toolbox that I'm assuming is related to parameter validation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Overview...&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;toolbox iterates through an input layer in a map layout&lt;/LI&gt;&lt;LI&gt;for each record in the input layer, def query is set (i.e. OID = 1), and extent object of the layer w/ def query is retrieved through temp_extent = mapframe.getLayerExtent()&lt;/LI&gt;&lt;LI&gt;map frame in the layout is panned to the record by using mapframe.setExtent(temp_extent)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Issue:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;if I'm executing code through my IDE (VS Code) functionality is fine. camera.x and camera.y coordinates are updating as they should be.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;If i'm running as a python toolbox in ArcGIS Pro (2.9.3) camera coordinates are not being set properly, only being set to (0,0)&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm following the recommended debug workflow as listed here&amp;nbsp;&lt;A href="https://www.esri.com/arcgis-blog/products/arcgis-desktop/analytics/how-to-debug-python-toolboxes-in-3-easy-steps/" target="_blank"&gt;https://www.esri.com/arcgis-blog/products/arcgis-desktop/analytics/how-to-debug-python-toolboxes-in-3-easy-steps/&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This was working fine in 2.8.3 but not after we updated to 2.9.3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Aug 2022 00:41:19 GMT</pubDate>
    <dc:creator>I_AM_ERROR</dc:creator>
    <dc:date>2022-08-02T00:41:19Z</dc:date>
    <item>
      <title>Python Toolbox - set extent working when run through IDE, not when run through toolbox</title>
      <link>https://community.esri.com/t5/python-questions/python-toolbox-set-extent-working-when-run-through/m-p/1198337#M65114</link>
      <description>&lt;P&gt;Having an odd issue with a python toolbox that I'm assuming is related to parameter validation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Overview...&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;toolbox iterates through an input layer in a map layout&lt;/LI&gt;&lt;LI&gt;for each record in the input layer, def query is set (i.e. OID = 1), and extent object of the layer w/ def query is retrieved through temp_extent = mapframe.getLayerExtent()&lt;/LI&gt;&lt;LI&gt;map frame in the layout is panned to the record by using mapframe.setExtent(temp_extent)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Issue:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;if I'm executing code through my IDE (VS Code) functionality is fine. camera.x and camera.y coordinates are updating as they should be.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;If i'm running as a python toolbox in ArcGIS Pro (2.9.3) camera coordinates are not being set properly, only being set to (0,0)&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm following the recommended debug workflow as listed here&amp;nbsp;&lt;A href="https://www.esri.com/arcgis-blog/products/arcgis-desktop/analytics/how-to-debug-python-toolboxes-in-3-easy-steps/" target="_blank"&gt;https://www.esri.com/arcgis-blog/products/arcgis-desktop/analytics/how-to-debug-python-toolboxes-in-3-easy-steps/&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This was working fine in 2.8.3 but not after we updated to 2.9.3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 00:41:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-toolbox-set-extent-working-when-run-through/m-p/1198337#M65114</guid>
      <dc:creator>I_AM_ERROR</dc:creator>
      <dc:date>2022-08-02T00:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: Python Toolbox - set extent working when run through IDE, not when run through toolbox</title>
      <link>https://community.esri.com/t5/python-questions/python-toolbox-set-extent-working-when-run-through/m-p/1198452#M65120</link>
      <description>&lt;P&gt;That is frustrating when it works before an upgrade but not after.&amp;nbsp; Sharing your code would help find what the issue may be.&lt;/P&gt;&lt;P&gt;I take it you mean mapframe.camera.setExtent(...)?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 12:31:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-toolbox-set-extent-working-when-run-through/m-p/1198452#M65120</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-08-02T12:31:18Z</dc:date>
    </item>
  </channel>
</rss>

