ArcView / Avenue / ArcGIS Customization. Basic Customization in ArcView 3.x Sources for scripts and extensions Installing an extension Adding and running.

Slides:



Advertisements
Similar presentations
© Paradigm Publishing, Inc Excel 2013 Level 2 Unit 2Managing and Integrating Data and the Excel Environment Chapter 7Automating Repetitive Tasks.
Advertisements

WORKING SMART Crystal M. Thomas Henrico County DSS (804) POSSESS Central Region Member October 31, 2007.
Using Macros and Visual Basic for Applications (VBA) with Excel
Copyright © 2008 Pearson Prentice Hall. All rights reserved Copyright © 2008 Prentice-Hall. All rights reserved. Committed to Shaping the Next.
XP Tutorial 4 New Perspectives on Microsoft Windows XP 1 Microsoft Windows XP Personalizing Your Windows Environment Tutorial 4.
Advanced Microsoft Word Hosted by Jared Hoffman Topics Keyboard Shortcuts Customizing Toolbars and Menus Auto Format & Auto Correct Tabs Inserting Pictures.
Access Lesson 2 Creating a Database
Technical Support: (989) GIS and Mapping Procedures in ArcMap 9.x Creating an ArcMap Project Editing an ArcMap Project Printing an ArcMap Project.
Intro to ArcMap Customization with Visual Basic  Create your own toolbars, buttons, interactive tools, and programs  Runs behind the scenes in ArcMap.
Customizing Word Microsoft Office Word 2007 Illustrated Complete.
Using the Visual Basic Editor Visual Basic for Applications 1.
Macros Tutorial Week 20. Objectives By the end of this tutorial you should understand how to: Create macros Assign macros to events Associate macros with.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Introduction To Form Builder
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Word Project 8 Working with Macros and Visual Basic for Applications (VBA)
Introduction to ArcGIS Add-Ins Exercises GIS/LIS Conference, 2014 Rochester, MN.
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
Word Lesson 16 Working with Macros Microsoft Office 2010 Advanced Cable / Morrison 1.
Advanced Tables Lesson 9. Objectives Creating a Custom Table When a table template doesn’t suit your needs, you can create a custom table in Design view.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
Microsoft Visual Basic 2005 CHAPTER 12 Cell Phone Applications and Web Services.
1.Sign onto VPN 2.Right-click My Computer & select Explore from pop-up menu 3.Go to the View dropdown menu and select Details 4.Go to the Tools dropdown.
Copyright 2007, Information Builders. Slide 1 Maintain & JavaScript: Two Great Tools that Work Great Together Mark Derwin and Mark Rawls Information Builders.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
Create Database Tables
Project 9 Using Visual Basic for Applications (VBA) to Customize and Automate Excel Jason C. H. Chen, Ph.D. Professor of Management Information Systems.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. WORD 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 22 Macros.
1 CA201 Word Application Increasing Efficiency Week # 13 By Tariq Ibn Aziz Dammam Community college.
Copyright 2007, Paradigm Publishing Inc. EXCEL 2007 Chapter 7 BACKNEXTEND 7-1 LINKS TO OBJECTIVES Record & run a macro Record & run a macro Save as a macro-
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.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 4 1 Microsoft Office FrontPage 2003 Tutorial 4 – Using Shared Borders and Themes.
Moodle (Course Management Systems). Assignments 1 Assignments are a refreshingly simple method for collecting student work. They are a simple and flexible.
Creating a Web Site to Gather Data and Conduct Research.
INSERT BOOK COVER 1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Excel 2010 by Robert Grauer, Keith.
1 ADVANCED MICROSOFT WORD Lesson 16 – Customizing Features Microsoft Office 2003: Advanced.
Chapter 6 Generating Form Letters, Mailing Labels, and a Directory
Automating Database Processing Chapter 6. Chapter Introduction Design and implement user-friendly menu – Called navigation form Macros – Automate repetitive.
Management Information Systems MS Access MS Access is an application software that facilitates us to create Database Management Systems (DBMS)
Microsoft Access 2000 Presentation 2 Creating Databases Part I (Creating Tables)
Microsoft Visual Basic 2005 ENRICHMENT CHAPTER Visual Studio Tools for Office.
Windows Tutorial Common Objects ACOS: 1, 4. Using the Taskbar 1. Using the taskbar, you can switch between open programs and between open documents within.
Copyright © 2010 Wolters Kluwer Health | Lippincott Williams & Wilkins Introduction to Windows Chapter 2.
Program Design and Coding
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
Microsoft Visual Basic 2010 CHAPTER THREE Program Design and Coding.
Tutorial 11 Five windows included in the Visual Basic Startup Screen Main Form Toolbox Project Explorer (Project) Properties.
MS Access 2007 Management Information Systems 1. Overview 2  What is MS Access?  Access Terminology  Access Window  Database Window  Create New Database.
Microsoft Access 2010 Chapter 10 Administering a Database System.
Microsoft Access 2010 Chapter 8 Advanced Form Techniques.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 7 1 Microsoft Office FrontPage 2003 Tutorial 7 – Creating and Using Templates in a Web.
Using Advanced Options Lesson 14 © 2014, John Wiley & Sons, Inc.Microsoft Official Academic Course, Microsoft Word Microsoft Word 2013.
CMPF124: Basics Skills for Knowledge Workers Manipulating Windows GUI.
Chapter 23. Copyright 2003, Paradigm Publishing Inc. CHAPTER 23 BACKNEXTEND 23-2 LINKS TO OBJECTIVES Record, Run, Pause, and Delete Macros Record, Run,
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
®® Microsoft Windows 7 for Power Users Tutorial 3 Managing Folders and Files.
Slide 1 Using Menu Bar & Common Dialog Boxes. Slide 2 Setting Up the Main Items v First open the form on which you want the menu located v Then start.
Microsoft Office 2013 Try It! Chapter 4 Storing Data in Access.
Customizing Menus and Toolbars CHAPTER 12 Customizing Menus and Toolbars.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Using Macros Lesson.
Chapter 11 Enhancing an Online Form and Using Macros Microsoft Word 2013.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 11 Creating Web Applications and Writing Data to a Database.
Excel Tutorial 8 Developing an Excel Application
June 17, 2009 Office 2007 Tips & Tricks.
Chapter 2: The Visual Studio .NET Development Environment
Microsoft Excel 2003 Illustrated Complete
MODULE 7 Microsoft Access 2010
Word offers a number of features to help you streamline the formatting of documents. In this chapter, you will learn how to use predesigned building blocks.
Guidelines for Microsoft® Office 2013
Presentation transcript:

