Im have been trying to make a model in 9.3 that will select a polygon by attributes and then zoom to the selected. Once created I plan to add the tool to a .net web app to facilitate user quarry and zoom capability.
I have the selection part ok, but cant get the zoom to selected. I found the python script to do in in 10, but our server is still using 9.3.
Any help with python code or python code to call a VB script (and the VB script) or if there any other way would be greatly appreciated.
Thanks, Mike
import sys, string, os, arcgisscripting
## create the geoprocessor object ##
gp = arcgisscripting.create()
## Load required toolboxes ##
# gp.addtoolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx
# set workspace
# arcpy.env.workspace = "C:/temp/"
# mxd = MapDocument('CURRENT')
# df = ListDataFrames(mxd,"Layers")[0]
# Script arguments
section = gp.GetParameterAsText(0)
township = gp.GetParameterAsText(1)
range_ = gp.GetParameterAsText(2)
range_dir = gp.GetParameterAsText(3)
# Local variables:
PLSS = "PLSS"
#### Use the SelectLayerByAttribute tool to select a Section
gp.SelectLayerByAttribute_management(PLSS, "NEW_SELECTION", "\"SECTION\" = "+section)
gp.SelectLayerByAttribute_management(PLSS, "SUBSET_SELECTION", "\"TOWNSHIP\" = "+township)
# arcpy.SelectLayerByAttribute_management(PLSS, "SUBSET_SELECTION", "\"TOWNSHIP_D\" = S")
gp.SelectLayerByAttribute_management(PLSS, "SUBSET_SELECTION", "\"RANGE\" = "+range_)
gp.SelectLayerByAttribute_management(PLSS, "SUBSET_SELECTION", "\"RANGE_dir\" = "+range_dir)
#Zoom to selected features in the map
--------- HELP NEEDED HERE !! -------------
# Clear the selection and refresh the active view
gp.SelectLayerByAttribute_management(PLSS, "CLEAR_SELECTION")
gp.RefreshActiveView(