<?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: Zoom to Parcel in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/zoom-to-parcel/m-p/39904#M3189</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;mzcoyle&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you elaborate a little on what "pu" is and how do we change what you have for this script to work for us?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can we see a pic of your parameters for this script?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for he script.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 May 2012 14:16:47 GMT</pubDate>
    <dc:creator>TonyAlmeida</dc:creator>
    <dc:date>2012-05-04T14:16:47Z</dc:date>
    <item>
      <title>Zoom to Parcel</title>
      <link>https://community.esri.com/t5/python-questions/zoom-to-parcel/m-p/39900#M3185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to find an add-in that allows me to enter a parcel#, select, then zoom to that parcel. I have seen "zoom to attribute" examples but nothing that allows me to enter parcel numbers. The add-in would be used by me to zoom to the parcel without having to open attribute table find the parcel number (out of thousands) then zoom to.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is the code I have used, which selects all the parcels and then zooms to extent &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the layer name is "Parcel_Link" and the Field that holds the parcel number is PIN &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd = arcpy.mapping.MapDocument('CURRENT')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;... df = arcpy.mapping.ListDataFrames(mxd, "Layers") [0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;... Parcel_Link = arcpy.mapping.ListLayers('CURRENT', Parcel_Link, df)[0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;... whereClause = "PIN ='%s'" % Parcel_Link&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;... arcpy.SelectLayerByAttribute_management("Parcel_Link", "NEW_SELECTION", whereClause)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;... df.extent = Parcel_Link.getSelectedExtent(True)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;... df.scale *= 1.5&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;... arcpy.RefreshActiveView()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any input would be nice&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Joby&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2012 15:08:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zoom-to-parcel/m-p/39900#M3185</guid>
      <dc:creator>JobyClark</dc:creator>
      <dc:date>2012-04-27T15:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to Parcel</title>
      <link>https://community.esri.com/t5/python-questions/zoom-to-parcel/m-p/39901#M3186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I hear your frustration, i don't understand why ESRI is not going to be using VBA anymore.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2012 21:13:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zoom-to-parcel/m-p/39901#M3186</guid>
      <dc:creator>TonyAlmeida</dc:creator>
      <dc:date>2012-04-27T21:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to Parcel</title>
      <link>https://community.esri.com/t5/python-questions/zoom-to-parcel/m-p/39902#M3187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I hear your frustration, i don't understand why ESRI is not going to be using VBA anymore.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Because VBA is no longer going to be supported by Microsoft.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you are interested you can read details on it here to garner an understanding.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://blogs.esri.com/esri/arcgis/2009/03/30/vba-and-vb6-the-road-ahead/"&gt;http://blogs.esri.com/esri/arcgis/2009/03/30/vba-and-vb6-the-road-ahead/&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2012 20:57:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zoom-to-parcel/m-p/39902#M3187</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2012-04-30T20:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to Parcel</title>
      <link>https://community.esri.com/t5/python-questions/zoom-to-parcel/m-p/39903#M3188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I'm trying to find an add-in that allows me to enter a parcel#, select, then zoom to that parcel. I have seen "zoom to attribute" examples but nothing that allows me to enter parcel numbers. The add-in would be used by me to zoom to the parcel without having to open attribute table find the parcel number (out of thousands) then zoom to.&lt;BR /&gt;&lt;BR /&gt;This is the code I have used, which selects all the parcels and then zooms to extent &lt;BR /&gt;the layer name is "Parcel_Link" and the Field that holds the parcel number is PIN &lt;BR /&gt;&lt;BR /&gt;mxd = arcpy.mapping.MapDocument('CURRENT')&lt;BR /&gt;... df = arcpy.mapping.ListDataFrames(mxd, "Layers") [0]&lt;BR /&gt;... Parcel_Link = arcpy.mapping.ListLayers('CURRENT', Parcel_Link, df)[0]&lt;BR /&gt;... whereClause = "PIN ='%s'" % Parcel_Link&lt;BR /&gt;... arcpy.SelectLayerByAttribute_management("Parcel_Link", "NEW_SELECTION", whereClause)&lt;BR /&gt;... df.extent = Parcel_Link.getSelectedExtent(True)&lt;BR /&gt;... df.scale *= 1.5&lt;BR /&gt;... arcpy.RefreshActiveView()&lt;BR /&gt;&lt;BR /&gt;Any input would be nice&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Joby&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is a script I use to zoom to an attribute passed from a script tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
arcpy.AddMessage("Starting")
pu = arcpy.GetParameterAsText(0)
arcpy.AddMessage(pu)
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd, "Main Map")[0]
lyr = arcpy.mapping.ListLayers(mxd, "PLANNING UNIT", df)[0]
arcpy.AddMessage(lyr.name)
expression = "PLANNINGUNIT = '"+pu+"'"
arcpy.AddMessage(expression)
arcpy.SelectLayerByAttribute_management(lyr,"NEW_SELECTION",expression)
df.extent = lyr.getSelectedExtent()
df.scale = df.scale*1.1
for elm in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT", "PU"):
&amp;nbsp;&amp;nbsp;&amp;nbsp; if elm.name == "PU":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; elm.text = (pu)
arcpy.SelectLayerByAttribute_management(lyr,"CLEAR_SELECTION")
arcpy.RefreshActiveView()
arcpy.AddMessage("Completed")

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:33:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zoom-to-parcel/m-p/39903#M3188</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2021-12-10T21:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to Parcel</title>
      <link>https://community.esri.com/t5/python-questions/zoom-to-parcel/m-p/39904#M3189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;mzcoyle&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you elaborate a little on what "pu" is and how do we change what you have for this script to work for us?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can we see a pic of your parameters for this script?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for he script.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 14:16:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zoom-to-parcel/m-p/39904#M3189</guid>
      <dc:creator>TonyAlmeida</dc:creator>
      <dc:date>2012-05-04T14:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to Parcel</title>
      <link>https://community.esri.com/t5/python-questions/zoom-to-parcel/m-p/39905#M3190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;pu is just the variable name you are passing, short for planning unit in this case. The parameter is just a string that is searched for in the field "PLANNINGUNIT", in layer "PLANNING UNIT" in data frame "Main Map" in the current mxd. It also changes the layout text object named "PU" to the searched string.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2012 12:09:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zoom-to-parcel/m-p/39905#M3190</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2012-05-07T12:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to Parcel</title>
      <link>https://community.esri.com/t5/python-questions/zoom-to-parcel/m-p/39906#M3191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;mzcoyle would you mind sharing your toolbox with this script please? I would really appropriate it allot.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your response.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2012 16:35:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zoom-to-parcel/m-p/39906#M3191</guid>
      <dc:creator>TonyAlmeida</dc:creator>
      <dc:date>2012-05-07T16:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to Parcel</title>
      <link>https://community.esri.com/t5/python-questions/zoom-to-parcel/m-p/39907#M3192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;you also said to "Add it to a toolbox and then make it a button." &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/38985-Creating-a-Custom-Toolbar-Button?highlight=zoom+parcel"&gt;http://forums.arcgis.com/threads/38985-Creating-a-Custom-Toolbar-Button?highlight=zoom+parcel&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How to you make a toolbox into a button in ArcMap? what exactly did you mean?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-size:4;"&gt;&lt;STRONG&gt;Never mind&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Figured it out. under customize /geoprocessing tools, add tools then you and the script.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2012 17:37:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zoom-to-parcel/m-p/39907#M3192</guid>
      <dc:creator>TonyAlmeida</dc:creator>
      <dc:date>2012-05-07T17:37:59Z</dc:date>
    </item>
  </channel>
</rss>

