Python Add-Ins for ArcGIS Pro

20928
76
03-23-2015 02:06 PM
Status: Closed
Labels (1)
BryanChastain
New Contributor III

We're just now getting the full functionality of Python in ArcMap via Python Add-Ins, but now everything is moving to ArcGIS Pro and I noticed that there are not any plans to include Python Add-Ins for Pro as well. I do like the new mapping module for Pro, but please also give us the ability to create Add-Ins with Python as well.

 

76 Comments
DrewFlater

Daniel,

A future enhancement will allow the thumbnail from the metadata to be used on the ribbon button. For now you will need to edit that daml file with the image of your choice, like shown below.

This was done by setting the largeImage property:

<button id="esri_geoprocessing_forest_TreeRangeOverlayModel" caption="Tree Range Overlay Model" largeImage="C:\Users\<username>\AppData\Local\ESRI\tree32.png" ...

DanielGreene

Drew,

Excellent!

Thank you,

Dan

NicholasHardy

Current python addin functionality as requested
User clicks on map, addin gets township, opens township folder in windows explorer
User clicks on map, addin gets township, adds MTP to map, with mask so MTP is see through (can see other data) but MTP surround is still visible
User clicks on map, addin adds dialog with XY in data frame projection and WGS84 coordinates
User clicks on map, addin opens google earth at that location
Zooms to various options in combo-box (grazing allotment number, township)
Gives user drop down with choices of data to add to map

Thanks!  Hope python add-ins make it to Pro.

Vincent_ZFan

I have created quite a few python add-ins to make the business workflow easier

DanGreene

Hi Drew,

I upgraded to PRO 2.2.1 and the mentioned .daml file does not seem to exist?

Dan

MikeLachance1

I use Python add in to make a data filter tool for my users. It allows them to select a filter value and the tool builds and applies a definition query based on that value.

I am currently doing something similar with Python scripts, ModelBuilder interfaces (dropdown menus) and Tasks in Pro, but the solution was much more elegant in ArcMap as a Python Add-In.

DanGreene

Mike,

I agree that a python add-in would be best.  Python add-ons are easy to distribute and create.  They work well.  ESRI is pushing python so it makes no sense to me that they would not put the development effort into keeping python add-ins for PRO.  

However, if it does not happen I can make Drew's solution work for me.  It will be good if I will be able to  use the thumbnail from the metadata for the ribbon button in a future update of PRO.  I guess a user could pick and choose the tools that they want to use from my toolbox and add then to the analysis view.  I'm not willing to resort to visual studio.

Dan

PeteFellows

I will try MIke's solution too but echoing Dan...I'm not buying VS.

DanGreene

Good Morning,

This python add-in toolbar is a re-write of the Bighorn Sheep Contact Analysis Tools from Visual Studio/C# to Python for Desktop using mostly spatial analyst tools.  However the first tool simply calls a script written in the R language to create the home range polygon via an existing script created by the originator of the model.

The second python add-in toolbar accomplishes several different tasks for the management of vegetation data.  The R2 tool with the tree was a re-write of a VS/C# program to calculate many different summaries based on the detailed vegetation data stored in an oracle database (several of the tools use cx_oracle to access the database).  Each tool performs a separate unique maintenance, calculation, updating, or reporting function.

Both of the above toolbars access python programs that are embedded in an ArcGIS toolbox and use toolbox forms.  The oracle queries are separate scripts in the toolbox and password protected.  I have a draft of redoing the HR tool using spatial analyst but the existing arc kernel density function is insufficient (different kernel) and in another thread have attempted to use SCIPY to get around that.  The bighorn sheep toolbox runs fine in Pro 2.1.2 but runs into a spatial analysist problem with 2.2.  And of course only the toolbox works and not the add-in.

Most of the tools in the vegetation toolbar will run out of the toolbox for ArcGIS PRO.  However, a few of the tools use an MDB template to load updated data or calculations back into the Oracle database so the lack of Access DB support in PRO will be the big hurdle.

The form support from the toolbox is great eliminating a lot of program code.  The python equivalents to the C-code are much more compact (and easier to follow in my opinion).

Toolbox used by the vegetation add-in:

Dan

EDIT -Unfortunately the graphics showing the ADD-in's and Vegetation tool box were eliminated when I posted.

David_Sinton

It would be very beneficial to the GIS users in my office if creating add-in in Pro was just as easy as it is in ArcGIS for Desktop. In my office I create add-ins using Python and Esri's Add-In Wizard. Without much programming ability I'm able to provide a variety of tools. One such tool does an initial assessment of impacts a proposed action may have by comparing several environmental resources. To migrate this tool would require me to learn C# which I have no desire to do.