Select to view content in your preferred language

Project Select Tools

364
0
10-31-2019 08:20 AM
GarrettSeay1
New Contributor III

What does everyone do for selecting all assets associated for their projects quickly?

I wanted to share what I create to do so:

1. Create a Project select model:

In my current database each layer has a project # (Project_Num) field which feeds this model. Each layer I would like to select from I have placed in this model tied to the Select Layer By Attribute tool with the same expression tied to all.The only parameter is my expression of Project_Num = '****'.

2. Zoom to selected Project:

After I added all the layers and tied them to the expression I added a script to zoom to the select features to get to an area fast by typing in the Project #. Here is the code for that (created in Notepad and dragged in the model last):

import arcpy
mxd = arcpy.mapping.MapDocument('CURRENT')
df = arcpy.mapping.ListDataFrames(mxd, "Layers") [0]
df.zoomToSelectedFeatures()
arcpy.RefreshActiveView()

3. Making it to a tool for all to use:

I wanted this to be a tool all my GIS users could use so I decided to add it to a custom tool bar. This is easy to do by:

   

   1. Right click in blank area of ArcMap where you add a different tool bar.

   2. Click Customize.

   3. In the Toolbars tab click New... and name your toolbar.

   4. Go to the Commands tab.

   5. In Categories scroll down to [ Geoprocessing Tools ] and click it.

   6. Click Add Tools..., then locate your model and add it (It will appear in the Commands window.

   7. Exit out and add your new tool bar, the go back into Customize > Commands and drag your created tool from the        Commands window to the new toolbar.

   **While in Customize you can click on your tool to change the name and image, such as .

Let me know what you do!

0 Replies