<?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 Automating a Find and Zoom Process in Mapping Questions</title>
    <link>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568846#M6157</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am a total newbie to programming anything into Arc with little to no programming experience but I'm finding the need to be able to automate certain processes so now's as good of time as any to start learning.&amp;nbsp; The problem is, I need to get this process going ASAP, of course...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I'm trying to do seems fairly simple:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a bunch of points with unique ID's and I need to be able to export the area around these points from my base map to JPG's at multiple zoom levels.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My process might look like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Enter the unique ID into a field&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. The program/script would zoom to the point with this ID and export a JPG at two or three different scales.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can I do this in model builder or will I need to write a Python script?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Jul 2014 14:20:13 GMT</pubDate>
    <dc:creator>ib</dc:creator>
    <dc:date>2014-07-01T14:20:13Z</dc:date>
    <item>
      <title>Automating a Find and Zoom Process</title>
      <link>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568846#M6157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am a total newbie to programming anything into Arc with little to no programming experience but I'm finding the need to be able to automate certain processes so now's as good of time as any to start learning.&amp;nbsp; The problem is, I need to get this process going ASAP, of course...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I'm trying to do seems fairly simple:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a bunch of points with unique ID's and I need to be able to export the area around these points from my base map to JPG's at multiple zoom levels.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My process might look like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Enter the unique ID into a field&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. The program/script would zoom to the point with this ID and export a JPG at two or three different scales.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can I do this in model builder or will I need to write a Python script?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jul 2014 14:20:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568846#M6157</guid>
      <dc:creator>ib</dc:creator>
      <dc:date>2014-07-01T14:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: Automating a Find and Zoom Process</title>
      <link>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568847#M6158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This would probably be a python script, and from your description, you'd probably want to make a script tool, so you have an interface where you enter the ID field you want, and probably define your output name and location for the pdfs.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can do everything you want in regards to zooming to the the selected ID using the arcpy.mapping module.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a script similar to what you need if you need a good starting point to work from, though when you say little to no programming knowledge, how little is that?&amp;nbsp; The script I had need to zoom to a polygon that was added to my template map then zoom out a selected amount from that initial zoom and then export it to a pdf, while changing a few text elements in the map along the way(probably not what you need, other than the zooming to and setting scale.)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jul 2014 15:18:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568847#M6158</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2014-07-01T15:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: Automating a Find and Zoom Process</title>
      <link>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568848#M6159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I built simple websites by hand about 15 years ago, writing all of the HTML code myself- so, real simple stuff compared to Python/true programming but I think some of the same principles apply.&amp;nbsp; If I saw your script, I could least figure out how to remove the portions that I didn't need, and maybe modify them to work how I want.&amp;nbsp; I need to learn the tools for sure, and what Arc "wants" in order to run a successful script.&amp;nbsp; It sounds like in your script, instead of zooming to the polygon, I'd replace that with the ID from my metadata, for starters.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I would add a new toolbox and then add a script into it? (headslap- I know... noob!)&amp;nbsp; I tried that yesterday with random scripts and didn't quite know what the scripts did, but at least I was able to get them to start...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Would you mind posting the script here please, and I can try to import it into Arc?&amp;nbsp; Thanks for the response!&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jul 2014 17:16:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568848#M6159</guid>
      <dc:creator>ib</dc:creator>
      <dc:date>2014-07-01T17:16:42Z</dc:date>
    </item>
    <item>
      <title>Re: Automating a Find and Zoom Process</title>
      <link>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568849#M6160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To make a script tool, go to the toolbox you want in the catalog, and select add(not new, though you would think new would make sense right?), then script.&amp;nbsp; I cut down my script a bunch, trying to make it closer to what you need.&amp;nbsp; I'd do some reading up on script tools, tool parameters, so you can create your tool.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
#Importing Modules
import arcpy 


#Declaring Variables
ID = arcpy.GetParameterAsText(0)
OutputLocation = arcpy.GetParameterAsText(1)

#Assembling Map - Selecting MXD, Dataframe, and Selecting Layer by Attribute
#Creating a Map Document Object within python, referencing the .mxd you want to work with.
mxd = arcpy.mapping.MapDocument(r"put filepath to your map here")

#Once you have a map document object in python, you can access its various elements, now we need to access the dataframe the layer you are using is in.
#The line of code below makes a list of all the dataframes in the map document object we made.&amp;nbsp; The [0] returns the first dataframe in our map document, 
#if you need to access additional dataframes, you would use a different index, we now have made a dataframe object in python and can access the layers in it
df = arcpy.mapping.ListDataFrames(mxd,"*")[0]

