Python add-in Custom Search toolbar

6187
7
09-04-2014 12:24 PM

Python add-in Custom Search toolbar

This ZIP file contains the XML, python code, and toolbar button images I used to create a custom search (& zoom to) toolbar in ArcMap 10.2 as a Python add-in.  The toolbar has a button "pick-list" and 2 combo boxes.  When you select the button from the pick list, both comboboxes are cleared of any values, the second combox is disabled and the first combobox is populated with unique values from a specific field (or fields).  When you select a value from the first combobox, either it will zoom to a specific feature or enable the second combobox and populate with values.  When a value is selected from the second combobox the view will zoom to the feature.  For example, there are single combo box searches for a customer name, address, E911ID, phone number, CentralOffice name, PON cabinet name, DLC name, or Exchange boundary name.  Dual combobox searches include selecting a Route then selecting a Pedestal, HH, MH, or Pole from that Route, and searching for an intersection.  We have a point layer which contains the cross streets for each intersection.  The first combobox pulls together values from both fields into a unique sorted list and the second combobox gets filtered based on only those streets that cross it.  This is very useful and makes for fast search & zoom.  I spent a considerable amount of time in researching, testing , and development, so can you please like this if you find it helpful.  Feel free to contact me if you have any questions.  If you look at thee you should be able to adjust it according to your layers.

Attachments
Comments
DavidMcMillan1
New Contributor II

How do you add this tool to arcmap?

ChristopherCarter
New Contributor

Will this add in work with 10.1?

PaulScipione1
New Contributor III

Yes, I created it with 10.1 and am using it with 10.2.2

PaulScipione1
New Contributor III

In ArcMAp, pulldown menu CUSTOMIZE > ADD-IN MANAGER.  Then click on CUSTOMIZE button, then ADD FROM FILE button and select the GRTISearch.esriaddin.  Another way is in Windows Explorer, double-click on GRTISearch.esriaddin, then click on INSTALL ADD-IN.  However, I would suggest that you first look at the Python code underneath.

BlakeTerhune
MVP Regular Contributor

I don't see a .esriaddin file included in your .zip download.

PaulScipione1
New Contributor III

OK, I updated the uploaded ZIP file.  The actual Python code is in the GRTISearch > Install folder.  The associated bitmaps are in the GRTISearch > Images folder.  The config.xml and that actual .esriaddin file is in the GRTISearch folder.  The makeaddin.py is if you make changes to the Python code in the Install folder, it will update the GRTISearch.esriaddin file, which is used to add into ArcMap.  The Python code hard codes to an SDE database connection and specific layer names.  If you adjust the code to reference your SDE connection file, layer, and field names, it should work for you.

BlakeTerhune
MVP Regular Contributor

Thanks for the new download. I'm trying to read through the code and I noticed there are no real comments! Looks like your test code at the bottom had comments though. Even some basic comments would be helpful, especially if you plan to share your code.

Version history
Last update:
‎09-04-2014 12:24 PM
Updated by:
Contributors