Addins Dr Andy Evans Welcome to the course. You’ll find extra information in these note sections below each slide. http://desktop.arcgis.com/en/analytics/python/

Slides:



Advertisements
Similar presentations
* 1 Common Dialog Control. * 2 You want your user to set property or provide your application with some information easily? How do you do it? The Common.
Advertisements

KompoZer. This is what KompoZer will look like with a blank document open. As you can see, there are a lot of icons for beginning users. But don't be.
Copyright  Oracle Corporation, All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE.
CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Programming for Geographical Information Analysis: Advanced Skills Lecture 2: ArcObjects Framework Dr Andy Evans.
Calendar Browser is a groupware used for booking all kinds of resources within an organization. Calendar Browser is installed on a file server and in a.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
1 of 5 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
1 of 7 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Introduction To Form Builder
Introduction to ESRI Add-Ins
Inventory Throughout this slide show there will be hyperlinks (highlighted in blue) follow the hyperlinks to navigate to the specified Topic or Figure.
Introduction to Visual Basic. What is Visual Basic? An environment for developing Windows applications Components –A GUI (Graphical User Interface - gooey)
Google Earth How to create a Google Earth Tour and place it in your Wiki.
Lesley Bross, August 25, 2010 ArcGIS 10 Add-In Components and Controls.
Introduction to ArcGIS Add-Ins Exercises GIS/LIS Conference, 2014 Rochester, MN.
Adobe Forms THE FORM ELEMENT PANEL. Creating a form using the Adobe FormsCentral is a quick and easy way to distribute a variety of forms including surveys.
Arc: Programming Options Dr Andy Evans. Programming ArcGIS ArcGIS: Most popular commercial GIS. Out of the box functionality good, but occasionally: You.
Visual Basic 2008 Express Edition The IDE. Visual Basic 2008 Express The Start Page Recent Projects Open an existing project Create a New Project.
05/09/ Introducing Visual Basic Sequence Programming.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Creating.NET Add-ins.
Microsoft ® Office 2007 Training Security II: Turn off the Message Bar and run code safely presents:
1 Workshop 4 (B): Visual Basic Test Project Mahidol University June 13, 2008 Paul Evenson University of Delaware Bartol Research Institute.
Arc: AddIns Dr Andy Evans. Java Direct access to ArcObjects Framework inside and outside Arc. Ability to add components to the GUI. Ability to communicate.
Alice 2.0 Introductory Concepts and Techniques Project 1 Exploring Alice and Object-Oriented Programming.
Martin Dodge Practical 2, 24th March 2004, pm Social Science Research Methodologies.
1. Chapter 25 Protecting and Preparing Documents.
How to use Microsoft Word. Where can I find Microsoft Word? How to select, copy and paste information Go to the document from which you wish to copy the.
Fourth R Inc. 1 WELCOME TO MICROSOFT OFFICE OUTLOOK 2003 INTERMEDIATE COURSE.
Classic Controls Trần Anh Tuấn A. Week 1 How to create a MFC project in VS 6.0 How to create a MFC project in VS 6.0 Introduction to Classic Controls.
0 eCPIC User Training: Resource Library These training materials are owned by the Federal Government. They can be used or modified only by FESCOM member.
Project Deployment IT [211 CAP] How to convert your project to a full application.
An Introduction to Designing and Executing Workflows with Taverna Aleksandra Pawlik materials by: Katy Wolstencroft University of Manchester.
Game Maker – Getting Started What is Game Maker?.
11/25/2015Slide 1 Scripts are short programs that repeat sequences of SPSS commands. SPSS includes a computer language called Sax Basic for the creation.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
1 Installing Java on Your PC. Installing Java To develop Java programs on your PC: Install JDK (Java Development Kit) Add the directory where JDK was.
What is a Combo Box? Is a list of values from which the user can select a single value. Saves typing Adds another means of enforcing referential integrity.
Photoshop Actions Lights, Camera, Actions in Photoshop.
VB.NET and Databases. ADO.NET VB.Net allows you many ways to connect to a database. The technology used to interact with a database or data source is.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
Netbeans QuickStart. Creating a project File->New Project –For now you want General->Java Application –Then fill in the project details.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Using Macros Lesson.
CREATING ARCGIS DESKTOP ADD-INS USING PYTHON AND RELATED PACKAGES/MODULES 2016 AGIC Education and Training Symposium September 22, 2016 Erik Glenn ● Pima.
Introduction to InVEST ArcGIS Tool
Chapter Topics 15.1 Graphical User Interfaces
Using a template to create a document
CONTENT MANAGEMENT SYSTEM CSIR-NISCAIR, New Delhi
An introduction to programming Created by Dr. Randy Pausch
Administrator Training
RAD Certification Checkpoint #2 Introducing RadStudio (Hello World)
Introduction to ArcGIS Add-Ins
Chapter 7 Advanced Form Techniques
Programming for Geographical Information Analysis: Advanced Skills
NORMA Lab. 7 Generating Reports More Display Options
GDSS – Digital Signature
An Installation Guide of PGP on Windows 2000
File Upload.
Addins Dr Andy Evans Welcome to the course. You’ll find extra information in these note sections below each slide.
Programming for Geographical Information Analysis: Advanced Skills
Microsoft PowerPoint 2007 – Unit 2
Working with Symbols and Interactivity
Chapter 15: GUI Applications & Event-Driven Programming
Chapter 1 Introducing Small Basic
University of Warith AL-Anbiya’a
Building Add-ins for ArcGIS Desktop in .NET
Programming Arc.
Java Code Review with CheckStyle
Presentation transcript:

addins Dr Andy Evans Welcome to the course. You’ll find extra information in these note sections below each slide. http://desktop.arcgis.com/en/analytics/python/

Addins Addins are GUI elements we can add that respond to user-driven GUI events. Button : Icon on toolbar. Tool : Changes mouse operations. Combo box : Dropdown list and editable box. Toolbar : For grouping AddIns. Menu : Dropdown and right-click. Tool palette : Floating container for other AddIns. Application extension : Additional functionality within, e.g. Arc extensions. (Python doesn't have Dockable window : Floating window that can be locked into the GUI cf. Java / C++.)

Events As well as GUI events, Application Extension addins give: startup(self) activeViewChanged(self) mapsChanged(self) newDocument(self) openDocument(self) beforeCloseDocument(self) closeDocument(self) beforePageIndexExtentChange(self, old_id) pageIndexExtentChanged(self, new_id) contentsChanged(self) spatialReferenceChanged(self) itemAdded(self, new_item) itemDeleted(self, deleted_item) itemReordered(self, reordered_item, new_index) onEditorSelectionChanged(self) onCurrentLayerChanged(self) onCurrentTaskChanged(self) onStartEditing(self) onStopEditing(self, save_changes) onStartOperation(self) beforeStopOperation(self) onStopOperation(self) onSaveEdits(self) onChangeFeature(self) onCreateFeature(self) onDeleteFeature(self) onUndo(self) onRedo(self) http://desktop.arcgis.com/en/arcmap/latest/analyze/python-addins/extension-class.htm

Addins vs scripts Addins have: More sophisticated GUI elements, such as drop-down comboboxes. The ability to communicate between addins, linking several GUI elements together. The ability to respond to Arc events beyond the GUI with application extensions.

Form zip file, with a .esriaddin extension Contains: config.xml : metadata describing the addin Python files Other resources needed : e.g. data, images XML is a bit like HTML but more formal. Use the addin wizard to edit the XML and make changes to properties.

Making an AddIn Rather than writing the config.xml ourselves, and zipping it up manually with the Python files, there’s a wizard to help. This does all the basic Python module generation for us, and prepares the file. Details for installing the wizard on the website.

What the wizard produces Main elements: An install directory containing the Python file. Adjust this to add functionality. makeaddin.py: file to build the zip file This needs to run in Python 2, and produces: projectname.esriaddin the addin file. There are also options for adding resource directories containing data, images, etc.

Installing Zip file is put into M:\ArcGIS\Addins\Desktop10.4\ or %USERPROFILE%\Documents\ArcGIS\A ddIns\Desktop10.4 There are easy install options: double clicking on the addin will bring up a wizard to install it.

Addin manager

Rebuilding You can open the project again to add extra addins: it will back up the old copy. Remember, once you change the code, you need to rebuild the zip file and reinstall. You'll need to reboot Arc to see the changes if it is open. If there's a syntax error, the addin will appear as a red "stop" sign.

Managing AddIns Admin Registry Keys (regedit.exe) BlockAddIns HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\Desktop10.4 \ Settings BlockAddIns 0 - Load all. 1 - Load signed only. 2 - Load ESRI only. 3 - Load from administrator folders only. 4 - Do not Load any Add-Ins. AddInFolders AdminAddInLock - stop tampering with these.

Digital signatures More on demanding digital signatures at: http://desktop.arcgis.com/en/arcmap/latest/analyze/python-addins/digitally-signing- add-ins.htm

Communicating between addins ID set up in addin wizard can be used as a variable name to communicate with other addins. The wizard adds a prefix, but if the addin components are in the same addin you shouldn't use it. Don't use the same ID for different components.

Enabling GUI components class MyButton(object): def __init__(self): self.checked = False # i.e. pushed (buttons only) self.enabled = True Can set for other tools based on ID: if (arcpy.Exists("results.shp")): process_button.enabled = True

pythonaddins module Addins have access to the pythonaddins module: OpenDialog(): to choose one or more GIS datasets. SaveDialog(): to save data GPToolDialog(): run geoprocessing tool dialog box. MessageBox() GetSelectedTOCLayerOrDataFrame() GetSelectedCatalogWindowPath() ProgressDialog() (Actually, although undocumented, so do all internal script tools.)

MessageBox() mb_type code Message Box Type OK only 1 OK/Cancel 2 OK only 1 OK/Cancel 2 Abort/Retry/Ignore 3 Yes/No/Cancel 4 Yes/No 5 Retry/Cancel 6 Cancel/Try Again/Continue

ProgressDialog() with pythonaddins.ProgressDialog as dialog: dialog.title = "Progress so far" dialog.description = "Doing something." dialog.animation = "File" for i in range(100): dialog.progress = i # Do something here. if dialog.cancelled: raise Exception("Issue has occurred")