#Now to Create a Layer Object, the line of code below returns a list of all the layers in the dataframe, with this name.&amp;nbsp; The [0] returns the first layer with that name instead of the whole list
Layer = arcpy.mapping.ListLayers(mxd, "Your Layer Name here", df)[0]

#Selecting by Attribute, Zooming to Feature, and Setting Scale
#This line performs a select by attribute on our Layer object, using a new selection, with an SQL query of ID = the ID variable we created using getparameterAsText(0)
arcpy.SelectLayerByAttribute_management(Layer, "NEW_SELECTION" , "ID = " + ID)


scales = [scale 1 here , scale 2 here, scale 3 here]
for scale in scales:
&amp;nbsp; #Selecting by Attribute, Zooming to Feature, and Setting Scale
&amp;nbsp; #This line performs a select by attribute on our Layer object, using a new selection, with an SQL query of ID = the ID variable we created using getparameterAsText(0)
&amp;nbsp; arcpy.SelectLayerByAttribute_management(Layer, "NEW_SELECTION" , "ID = " + ID)
&amp;nbsp; #This zooms the dataframe to the selected feature
&amp;nbsp; df.zoomToSelectedFeatures()
&amp;nbsp; df.scale = scale

&amp;nbsp; #Clearing selected features so they do not show up selected on map
&amp;nbsp; arcpy.SelectLayerByAttribute_management(Layer, "CLEAR_SELECTION")

&amp;nbsp; #Exporting map dataframe view to pdf, I have it set up to save
&amp;nbsp; arcpy.mapping.ExportToPDF(mxd, OutputLocation + ID + scale + ".pdf", "Page_Layout", 640, 480)

#Cleaning out memory by deleting the python objects
del mxd; del df, del Layer
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When you make the script tool, you will need to define a few input parameters, for the ID number you want and for the Output folder where you want the file, you might want one for the file name as well.&amp;nbsp; THe arcpy.GetParameterAsText takes input from the tool to be used in the script.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit: Ah heck, I went ahead and make the tool for ya, you will need to edit a few lines in the code, but otherwise should be good&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit Edit: Add the last line from the code on this thread to your script tool, by right clicking on it and selecting edit on the script tool&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:29:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568849#M6160</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2021-12-12T00:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: Automating a Find and Zoom Process</title>
      <link>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568850#M6161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ian, I appreciate what you've done for me so far but I'm still very lost.&amp;nbsp; &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/confused.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried reading the Arc help pages, plugging in parameters, running the script in Python and in Arc (and sometimes crashing it!) but I'm just not quite getting it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically all I believe that is working properly is the mxd file path.&amp;nbsp; I've been able to set the parameters to return a list of layers so I can select the one where my points/table is located that I want to search but I don't know how to set up the script or the parameters to be able to search it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached is a lame test file I made with random Lat/Long coordinates and other columns.&amp;nbsp; I'd be trying to search for numbers in the "ID" column to zoom to and print out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do I need to change the .py file for every ID that I want to search for?&amp;nbsp; That's what the SQL field is for in the parameters GUI, right?&amp;nbsp; Ugh.&amp;nbsp; So frustrating - it just hasn't clicked yet.&amp;nbsp; Any more help please?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2014 22:04:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568850#M6161</guid>
      <dc:creator>ib</dc:creator>
      <dc:date>2014-07-09T22:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: Automating a Find and Zoom Process</title>
      <link>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568851#M6162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I apologize about the first script tool I loaded, I forgot to save the script I was working on as a .py, I left it as a .txt, so it couldn't be editted from the catalog.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;From your last response you seem to want to iterate over all the ID fields in a layer, and then export PDFs of each of those IDs at 3 pre-defined zooms.&lt;/P&gt;&lt;P&gt;I fixed my script tool, and made it take 7 parameters, that way you don't need to modify the script at all(unless you want to change how they name when they export, I've made the script export with the mxd name, then ID Number, then the Scale Number, so they are all differnt names on export.&amp;nbsp; Currently the tool, will let you export them by ID one at a time, but if you need to iterate all ID's in a Layer and export them all at the same scale, then the script could be changed to do them all at once, and should be faster that way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tested this script tool this time(was in a bit of a rush last time), so it should be out of the box useable, just unzip, navigate to the toolbox in ArcCatalog, open the tool, fill in the parameters and let it run.&amp;nbsp; To fill in the Output Location, you can either navigate to it from the tool, or click and drag it to the input, same for the MXD parameter.&amp;nbsp; For the Layer Name, make sure you copy the name exactly as it shows up in the table of contents in your map document.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this does what you need, if you want it editted to do all ID's in a Layer, it should be a fairly easy adjustment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: To run the tool as is, it took my 5 year old computer about 42 seconds, hopefully yours goes a bit quicker.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 13:44:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568851#M6162</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2014-07-10T13:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: Automating a Find and Zoom Process</title>
      <link>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568852#M6163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I unzip the "Toolbox2" file, I get a "Toolbox2.tbx" and that's it.&amp;nbsp; Putting it into Arc, there's no script file in the toolbox.&amp;nbsp; Posting the Python code up here will work- I can add it to a toolbox as a script like I did the previous one.&amp;nbsp; Sorry to be a pain!&amp;nbsp; &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/plain.png" /&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*edit* Yes, I'd like to just input one ID at a time for now.&amp;nbsp; I may want to be able to enter multiple ID's in the future but never all of them at the same time.&amp;nbsp; Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 15:24:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568852#M6163</guid>
      <dc:creator>ib</dc:creator>
      <dc:date>2014-07-10T15:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: Automating a Find and Zoom Process</title>
      <link>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568853#M6164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hello Again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just unzipped a new copy of the toolbox, and the script was in there(see attached)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can go ahead and post my code, and I'll put a screenshot of how the parameters were set up as well if you want.&amp;nbsp; When you open the tbx in ArcCataog it should show a script which you can double clcik and run(incidentally, what version of ArcGIS are you running?&amp;nbsp; That can effect toolboxes).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

