<?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: How to create a Python Toolbox or ModelBuilder used for finding latitude, longitude in basemap and zooming in 500 meters. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-create-a-python-toolbox-or-modelbuilder/m-p/1014216#M59418</link>
    <description>&lt;P&gt;You could try something like the following. The script is inspired by &lt;A href="https://community.esri.com/t5/arcgis-pro-questions/arcpy-zoom-to-point/m-p/235985/highlight/true#M10274" target="_blank" rel="noopener"&gt;this question&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Please note I did not get the scale property to work, so you could try specifying your own scale.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy
currentProject = arcpy.mp.ArcGISProject('current')
activeObject = currentProject.activeView
x = float(arcpy.GetParameterAsText(0))
y = float(arcpy.GetParameterAsText(1))
yourScale = float(arcpy.GetParameterAsText(2))
xMin = x-yourScale
yMin = y-yourScale
xMax = x+yourScale
yMax = y+yourScale
extent = arcpy.Extent(xMin,yMin,xMax,yMax)
activeObject.camera.setExtent(extent)&lt;/LI-CODE&gt;&lt;P&gt;Some notes:&lt;/P&gt;&lt;P&gt;- This script assumes you are working in the map you wish to change the view in.&lt;/P&gt;&lt;P&gt;- You can enter the coordinates by hand (hence the GetParameterAsText for x and y) and it assumes you already know the coordinates you are looking for (for example from an Excel file).&lt;/P&gt;&lt;P&gt;- The scale is used to create a square of sorts to set the extent. You may have to alter this to suit your needs.&lt;/P&gt;&lt;P&gt;- The scale is now published as parameter. You could hardcode this or provide a default value.&lt;/P&gt;&lt;P&gt;If this is not really what you are looking for, could you please elaborate what the script should do?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Jan 2021 09:51:35 GMT</pubDate>
    <dc:creator>Erwinvan_Veen1</dc:creator>
    <dc:date>2021-01-06T09:51:35Z</dc:date>
    <item>
      <title>How to create a Python Toolbox or ModelBuilder used for finding latitude, longitude in basemap and zooming in 500 meters.</title>
      <link>https://community.esri.com/t5/python-questions/how-to-create-a-python-toolbox-or-modelbuilder/m-p/1014195#M59417</link>
      <description>&lt;P&gt;How to create a Python Toolbox or ModelBuilder in ArcGIS Pro used for finding latitude, longitude in basemap &lt;SPAN&gt;And when the search is complete, zoom in at 500 meters.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 07:47:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-create-a-python-toolbox-or-modelbuilder/m-p/1014195#M59417</guid>
      <dc:creator>nutchanaka</dc:creator>
      <dc:date>2021-01-06T07:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a Python Toolbox or ModelBuilder used for finding latitude, longitude in basemap and zooming in 500 meters.</title>
      <link>https://community.esri.com/t5/python-questions/how-to-create-a-python-toolbox-or-modelbuilder/m-p/1014216#M59418</link>
      <description>&lt;P&gt;You could try something like the following. The script is inspired by &lt;A href="https://community.esri.com/t5/arcgis-pro-questions/arcpy-zoom-to-point/m-p/235985/highlight/true#M10274" target="_blank" rel="noopener"&gt;this question&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Please note I did not get the scale property to work, so you could try specifying your own scale.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy
currentProject = arcpy.mp.ArcGISProject('current')
activeObject = currentProject.activeView
x = float(arcpy.GetParameterAsText(0))
y = float(arcpy.GetParameterAsText(1))
yourScale = float(arcpy.GetParameterAsText(2))
xMin = x-yourScale
yMin = y-yourScale
xMax = x+yourScale
yMax = y+yourScale
extent = arcpy.Extent(xMin,yMin,xMax,yMax)
activeObject.camera.setExtent(extent)&lt;/LI-CODE&gt;&lt;P&gt;Some notes:&lt;/P&gt;&lt;P&gt;- This script assumes you are working in the map you wish to change the view in.&lt;/P&gt;&lt;P&gt;- You can enter the coordinates by hand (hence the GetParameterAsText for x and y) and it assumes you already know the coordinates you are looking for (for example from an Excel file).&lt;/P&gt;&lt;P&gt;- The scale is used to create a square of sorts to set the extent. You may have to alter this to suit your needs.&lt;/P&gt;&lt;P&gt;- The scale is now published as parameter. You could hardcode this or provide a default value.&lt;/P&gt;&lt;P&gt;If this is not really what you are looking for, could you please elaborate what the script should do?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 09:51:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-create-a-python-toolbox-or-modelbuilder/m-p/1014216#M59418</guid>
      <dc:creator>Erwinvan_Veen1</dc:creator>
      <dc:date>2021-01-06T09:51:35Z</dc:date>
    </item>
  </channel>
</rss>

