Customisation The GUI in most GIS applications is sufficient for most needs. However, situations arise where you want either to: –Modify the interface,

Slides:



Advertisements
Similar presentations
Integrated Business Applications with Databases (D3) Jenny Pedler
Advertisements

Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
1 Overview Introduction to VBA The Visual Basic Editor (VBE) –First Program Getting Started with VBA –Subroutines –Declaring variables –Input boxes and.
PL/SQL. Introduction to PL/SQL PL/SQL is the procedure extension to Oracle SQL. It is used to access an Oracle database from various environments (e.g.
AE6382 VBA - Excel l VBA is Visual Basic for Applications l The goal is to demonstrate how VBA can be used to leverage the power of Excel u VBA syntax.
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
Tutorial 12: Enhancing Excel with Visual Basic for Applications
VBA Modules, Functions, Variables, and Constants
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
The IDE (Integrated Development Environment) provides a DEBUGGER for locating and correcting errors in program logic (logic errors not syntax errors) The.
1 Chapter 4 The Fundamentals of VBA, Macros, and Command Bars.
SUNY Morrisville-Norwich Campus-Week 12 CITA 130 Advanced Computer Applications II Spring 2005 Prof. Tom Smith.
Using the Visual Basic Editor Visual Basic for Applications 1.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
GISC 6382 Applied GIS UT-Dallas Briggs 1 Customizing ArcGIS Spring 2008.
VBA & Excel Barry L. Nelson IEMS 465 Fall Quarter 2003.
Exploring Microsoft Excel 2002 Chapter 8 Chapter 8 Automating Repetitive Tasks: Macros and Visual Basic for Applications By Robert T. Grauer Maryann Barber.
Arc: Programming Options Dr Andy Evans. Programming ArcGIS ArcGIS: Most popular commercial GIS. Out of the box functionality good, but occasionally: You.
Languages and Environments Higher Computing Unit 2 – Software Development.
Microsoft Visual Basic 2005: Reloaded Second Edition
Intellicad Visual Basic Application Marian Kate Santos Programming Paradigm.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 11 1 Microsoft Office Access 2003 Tutorial 11 – Using and Writing Visual Basic for Applications.
XP Chapter 7 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Enhancing User Interaction Through Programming Chapter.
Automating Tasks with Visual Basic. Introduction  When can’t find a readymade macro action that does the job you want, you can use Visual Basic code.
Tutorial 11 Using and Writing Visual Basic for Applications Code
Enhancing User Interaction Through Programming
Chapter 11: Introduction to the Visual Basic Environment Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University.
Why to Create a Procedure
® Microsoft Access 2010 Tutorial 11 Using and Writing Visual Basic for Applications Code.
PROGRAMMING IN VISUAL BASIC.NET VISUAL BASIC BUILDING BLOCKS Bilal Munir Mughal 1 Chapter-5.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 Microsoft Office Excel Copyright © 2008 Pearson Prentice Hall. All rights reserved
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
 Application – another name for a program.  Interface – is what appears on the screen when the application is running.  Program Code – is instructions.
OCC Network Drives  H:\  P:\ 
Introduction to ArcGIS for Environmental Scientists Module 3 – GIS Analysis Model Builder.
Chapter 9 Macros And Visual Basic For Applications.
Vocabulary in VB So Far. Assignment: Used to change the value of an object at run time Used to change the value of an object at run time.
Chapter 11: Introduction to VBA Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
Introduction to Excel VBA UNC Charlotte CPE/PDH Series December 17, 2009.
CompMathBSc, English 5 October 2006 Programming basics — continued  Arrays  Cycle Statements: Loops  Control Structures vs Conditions  Subs: Procedures.
Visual Basic Integrated Development Environment (IDE) 56:150 Information System Design.
COMPREHENSIVE Access Tutorial 11 Using and Writing Visual Basic for Applications Code.
AVCE ICT – Unit 7 - Programming Session 12 - Debugging.
Visual Basic.Net. Software to Install Visual Studio 2005 Professional Edition (Requires Windows XP Pro) MSDN Library for Visual Studio 2005 Available.
Scripting In this presentation… –centric’s scripting support. VBScript and JScript. Scripting Editor.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
COMPREHENSIVE Excel Tutorial 12 Expanding Excel with Visual Basic for Applications.
The Advantage Series ©2005 The McGraw-Hill Companies, Inc. All rights reserved Chapter 12 Introducing Visual Basic for Applications Microsoft Office Excel.
Intellicad Visual Basic Application
Chapter 2: The Visual Studio .NET Development Environment
Introduction to GIS PythonScript CGIS-NURIntroduction to ArcGIS II.
VBA - Excel VBA is Visual Basic for Applications
VBA - Excel VBA is Visual Basic for Applications
Chapter 8: Writing Graphical User Interfaces
Microsoft Access 2003 Illustrated Complete
Microsoft Access Illustrated
Excel VBA Day 3 of 3 Tom Vorves.
Object-Oriented Programming: Classes and Objects
Objectives Learn about Function procedures (functions), Sub procedures (subroutines), and modules Review and modify an existing subroutine in an event.
Writing Geoprocessing Scripts With ArcGIS
VISUAL BASIC.
Writing Geoprocessing Scripts With ArcGIS
Exploring Microsoft Excel
CS285 Introduction - Visual Basic
Tonga Institute of Higher Education
Tutorial 11 Using and Writing Visual Basic for Applications Code
Visual Basic for Applications: Introduction
Presentation transcript:

Customisation The GUI in most GIS applications is sufficient for most needs. However, situations arise where you want either to: –Modify the interface, or –Add new functionality We will focus on ArcGIS, but similar principles apply to other systems.

GUI Changes Modifying the interface can be achieved without any programming. Basically involves adding, deleting or moving objects in the GUI using drag and drop operations. The changes are initiated from the Tools | Customize menu. We will look at examples in the practical class.

Programming Options ArcGIS is constructed from several hundred ArcObjects. These can be programmed to add functionality. You can either: –Write your own code, or –Download code via the Internet Two approaches: –Internal – i.e. modify ArcGIS itself –External – i.e. write a standalone program using ArcObjects

Internal Changes ArcGIS can be modified in several ways: –Visual Basic for Applications (VBA) macro. The macro can either be run from the built-in Visual Basic Editor (VBE) - which provides an Integrated Development Environment (IDE), or attached to a button on the desktop. –Scripting languages such as VBScript, JScript or Python can be used to create a geoprocessing script. The script could either be a new tool or several tools linked together to automate a workflow as a geoprocessing model.

External Programs ArcObject functionality can also be incorporated into your own programs in an external environment. Any COM-compliant or.NET-compliant high level programming language, such as Visual Basic, Visual C++ or Python may be used. Programs require a licence.

Python Python is arguably the language of choice. It is an interpreted high-level language – simple to learn, yet very versatile. It is object-orientated, yet lends itself to procedural programming. In the ArcGIS context it can be used both for scripting and writing standalone applications. It is open source and available for free from the Internet. ArcGIS 9.x comes with Python 2.5.1, but this is not compatible with Python 3.x.

Visual Basic for Applications We will use some VBA macros in the practical class, so it may be helpful to say something about VB. A block of code that can perform a specific task is referred to as a procedure. A collection of procedures is known as a module and a collection of modules is referred to as a project. Procedures may be private or public. A private procedure can only be called or used by another procedure in the same module; public procedures are available to procedures in other modules in the same project.

Procedures There are three types of procedure: events, subs and functions. Event procedures are associated with controls such as menus and buttons. Subs and functions are not associated with controls, but are called by other procedures; the difference between them is that functions return a value whereas a sub does not.

Type Declarations Variable type must be declared before use using a Dim statement, e.g. Dim n As Integer Objects must be declared and then instantiated, e.g. Dim pField As IFieldEdit Set pField = New Field The first line creates a variable to hold the object, the second creates the object. All references to an object are through an interface.

Dot Notation The properties of an object are indicated using an object.property dot notation. For example: pObjectnameName.PropertyName = value A method for an object is specified in a similar manner: Set pObjectName.PropertyName = pObjectName.MethodName (params) Comments may be added using an inverted comma: ‘ Everything after the inverted comma is a comment

Structure VBA supports branches: If... Then... Else... End If Select Case...Case...Case... End Select And loops: Do While... Loop Do Until... Loop For... Next

The Visual Basic Editor (VBE) The VBE contains various windows: –Code window –Project window / explorer –Properties window –Immediate window

Error Handling There are three main types of error: –Compile –Run-time –Logic Error trapping: –Breakpoints / Debug.Print –Step Into / Step Over / Step Out –Run To Cursor –The Err object