<?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: Search attribute and zoom to selected in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/search-attribute-and-zoom-to-selected/m-p/386269#M30475</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here is what I used. Not sure if it is perfect, but it works for me...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy, arcgisscripting
gp = arcgisscripting.create()
mxd = arcpy.mapping.MapDocument('CURRENT')
df = arcpy.mapping.ListDataFrames(mxd, "Layers") [0]
Parcel = gp.GetParameterAsText(0)
whereClause = "GEOCODE ='%s'" % Parcel
arcpy.SelectLayerByAttribute_management ("Parcels", "NEW_SELECTION", whereClause)


showMessage("Parcel not found. Please try again.")

df.zoomToSelectedFeatures()
arcpy.RefreshActiveView()&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 17:45:13 GMT</pubDate>
    <dc:creator>MatthewCory</dc:creator>
    <dc:date>2021-12-11T17:45:13Z</dc:date>
    <item>
      <title>Search attribute and zoom to selected</title>
      <link>https://community.esri.com/t5/python-questions/search-attribute-and-zoom-to-selected/m-p/386264#M30470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So, I am completely new to Python, I do have experience in VBA but this is getting me tripped up. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I did get a script to work to select by attribute and zoom to the selected. I do have everything hard coded in but do want to have the geocode as a variable that the user inputs to a dialog box. I think I have the whole variable thing figured out. My issue is getting the input box for the user. Everything I have been able to find is confusing and I can't get to work. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If someone could point me in a direction to find some help related to getting a dialog box for the user to input the geocode then run the script I would be very appreciative.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Apr 2012 14:19:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/search-attribute-and-zoom-to-selected/m-p/386264#M30470</guid>
      <dc:creator>MatthewCory</dc:creator>
      <dc:date>2012-04-06T14:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: Search attribute and zoom to selected</title>
      <link>https://community.esri.com/t5/python-questions/search-attribute-and-zoom-to-selected/m-p/386265#M30471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you have a command line, raw_input() is quick and dirty.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Python GUI graphics start with Tkinter, which is relativly simple.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Although they can get a lot more complex and sophistcated from there, Tkinter is the place to start.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Apr 2012 14:31:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/search-attribute-and-zoom-to-selected/m-p/386265#M30471</guid>
      <dc:creator>markdenil</dc:creator>
      <dc:date>2012-04-06T14:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: Search attribute and zoom to selected</title>
      <link>https://community.esri.com/t5/python-questions/search-attribute-and-zoom-to-selected/m-p/386266#M30472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the quick reply. Do I really need something like that? It will be more like a tool, isn't there a way to use what Arcmap has already?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Apr 2012 14:38:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/search-attribute-and-zoom-to-selected/m-p/386266#M30472</guid>
      <dc:creator>MatthewCory</dc:creator>
      <dc:date>2012-04-06T14:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: Search attribute and zoom to selected</title>
      <link>https://community.esri.com/t5/python-questions/search-attribute-and-zoom-to-selected/m-p/386267#M30473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you are making the script a tool, then include the input as a parameter.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;That way, the tool dialog will have an input field that can be configured in the tool set up process.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;See Creating script tools for geoprocessing tasks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Apr 2012 14:46:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/search-attribute-and-zoom-to-selected/m-p/386267#M30473</guid>
      <dc:creator>markdenil</dc:creator>
      <dc:date>2012-04-06T14:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: Search attribute and zoom to selected</title>
      <link>https://community.esri.com/t5/python-questions/search-attribute-and-zoom-to-selected/m-p/386268#M30474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I also have a select and zoom to model/python script, and it works inside arcmap, but the service will not zoom to the select feature once inside a gp service.&amp;nbsp; can you possibly provide the code you used for the zoom to selected?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2012 16:50:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/search-attribute-and-zoom-to-selected/m-p/386268#M30474</guid>
      <dc:creator>DougKnight</dc:creator>
      <dc:date>2012-04-18T16:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: Search attribute and zoom to selected</title>
      <link>https://community.esri.com/t5/python-questions/search-attribute-and-zoom-to-selected/m-p/386269#M30475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here is what I used. Not sure if it is perfect, but it works for me...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy, arcgisscripting
gp = arcgisscripting.create()
mxd = arcpy.mapping.MapDocument('CURRENT')
df = arcpy.mapping.ListDataFrames(mxd, "Layers") [0]
Parcel = gp.GetParameterAsText(0)
whereClause = "GEOCODE ='%s'" % Parcel
arcpy.SelectLayerByAttribute_management ("Parcels", "NEW_SELECTION", whereClause)


showMessage("Parcel not found. Please try again.")

df.zoomToSelectedFeatures()
arcpy.RefreshActiveView()&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:45:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/search-attribute-and-zoom-to-selected/m-p/386269#M30475</guid>
      <dc:creator>MatthewCory</dc:creator>
      <dc:date>2021-12-11T17:45:13Z</dc:date>
    </item>
  </channel>
</rss>

