docjoby10

Zoom to Parcel

Discussion created by docjoby10 on Apr 27, 2012
Latest reply on May 7, 2012 by Tonyalmeida
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.

This is the code I have used, which selects all the parcels and then zooms to extent
the layer name is "Parcel_Link" and the Field that holds the parcel number is PIN

mxd = arcpy.mapping.MapDocument('CURRENT')
... df = arcpy.mapping.ListDataFrames(mxd, "Layers") [0]
... Parcel_Link = arcpy.mapping.ListLayers('CURRENT', Parcel_Link, df)[0]
... whereClause = "PIN ='%s'" % Parcel_Link
... arcpy.SelectLayerByAttribute_management("Parcel_Link", "NEW_SELECTION", whereClause)
... df.extent = Parcel_Link.getSelectedExtent(True)
... df.scale *= 1.5
... arcpy.RefreshActiveView()

Any input would be nice
Thanks

Joby

Outcomes