developing arcgis desktop add-ins wpython
TRANSCRIPT
![Page 1: Developing Arcgis Desktop Add-Ins Wpython](https://reader030.vdocuments.site/reader030/viewer/2022012400/55cf9c1f550346d033a8ae76/html5/thumbnails/1.jpg)
Developing Desktop Add-ins with Python
Jason Pardy Jason Scheirer
![Page 2: Developing Arcgis Desktop Add-Ins Wpython](https://reader030.vdocuments.site/reader030/viewer/2022012400/55cf9c1f550346d033a8ae76/html5/thumbnails/2.jpg)
Topics to cover
• Tour of the documentation • Supported add-in types • The Python Add-In Wizard • Building an add-in tool (demo) • Building an add-in extension (demo)
![Page 3: Developing Arcgis Desktop Add-Ins Wpython](https://reader030.vdocuments.site/reader030/viewer/2022012400/55cf9c1f550346d033a8ae76/html5/thumbnails/3.jpg)
ArcGIS Desktop Add-Ins At 10.0, a new add-in model to customize and
extend ArcGIS Desktop applications.
- Easier to build
- Easy to share
- More secure
- Pluggable Architecture
![Page 4: Developing Arcgis Desktop Add-Ins Wpython](https://reader030.vdocuments.site/reader030/viewer/2022012400/55cf9c1f550346d033a8ae76/html5/thumbnails/4.jpg)
Python makes add-ins easier!
ØNo dll’s!
ØNo compiling!
ØNo ArcObjects!
ØLess code!
![Page 5: Developing Arcgis Desktop Add-Ins Wpython](https://reader030.vdocuments.site/reader030/viewer/2022012400/55cf9c1f550346d033a8ae76/html5/thumbnails/5.jpg)
Documentation: Python Add-in Guide book
• ArcGIS Desktop Help guide book - “Customizing ArcGIS Desktop with Python Add-Ins”
-
• Python Resource Center
• arcgis.com for sample add-ins
Let’s take a tour
![Page 6: Developing Arcgis Desktop Add-Ins Wpython](https://reader030.vdocuments.site/reader030/viewer/2022012400/55cf9c1f550346d033a8ae76/html5/thumbnails/6.jpg)
Supported Add-in Types
• Buttons & Tools • Toolbars • Tool Pallets • Combo Boxes • Menus • Extensions
• Dockable windows are not supported. • No custom UI support.
![Page 7: Developing Arcgis Desktop Add-Ins Wpython](https://reader030.vdocuments.site/reader030/viewer/2022012400/55cf9c1f550346d033a8ae76/html5/thumbnails/7.jpg)
Add-in Anatomy
• Same file anatomy as .NET & Java - XML file describes the type of
customization(s)
- Python script contains the business logic
Add-In File (.esriaddin)
Images
Install (Python files &
data) config.xml (metadata)
![Page 8: Developing Arcgis Desktop Add-Ins Wpython](https://reader030.vdocuments.site/reader030/viewer/2022012400/55cf9c1f550346d033a8ae76/html5/thumbnails/8.jpg)
Python Add-In Wizard
• Add-ins are built using the Python Add-in wizard • The wizard generates fully stubbed out add-in
projects including the config.xml, folders, and the Python script
- Download the Python Wizard from arcgis.com - Extract the contents of the .zip - Launch the addin_assistant.exe from the bin folder
![Page 9: Developing Arcgis Desktop Add-Ins Wpython](https://reader030.vdocuments.site/reader030/viewer/2022012400/55cf9c1f550346d033a8ae76/html5/thumbnails/9.jpg)
Jason Pardy
Demo: Building an Add-In (Tool)
![Page 10: Developing Arcgis Desktop Add-Ins Wpython](https://reader030.vdocuments.site/reader030/viewer/2022012400/55cf9c1f550346d033a8ae76/html5/thumbnails/10.jpg)
Jason Scheirer
Demo: Building an add-in extension
![Page 11: Developing Arcgis Desktop Add-Ins Wpython](https://reader030.vdocuments.site/reader030/viewer/2022012400/55cf9c1f550346d033a8ae76/html5/thumbnails/11.jpg)
The pythonaddins module
• Includes functions for supporting Python add-ins - OpenDialog() - SaveDialog() - GPToolDialog() - MessageBox() - GetSelectedTOCLayerOrDataFrame()
![Page 12: Developing Arcgis Desktop Add-Ins Wpython](https://reader030.vdocuments.site/reader030/viewer/2022012400/55cf9c1f550346d033a8ae76/html5/thumbnails/12.jpg)
Python add-in classes
• Guide book includes list of properties and functions for each add-in class
- Button - Combo Box - Tool - Application Extension
![Page 13: Developing Arcgis Desktop Add-Ins Wpython](https://reader030.vdocuments.site/reader030/viewer/2022012400/55cf9c1f550346d033a8ae76/html5/thumbnails/13.jpg)
Debugging Add-Ins
• Use print statements • “missing” on a toolbar likely means a syntax error
![Page 14: Developing Arcgis Desktop Add-Ins Wpython](https://reader030.vdocuments.site/reader030/viewer/2022012400/55cf9c1f550346d033a8ae76/html5/thumbnails/14.jpg)
Updating & Editing Add-Ins
• Use the wizard to change add-in properties such as description, image, help, etc.
• After saving the changes, a new script is created. • If you only need to update and add functionality to
the existing script, there is no need to open the Python Add-In Wizard; just edit the Python script
• After updates, re-run makeaddin.py, install and test.
• Read the help topic “Editing an add-in”.
![Page 15: Developing Arcgis Desktop Add-Ins Wpython](https://reader030.vdocuments.site/reader030/viewer/2022012400/55cf9c1f550346d033a8ae76/html5/thumbnails/15.jpg)
Demo: Updating & Editing an add-in
![Page 16: Developing Arcgis Desktop Add-Ins Wpython](https://reader030.vdocuments.site/reader030/viewer/2022012400/55cf9c1f550346d033a8ae76/html5/thumbnails/16.jpg)
Sharing
• A packaged compressed file (.esriaddin) containing the xml, Python script, images, & any necessary data makes add-ins easy to share
• Can be shared between users within an organization using a centralized network share or through email
• Can be easily uploaded to ArcGIS online or the resource centers
• Added to a system by simply copying them to a well-known folder and removed by deleting them from this folder
![Page 17: Developing Arcgis Desktop Add-Ins Wpython](https://reader030.vdocuments.site/reader030/viewer/2022012400/55cf9c1f550346d033a8ae76/html5/thumbnails/17.jpg)
Localization
Config.xml Default
Config.fr.xml French
Config.fr-FR.xml French-France
Config.fr-CA.xml French-Canadian
• The translated config.xml files must reside at the root level in your add-in archive (.esriAddIn), and the files must adhere to one of the following naming conventions:
![Page 18: Developing Arcgis Desktop Add-Ins Wpython](https://reader030.vdocuments.site/reader030/viewer/2022012400/55cf9c1f550346d033a8ae76/html5/thumbnails/18.jpg)
Digitally Signing Add-Ins
• Improve security
• The ESRISignAddIn.exe utility, supplied with the download of Python Add-In Wizard, can be used to sign ArcGIS for Desktop add-ins
- Located in the bin folder
- Must be copied to your ArcGIS install bin folder
![Page 19: Developing Arcgis Desktop Add-Ins Wpython](https://reader030.vdocuments.site/reader030/viewer/2022012400/55cf9c1f550346d033a8ae76/html5/thumbnails/19.jpg)
Most FAQ’s
• Can I create and open custom dialog boxes within my add-in (using Tk, wxPython, etc.)?
- No. The low-levels of integrating any Python UI framework with the event loop of the desktop apps is very
difficult and currently doesn’t work.
• Is Python add-ins a replacement for VBA?
- Yes & No. Although we continue adding more Python support where you can create scripts to automate
mapping workflows and create add-ins to interact with the display and listen to events, full access to the
ArcGIS system is not available within Python.
• Can I open GP tools from an add-in?
- Yes. Using the pythonaddins module you can call the function GPToolDialog. This will open a GP tool.
• Can I use the pythonaddins module outside an add-in such as in script tool?
- No. This module is only for use within an add-in. However, it can be imported and used in the Python
window. Using it inside a script tool will fail.
![Page 20: Developing Arcgis Desktop Add-Ins Wpython](https://reader030.vdocuments.site/reader030/viewer/2022012400/55cf9c1f550346d033a8ae76/html5/thumbnails/20.jpg)
Thank-you!
• Please complete a survey.
• Questions?