#Importing Modules
import arcpy 


#Declaring Variables
ID = arcpy.GetParameterAsText(0)
OutputLocation = arcpy.GetParameterAsText(1)


#Assembling Map - Selecting MXD, Dataframe, and Selecting Layer by Attribute
#Creating a Map Document Object within python, referencing the .mxd you want to work with.
mxdpath = arcpy.GetParameterAsText(2)
mxd = arcpy.mapping.MapDocument(mxdpath)
#Once you have a map document object in python, you can access its various elements, now we need to access the dataframe the layer you are using is in.
#The line of code below makes a list of all the dataframes in the map document object we made.&amp;nbsp; The [0] returns the first dataframe in our map document, 
#if you need to access additional dataframes, you would use a different index, we now have made a dataframe object in python and can access the layers in it
df = arcpy.mapping.ListDataFrames(mxd,"*")[0]
#Now to Create a Layer Object, the line of code below returns a list of all the layers in the dataframe, with this name.&amp;nbsp; The [0] returns the first layer with that name instead of the whole list
LayerName = arcpy.GetParameterAsText(3)
Layer = arcpy.mapping.ListLayers(mxd, LayerName, df)[0]


#Selecting by Attribute, Zooming to Feature, and Setting Scale
#This line performs a select by attribute on our Layer object, using a new selection, with an SQL query of ID = the ID variable we created using getparameterAsText(0)
arcpy.SelectLayerByAttribute_management(Layer, "NEW_SELECTION" , "ID = " + ID)
scale1 = arcpy.GetParameterAsText(4)
scale2 = arcpy.GetParameterAsText(5)
scale3 = arcpy.GetParameterAsText(6)