ArcView / Avenue / ArcGIS Customization

Basic Customization in ArcView 3.x Sources for scripts and extensions Installing an extension Adding and running a script Attaching a script to a button System scripts Startup and shutdown scripts

Sources for Scripts & Extensions ArcScripts ( Sample Scripts and Extensions in the ArcView help (look under Sample scripts and extensions in the table of contents) Google Online communities – –

Installing an Extension On a Windows machine: Put the.avx file in the c:\esri\av_gis30\arcview\ext32 directory You can also set the USEREXT environment variable to use another location (if you have admin privileges)

Installing an Extension On our UNIX system: Putting the.avx file in your home directory should make ArcView see it when you are logged in Or you can set an environment variable called USEREXT to point to a custom location and then put all your.avx files in that location Only the system administrator can install an extension so all users can see it

Adding a Script In the ArcView Project window, select the Scripts icon and then click New Either type, paste, or use the Script | Load Text File option to get your code in the new script window Use Script | Compile or the checkbox button to compile the script If you don’t get an error message, then the script compiled successfully

Running a script Some scripts can be run from the project window, just by clicking Run Others might need to be associated with a particular (open) document, like a view To associate a script with a view: 1.Open the script 2.Activate the necessary view 3.Activate the script 4.Choose Script | Run

Running a script A better way to make a script work with a view if you’re going to use it a lot is to put a new button on the View toolbar and associate it with the script 1.Make a view active 2.Double-click on an empty part of the toolbar 3.Make sure Type is View and Category is Buttons 4.Select a button and click New (this will create a new button next to the one you selected)

Running a Script 5.Select your new button 6.Double-click on the empty box next to Click (in the bottom part of the dialog) 7.Select the script you want to run 8.You can also set an icon for the button by double- clicking on the Icon section at the bottom of the Customize dialog

System Scripts A lot of the scripts written by ESRI are available for you to use Use the customize dialog to see what script gets run by a button or menu item You can attach system scripts to your own custom buttons

Startup and Shutdown Scripts You can make a script automatically run when you open or shut down a project Choose Project | Properties Set scripts using the script selection buttons You can also set a working directory and a selection color using this dialog

Calculators Field calculator (attribute data) –Shape calculations –Number calculations –String calculations Map calculator (raster data)

Field Calculator To see a list of requests available for a data type, click the appropriate Type radio button and then scroll down the Requests list The example shown here converts a numeric ID to a string and puts it in a new field called NewField1

Field Calculator Operations on shapes are not shown in the Field Calculator itself To see what shape requests are available, open the ArcView help and go to the Shape (class) entry in the index You can’t use everything that is listed, but you can use the ones that return a number, string, or boolean and don’t require another shape (so you can use ReturnArea but not Contains)

Field Calculator You’ll have to type the request in yourself (don’t forget the period between [Shape] and the request!) This example computes the area of a shape (polygon) and puts it in a field called NewField1

Field Calculator Descriptions of all requests are in the ArcView help; either search on the name of the request you see in the dialog, or go to the following pages in the index to see a list of them all: –Shape (class) –Number (class) –String (class) –Date (class)

Field Calculator Examples Autonumber records: rec + 1 Convert a number to string: [num].AsString Concatenate two string fields into one: –[str1] + [str2] (no space) –[str1] ++ [str2] (space between originals) Extract first 3 characters from a string: [str].Left(3)

Field Calculator Examples Convert a number to a string: [num].AsString Compute absolute value of a number: [num].Abs Get the maximum of two numeric fields: [num1] max [num2]

Map Calculator Double-click on a grid name and then you’ll be able to select request types from the list Use the AsGrid request to convert numbers to grids This example takes the base10 log of Grid1 and then adds 5 to that

Map Calculator Examples Create a grid that has true everywhere grid1 is NULL and false where grid1 has data: [grid1].IsNull Create a grid that has values from grid1 where grid3 is non-zero and values from grid2 everywhere else: [grid3].Con([grid1],[grid2]) Mosaics 3 grids together: [grid1].Mosaic({[grid2],[grid3]}) Check out the Grid (class) section in the help to see more requests

Basic Customization in ArcGIS Normal template Making your own toolbar The Visual Basic Editor Adding and running a Visual Basic script Attaching a script to a button Keyboard shortcuts

Normal Template Stores information (including customizations) for the ArcGIS application Anything saved in normal.mxt is available in all map documents Make sure you save customizations in the correct place (normal.mxt for global customizations, your.mxd file for project- specific customizations)

Making Your Own Toolbar Open the Customize dialog by either double-clicking on an empty spot in the toolbar or choosing Customize from the Tools menu Go to the Toolbars tab and click New Name your toolbar and choose the location to save it Your new toolbar will open when you click OK

Making Your Own Toolbar You can change the tooltip or icon, or delete a tool on your toolbar by right-clicking on it while the Customize dialog is open Go to the Commands tab in the Customize dialog Drag the commands you want onto your toolbar

The Visual Basic Editor Open the Visual Basic Editor by choosing Tools | Macros | Visual Basic Editor The Project window shows all of the code VB code available in the current project Code can be in normal.mxt or in the current project Code that you’re adding will most likely be in a regular Module

Adding a Visual Basic Script Open the Visual Basic Editor Right-click on one of the Module folders and either import the file or insert a new Module If you didn’t import the file, paste the code into the new Module Make sure the code compiles by choosing Debug | Compile Project

Running a Visual Basic Script From the Visual Basic Editor, choose Run | Run Sub/UserForm while your cursor is in the procedure you want to run From ArcMap, open the Macros dialog by choosing Tools | Macros | Macros, and then select the procedure you want to run and click Run

Attaching a Script to a Button Open the Customize dialog Go to the Commands tab Go to the Macros category Drag the macro you want to attach to a toolbar Right-click on your new tool to change tooltips and icons

Creating a Tool with Unique Code Sometimes you might want to create a button that runs code specific to it (rather than contained in a separate module) Open the Customize dialog and go to the Commands tab Select the UIControls category and click New UIControl Make sure UIButtonControl is selected and click Create

Creating a Tool with Unique Code You can change the name of your control by clicking on it twice (slowly) Drag the tool to a toolbar Right-click on the new button and choose View Source in order to view (and edit) the code

Keyboard Shortcuts Open the Customize dialog and click on the Keyboard button Select the command you want to create a shortcut for Put your cursor in the Press new shortcut key box and press the key combination you want to use You will see if that combination is already assigned (Currently assigned to section) If you want to use that combination, click Assign

Basics of Avenue Programming Basic concepts Classes and objects Avenue requests to find objects Places to get help

Basic Avenue Concepts Object oriented, which means you have a collection of objects that you send requests to There are many classes of objects (views, themes, etc), and more than one object of each class can exist Think of a particular object as a (really smart) variable and its class as a data type

Basic Avenue Concepts An object is smart enough to do its own processing, which is why you send requests to it (you tell a theme to turn itself on, for example, rather than telling the main ArcView application to turn a specific theme on) Before you can do any processing, you need to get a “handle” to the object you want to do processing on

Basic Avenue Concepts For example, if you want to turn a theme on, you: 1.Find the View 2.Find the Theme 3.Make the theme visible myView = Av.FindDoc(“View1”) myTheme = myView.FindTheme(“Theme1”) myTheme.SetVisible(true) Av.FindDoc(“View1”).FindTheme(“Theme1”).SetVisible(true)

Avenue Requests to Find Objects To find a view: myView = Av.FindDoc(“view_name”) To find a theme: myTheme = myView.FindTheme(“theme_name”) To get a vector theme’s attribute table: myTable = myTheme.GetFTab To get a field in an attribute table: myField = myTable.FindField(“field_name”)

Places to Get Help ArcView Help (the User Forums, Knowledge Base, and Downloads sections) Listservs at