Select to view content in your preferred language

Simple Select Parcels, Buffer and Zoom too Query in ModelBuilder.. v9.3

2627
3
03-22-2011 06:06 AM
AlexGray
Deactivated User
I am trying to create a model where someone has to

  1. Enter the Parcel ID they are looking for

  2. Select all the adjacent parcels

  3. Automatically zoom to the extent of the selected parcels.

I think this is doable within Modelbuilder but its just not working..

Can't find the zoom tool to put into modelbuilder

Any help is greatly appreciated..
Thanks, Alex
0 Kudos
3 Replies
BBicking1
Esri Contributor
I am trying to create a model where someone has to

  1. Enter the Parcel ID they are looking for

  2. Select all the adjacent parcels

  3. Automatically zoom to the extent of the selected parcels.


I think this is doable within Modelbuilder but its just not working..

Can't find the zoom tool to put into modelbuilder

Any help is greatly appreciated..
Thanks, Alex



Hi Alex,

one [sniffty] way to do it is: use the CalculateValue tool with the attached code. Set a Precondition on CalcValue to the output from SelectByLoc. Btw - in SelectByLoc: for the Relationship parameter I used the "Boundary Touches" option to get all adjacant parcels.

Let me know if it works for you - it does for me.

Barbara Bicking
0 Kudos
FrankVignati
Frequent Contributor
Another way is to save this as a python script and add it to your toolbox then put it in your model with the output of the select by location as a precondition


#### Created By:  Frank
#### Created on:  03/22/2011
#### Description: Zooms to a selected elements in a layer of an MXd 

## Set the necessary product code
import arcinfo # If you do not have an ArcInfo license change this


## Import arcpy module and environment module
import arcpy
import arcpy.mapping

## Sets the MXD file, if run out of ArcMap set the full path to the MXD file ex: "C:\Workspace\Parcel_Map.mxd"
MXD = arcpy.mapping.MapDocument("CURRENT")

## Set Data Frame for the layer to select from to the data frame the selected element is in
DF = arcpy.mapping.ListDataFrames(MXD, "Layers")[0] #If the data frame name is not Layers change this


## Pan to selected features
DF.zoomToSelectedFeatures()

## Refresh data farame
arcpy.RefreshActiveView
0 Kudos
AlexGray
Deactivated User
Hi Alex,

one [sniffty] way to do it is: use the CalculateValue tool with the attached code. Set a Precondition on CalcValue to the output from SelectByLoc. Btw - in SelectByLoc: for the Relationship parameter I used the "Boundary Touches" option to get all adjacant parcels.

Let me know if it works for you - it does for me.

Barbara Bicking


Barbara,

Thanks.. this looks like I am heading in the right direction.. only problem I am running into is that arcpy.. isn't that used for ARCGIS 10? I am still using 9.3..

Its probably just a syntax problem I am running into for the zoom to selection script..

Thanks,
Alex
0 Kudos