1 / 42

Introduction to ESRI Add-Ins

Introduction to ESRI Add-Ins. GIS/LIS Conference Rochester, MN October, 2013. Agenda. Introductions What are Add-ins? Python Add-ins Break .NET Add-ins Extras. Set Up?. Introductions. Chris Pouliot Application Developer, @MN DNR Avenue, VB6, VB.NET, C#, Python

terris
Download Presentation

Introduction to ESRI Add-Ins

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to ESRI Add-Ins GIS/LIS ConferenceRochester, MN October, 2013

  2. Agenda • Introductions • What are Add-ins? • Python Add-ins • Break • .NET Add-ins • Extras

  3. Set Up?

  4. Introductions • Chris Pouliot • Application Developer, @MN DNR • Avenue, VB6, VB.NET, C#, Python • Christopher.pouliot@state.mn.us • Jackie Brost • GIS Specialist, MN DNR • GIS Training & Support, Python • Jacqueline.brost@state.mn.us

  5. Introductions • Who are you? • Programming experience? • Why are you taking the class?

  6. What are Add-ins? • New model for ArcGIS Desktop application customization • Single tool or group of tools • Button, Tool, Menu, Toolbar, etc • Perform action in response to application event • New Document, Edit, Change Extent, etc • Works on ArcGIS Desktop Products (ArcMap, ArcCatalog, ArcGlobe)

  7. Available Add In Types

  8. What are Add-ins? • Single compressed file (*.esriAddIn) • Created in .NET, Java, or Python • ArcMap knows how to install and use • VERY easy to distribute and manage • “Well Known Folders”

  9. What are Add-ins? .esriAddIn

  10. When to Use an Add-in? • If only rearranging existing tools into custom toolbar do this in MXD or MXT with no code. • If running a process or batch job of geoprocessing tools then create a model or create a tool in toolbox using python

  11. When to Use an Add-in? • If you need to interact with the User Interface – Map, Layout, Table of Contents, etc then use an addin • If you need code to run based on an ArcMap event (layer turned on/off, new document opened, changed data frame, feature edited) then use an addin

  12. What Languages and IDEs? • .NET (C#, VB.NET) • Visual Studio 2008+ • Visual Studio 2012 works with ArcGIS10.2 • Visual Studio 2010 works with ArcGIS 10.1 • .NET SDK (Comes with ArcGIS Install) • Installed AFTER Visual Studio • Java • Eclipse • .NET SDK (Comes with ArcGIS Install) • Python (New with ArcGIS 10.1!!) • PyWIN, PyScripter, etc • Python Add-In Assistant

  13. Python Add-Ins • New in10.1 • Pros • Simple Code • Uses ArcPy libraries • No DLLs • No ArcObjects • Cons • No ArcObjects • No Forms/Dialogs

  14. Python Add-ins • Supported Types • Buttons • Tools • Toolbars • Tool Palette • Combo boxes • Menus • Extensions • Provides event listeners

  15. Python Add-ins • Not Supported • Dockable Windows • UI (Custom Forms and Dialogs) • Mark Cedarholm – presentation at ESRI’s 2012 Developers Conference was able to create custom forms using WX Python. • ArcObjects– limited to arcpy python module

  16. Python Add-ins Steps to Create a Python Add-in • Use Python Add-In Wizard to create an Add-In framework (define buttons, tools, menus, toolbars, etc) • Write Python Code behind buttons, tools, …. • Compile to create a single Add-In file (makeaddin.py) • Install/Distribute Add-in

  17. Python Add-in Wizard • Free download from http://www.arcgis.com • Simplifies development of Python add-in • Wizard for defining project settings and add-in content

  18. Python Add-in Wizard • Edit Python script that’s been generated in the install folder • Run makeaddin.py to create .esriaddin file • Double-click .esriaddin to open installation utility • Installer copies add-in to the well known default add-in folder (My Documents > ArcGIS)

  19. Python Add-ins Module • New module in Python that enhances Includes functions for supporting Python add-ins • Get selected layer or data frame • Open gp tool • Open and save dialog boxes • Message box

  20. Python Add-In Demo

  21. Python Add-In Exercise

  22. Python Test/Debugging • If tool shows <missing> means probably a syntax error in the config.xml file. Use IDE to check this. • Use Print statements • Information printed to Python window • Assures proper values in variables • Exceptions printed to Python window

  23. .NET Add-ins • What is .NET?? • Development framework to build applications for the Windows Platform • Key Features • Common Language Runtime • Base Class Library • Windows Forms

  24. .NET Add-ins • What is .NET?? • Interacting with databases • Parsing XML • File reading and writing • String manipulation • Working with collections • Forms and Tools

  25. .NET Add-ins • What version of .NET should I be using? • .NET 4.0 is supported at 10.1 and 10.2 • .NET 3.5 is installed with ArcMap

  26. .NET Add-ins • Visual Studio 2008+ • Express • Free • http://www.microsoft.com/visualstudio/eng/downloads • Doesn’t have real-time debugging (similar to Python Add-In Wizard) • Professional • $450 • Great real-time debugging

  27. .NET Add-ins • ArcGIS .NET SDK • ArcObjects Libraries • Building blocks of ArcGIS products. • Fine-grained control • Forms, Dialogs

  28. .NET Add-ins • Supported Types • Buttons • Tools • Combo boxes • Multi-Items • Menus • Context Menus • Toolbars • Tool Palettes • Dockable Windows • Application Extensions • Editor Extensions • Editor Construction Tools • SOE (Server)

  29. .NET Add-ins • Examples: • Quick Layers • Where Window • Forest Inventory Module • Hydrography Tools • Private Forest Management • Native Plant Communities • Wildlife Surveys

  30. .NET Add-ins • Steps to Create a .NET Add-In in Visual Studio • Create Add-In components (button, tool, construction tool, combo box, multi-item, extension, editor extension, dockable window) • Create component containers (Tool Palette, Toolbar, Menu, Context Menu) • Write code behind components • Compile to create a single Add-In file • Install/Distribute

  31. Visual Studio Demo

  32. .NET Add-in Exercise

  33. Add-In Versions • Always increment the version.

  34. Add-In Versions • Anatomy of a config file.

  35. Installing • My Add-Ins • Double-Click the .esriaddin file to open installation utility • Shared Add-Ins • Copy .esriaddin file to a Well Known Folder specified in ArcMap’s Add-In Manager • Installer copies add-in file to default add-in folder (C:\Users\chpoulio\Documents\ArcGIS\AddIns\Desktop10.x\) • Digitally sign add-ins • Assures add-in hasn’t been modified since signing

  36. Installing Customizations Easy 10.x 9.x Effort Level 8.x Hard Time

  37. Integrating Existing Components • Existing ESRI component • Need the GUID of the item you’re interested in. These can be found at http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//00010000029s000000

  38. Integrating Existing Components

  39. Integrating Existing Components

  40. Tips and Tricks • Updating Add-In • If placing in an Add-In folder do NOT leave old version there. Arcmap will see it even if you rename it and change the file extension.

  41. Tips and Tricks • Add-In folder locations • Arcmap is slow in navigating file systems, especially across a VPN. If you do put your add-ins in a location on a network, put them in a single folder without any other extraneous files.

  42. References • Help • ArcGIS Desktop Python Add-ins Guide Book • Web Training • Basics of Python (for ArcGIS 10) • Python Scripting for Map Automation in ArcGIS 10 • Creating Desktop Add-ins Using Python • Instructor-led Training • Introduction to Geoprocessing Scripts Using Python (10.0)

More Related