scales = [scale1, scale2, scale3]
for scale in scales:
&amp;nbsp; #Selecting by Attribute, Zooming to Feature, and Setting Scale
&amp;nbsp; #This line performs a select by attribute on our Layer object, using a new selection, with an SQL query of ID = the ID variable we created using getparameterAsText(0)
&amp;nbsp; arcpy.SelectLayerByAttribute_management(Layer, "NEW_SELECTION" , "ID = " + ID)
&amp;nbsp; #This zooms the dataframe to the selected feature
&amp;nbsp; df.zoomToSelectedFeatures()
&amp;nbsp; df.scale = scale
&amp;nbsp; #Clearing selected features so they do not show up selected on map
&amp;nbsp; arcpy.SelectLayerByAttribute_management(Layer, "CLEAR_SELECTION")
&amp;nbsp; mxdname = mxd.filePath.split("\\")[-1]
&amp;nbsp; mxdname = mxdname.replace(".mxd" , "")
&amp;nbsp; #Exporing map dataframe view to pdf, I have it set up to save
&amp;nbsp; arcpy.mapping.ExportToPDF(mxd, OutputLocation + "/" + mxdname + "ID_" + ID + scale + ".pdf", "Page_Layout", 640, 480)

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I sent a new copy of the toolbox, the two images, and the actual python script file, so you don't have to copy the code posted.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:29:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568853#M6164</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2021-12-12T00:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: Automating a Find and Zoom Process</title>
      <link>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568854#M6165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using Arc 10.1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Getting closer.... I had to convert the x,y data to a Shapefile so that there were Object ID's and it's happy about that now.&amp;nbsp; I don't want to use the OID field to select the point though, I want to use the Target "ID" field in the excel file.&amp;nbsp; I am getting the following error now:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Executing: Zoomto %1% "Z:\Bulldog\Junk\Script Test1" Z:\Bulldog\BaseMaps\ArcScriptTest.mxd ArcTests_01 10000 5000 1000&lt;/P&gt;&lt;P&gt;Start Time: Thu Jul 10 10:30:45 2014&lt;/P&gt;&lt;P&gt;Running script Zoomto...&lt;/P&gt;&lt;P&gt;&amp;lt;type 'exceptions.IndexError'&amp;gt;: list index out of range&lt;/P&gt;&lt;P&gt;Failed to execute (Zoomto).&lt;/P&gt;&lt;P&gt;Failed at Thu Jul 10 10:30:47 2014 (Elapsed Time: 2.00 seconds)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure which is out of range (zoom levels don't seem to make a difference).&amp;nbsp; I've tried to enter in my ID number in multiple ways, TAR101 or just 101 or %TAR101%, %101%, etc.... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any reason why you chose to type in the layer name vs. having a pull-down list (Parameters: Layer)? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do any of the Parameter Property values need to be changed?&amp;nbsp; I see how to make the Scales to a list with Filter:Value List. That could come in handy later...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 17:50:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568854#M6165</guid>
      <dc:creator>ib</dc:creator>
      <dc:date>2014-07-10T17:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: Automating a Find and Zoom Process</title>
      <link>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568855#M6166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh wait, "List index out of range" must mean there's something wrong with my layer name... maybe?&amp;nbsp; I only have one data frame so that shouldn't be the "list" issue.&amp;nbsp; Thinking aloud here...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*edit*&amp;nbsp; Nope.... lol.&amp;nbsp; New layer name didn't help. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 17:59:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568855#M6166</guid>
      <dc:creator>ib</dc:creator>
      <dc:date>2014-07-10T17:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: Automating a Find and Zoom Process</title>
      <link>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568856#M6167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Its crashing prior to the Select by Attribute, when its making the layer object. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I changed the Layer Name Parameter to a Layer type, and it still ran, so if you want to do it that way it should work.&amp;nbsp; I made it as a string originally so it could be run in ArcCatalog(which seems to speed up geoprocessing opposed to ArcMap, if you knew python better, you would just be able to change the varialbes and it could run outside of Arc entirely, which would make it even faster, but oh well.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Btw, this script is made to work only if your Layer has a field called ID, not FID or OID or anything different from that, and it should be able to handle all characters for the ID value, just make it what it shows in the attribute table.&amp;nbsp; Also the layer must already be in a saved mxd file if that wasn't clear before.&amp;nbsp; Also remember python is case sensitive so if the Layer Name is Arctest_01, it will crash for ArcTest_01.&amp;nbsp; For the ID number just enter as it shows in the attribute table, no other characters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tested this on two map documents and it should work fine.&amp;nbsp; If you want to change the Layer Parameters thats fine, it worked both ways for me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 18:26:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568856#M6167</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2014-07-10T18:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: Automating a Find and Zoom Process</title>
      <link>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568857#M6168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SUCCESS!!!!!!&amp;nbsp; &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/grin.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script was having issues with "FID" and "ID" being in two columns, so I changed all of the ID's to FID's and it worked!&amp;nbsp; Thank you so much!&amp;nbsp; Now that it's working, I can go and start modifying it and breaking it again.&amp;nbsp; &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/laugh.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm seeing how all of this works now and starting to understand the functions.&amp;nbsp; Thank you so very much for taking the time to work through this (really, to do it) for me. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll play with it a bit and come back to this thread if I get more functionality out of it (or if I'm having trouble- lol).&amp;nbsp; Again, thanks a ton!&amp;nbsp; I look forward to expanding upon what I have and will learn from this script.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 21:14:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568857#M6168</guid>
      <dc:creator>ib</dc:creator>
      <dc:date>2014-07-10T21:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: Automating a Find and Zoom Process</title>
      <link>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568858#M6169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad you got it worked out! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you got any other questions about it, feel free to ask them here, or you can post stuff in &lt;A href="https://community.esri.com/group/1164"&gt;Python&lt;/A&gt;‌ and &lt;A href="https://community.esri.com/space/2059"&gt;GIS Developers&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also with the new system be sure to tag your post python if you got python related questions so people can find them easier.‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 21:27:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568858#M6169</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2014-07-10T21:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: Automating a Find and Zoom Process</title>
      <link>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568859#M6170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ian. I can not speak English. I am translating with google. I am very interested in adapting your script. Features-I have a class and I've added a field ID String. But when I run I get an error that I believe is in the syntax of the Query. To work with a personal geodatabase. I get the following error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "D:\A-Fichas\ZoomToID.py\ZoomToID.py", line 23, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByAttribute_management(Layer, "NEW_SELECTION" , "ID = " + ID)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\management.py", line 6494, in SelectLayerByAttribute&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e&lt;/P&gt;&lt;P&gt;ExecuteError: ERROR 000358: Expresión no válida&lt;/P&gt;&lt;P&gt;Falló al ejecutar (SelectLayerByAttribute).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Falló al ejecutar (ZoomToSelectedID).&lt;/P&gt;&lt;P&gt;Error el Tue Jul 15 12:01:25 2014 (Tiempo transcurrido: 0,56 segundos)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could clarify the syntax of the query?. Thank you very much from Spain.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jul 2014 10:03:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568859#M6170</guid>
      <dc:creator>CesarMediavilla</dc:creator>
      <dc:date>2014-07-15T10:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: Automating a Find and Zoom Process</title>
      <link>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568860#M6171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Cesar,&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's likely due to the fact that geodatabase field names must be in brackets for SQL expressions. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this instead for that line of code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.SelectLayerByAttribute_management(Layer, "NEW_SELECTION" , "[ID] = " + ID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not at a computer where I can check it right now.&amp;nbsp; Also check the link below about making SQL expressions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s500000033000000" title="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s500000033000000"&gt;ArcGIS Desktop&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jul 2014 16:23:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568860#M6171</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2014-07-15T16:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: Automating a Find and Zoom Process</title>
      <link>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568861#M6172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ian, thank you very much for your help. The program no longer runs but I do not select any item. I will try new syntax to see if it works. I'll tell you. Thank you very much again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jul 2014 11:51:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568861#M6172</guid>
      <dc:creator>CesarMediavilla</dc:creator>
      <dc:date>2014-07-16T11:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Automating a Find and Zoom Process</title>
      <link>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568862#M6173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ian. Another question, please. How do I know the number of selected elements with SelectLayerByAttribute_management?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Thank you very much&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2014 08:08:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568862#M6173</guid>
      <dc:creator>CesarMediavilla</dc:creator>
      <dc:date>2014-07-17T08:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Automating a Find and Zoom Process</title>
      <link>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568863#M6174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ian:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm a novice programmer, interested in iterating an entire list through the find and zoom process.&lt;/P&gt;&lt;P&gt;I know this was asked in the same series of threads, but the version was never posted. I would appreciate your guidance when you have a moment&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gary&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Aug 2015 12:08:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568863#M6174</guid>
      <dc:creator>GaryChedore</dc:creator>
      <dc:date>2015-08-24T12:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: Automating a Find and Zoom Process</title>
      <link>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568864#M6175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gary,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Could you be a little more clear with what you were wanting to do?&amp;nbsp; Are you wanting to iterate through a list of feature and export out for each one of them at different scales?&amp;nbsp; I could gladly help out with something like that, in fact looking over the original script now I'm finding a few ways to make it work easier for people and more efficient.&amp;nbsp; The more information you can give the better.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Aug 2015 12:48:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568864#M6175</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2015-08-24T12:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: Automating a Find and Zoom Process</title>
      <link>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568865#M6176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the quick reply:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes.. I have a list of mapgrid Id's which if I could go to export each of them at one or more scales simply by using a text file or .csv file to load them in or some other simpler method within the database, great.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did this over the weekend and it took some time thankfully your program cut that time drastically, but I wondered how much tweaking it may require to pull in the list and run off all pdfs for 33 records at 25000, 50000, and 100000 scales.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clear enough yet?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gary&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Aug 2015 15:30:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/automating-a-find-and-zoom-process/m-p/568865#M6176</guid>
      <dc:creator>GaryChedore</dc:creator>
      <dc:date>2015-08-24T15:30:26Z</dc:date>
    </item>
  </channel>
</rss>

