Intro to ArcMap Customization with Visual Basic Create your own toolbars, buttons, interactive...
-
date post
20-Dec-2015 -
Category
Documents
-
view
248 -
download
14
Transcript of Intro to ArcMap Customization with Visual Basic Create your own toolbars, buttons, interactive...
![Page 1: Intro to ArcMap Customization with Visual Basic Create your own toolbars, buttons, interactive tools, and programs Runs behind the scenes in ArcMap.](https://reader031.fdocuments.us/reader031/viewer/2022013106/56649d4a5503460f94a27a76/html5/thumbnails/1.jpg)
Intro to ArcMap Customizationwith Visual Basic
Create your own toolbars, buttons, interactive tools, and programs
Runs behind the scenes in ArcMap Supported by extensive web help center Great addition to GIS skills on a resume
![Page 2: Intro to ArcMap Customization with Visual Basic Create your own toolbars, buttons, interactive tools, and programs Runs behind the scenes in ArcMap.](https://reader031.fdocuments.us/reader031/viewer/2022013106/56649d4a5503460f94a27a76/html5/thumbnails/2.jpg)
The ArcMap Interface
Powerful but complicated Many tasks require a multitude of steps Capabilities buried within many different toolbars Editing. Enough said.
Unfortunately Many organizations do just a couple of set tasks and
they do them often Many personnel / users who might benefit from simple
and straightforward GIS use are not trained in ESRI products Time (training, familiarization) is a limited resource
![Page 3: Intro to ArcMap Customization with Visual Basic Create your own toolbars, buttons, interactive tools, and programs Runs behind the scenes in ArcMap.](https://reader031.fdocuments.us/reader031/viewer/2022013106/56649d4a5503460f94a27a76/html5/thumbnails/3.jpg)
ArcMap Interface cont.
ArcMap (and more) can be customized to incorporate tools that: Provide shortcuts to common tasks Aggregate multiple steps into one click Simplify the built-in ESRI interfaces and tailor
them to the problem at hand
![Page 4: Intro to ArcMap Customization with Visual Basic Create your own toolbars, buttons, interactive tools, and programs Runs behind the scenes in ArcMap.](https://reader031.fdocuments.us/reader031/viewer/2022013106/56649d4a5503460f94a27a76/html5/thumbnails/4.jpg)
Yet more ArcMap Interface
ESRI provides an extremely comprehensive object library for its GIS components
All components you see here in ArcMap can be accessed behind the scenes
![Page 5: Intro to ArcMap Customization with Visual Basic Create your own toolbars, buttons, interactive tools, and programs Runs behind the scenes in ArcMap.](https://reader031.fdocuments.us/reader031/viewer/2022013106/56649d4a5503460f94a27a76/html5/thumbnails/5.jpg)
Adding Your Own CommandsFirst Steps
Start with a new toolbar Add new ‘UIControls’
Buttons Tools Combo Boxes Edit Boxes
Right-click and add code! Well…not quite that simple
![Page 6: Intro to ArcMap Customization with Visual Basic Create your own toolbars, buttons, interactive tools, and programs Runs behind the scenes in ArcMap.](https://reader031.fdocuments.us/reader031/viewer/2022013106/56649d4a5503460f94a27a76/html5/thumbnails/6.jpg)
Right-click toolbar area Scroll to bottom and
click ‘Customize’
![Page 7: Intro to ArcMap Customization with Visual Basic Create your own toolbars, buttons, interactive tools, and programs Runs behind the scenes in ArcMap.](https://reader031.fdocuments.us/reader031/viewer/2022013106/56649d4a5503460f94a27a76/html5/thumbnails/7.jpg)
Select ‘New’ toolbar Enter name Choose to save inside your
mxd file
Your new, empty toolbar appears on the screen
![Page 8: Intro to ArcMap Customization with Visual Basic Create your own toolbars, buttons, interactive tools, and programs Runs behind the scenes in ArcMap.](https://reader031.fdocuments.us/reader031/viewer/2022013106/56649d4a5503460f94a27a76/html5/thumbnails/8.jpg)
Now add controls Click the ‘Commands’ tab
and scroll to bottom of categories
Click ‘New UIControl’ Select the type of control
![Page 9: Intro to ArcMap Customization with Visual Basic Create your own toolbars, buttons, interactive tools, and programs Runs behind the scenes in ArcMap.](https://reader031.fdocuments.us/reader031/viewer/2022013106/56649d4a5503460f94a27a76/html5/thumbnails/9.jpg)
Style Controls Click on the control in the
list to give it a new name. When finished, click and
drag the control onto toolbar
Right-click control on toolbar to change label, icon, and specify display options (image only, etc)
![Page 10: Intro to ArcMap Customization with Visual Basic Create your own toolbars, buttons, interactive tools, and programs Runs behind the scenes in ArcMap.](https://reader031.fdocuments.us/reader031/viewer/2022013106/56649d4a5503460f94a27a76/html5/thumbnails/10.jpg)
Code Window
Also right-click control to specify behavior via code window
![Page 11: Intro to ArcMap Customization with Visual Basic Create your own toolbars, buttons, interactive tools, and programs Runs behind the scenes in ArcMap.](https://reader031.fdocuments.us/reader031/viewer/2022013106/56649d4a5503460f94a27a76/html5/thumbnails/11.jpg)
Use the ESRI Developer Network to find code examples
![Page 12: Intro to ArcMap Customization with Visual Basic Create your own toolbars, buttons, interactive tools, and programs Runs behind the scenes in ArcMap.](https://reader031.fdocuments.us/reader031/viewer/2022013106/56649d4a5503460f94a27a76/html5/thumbnails/12.jpg)
![Page 13: Intro to ArcMap Customization with Visual Basic Create your own toolbars, buttons, interactive tools, and programs Runs behind the scenes in ArcMap.](https://reader031.fdocuments.us/reader031/viewer/2022013106/56649d4a5503460f94a27a76/html5/thumbnails/13.jpg)
Many programming languages are supported in ArcGIS
Finding the examples you need for VBA will take some practice
![Page 14: Intro to ArcMap Customization with Visual Basic Create your own toolbars, buttons, interactive tools, and programs Runs behind the scenes in ArcMap.](https://reader031.fdocuments.us/reader031/viewer/2022013106/56649d4a5503460f94a27a76/html5/thumbnails/14.jpg)
VBA Code for Selecting Features
![Page 15: Intro to ArcMap Customization with Visual Basic Create your own toolbars, buttons, interactive tools, and programs Runs behind the scenes in ArcMap.](https://reader031.fdocuments.us/reader031/viewer/2022013106/56649d4a5503460f94a27a76/html5/thumbnails/15.jpg)
VBA Code 2
Sets up objects for a layer, the map doc, and the main map
Connects the new objects to your open map document, the first data frame, and the first layer in the list
Sets up query object & specify conditions Sets up selection set object
Assigns the selection set to the results of the select query
![Page 16: Intro to ArcMap Customization with Visual Basic Create your own toolbars, buttons, interactive tools, and programs Runs behind the scenes in ArcMap.](https://reader031.fdocuments.us/reader031/viewer/2022013106/56649d4a5503460f94a27a76/html5/thumbnails/16.jpg)
Example map document and customized toolbar with 3 specialized buttons
![Page 17: Intro to ArcMap Customization with Visual Basic Create your own toolbars, buttons, interactive tools, and programs Runs behind the scenes in ArcMap.](https://reader031.fdocuments.us/reader031/viewer/2022013106/56649d4a5503460f94a27a76/html5/thumbnails/17.jpg)
The Zoom to Full Extent button always takes you to the extent of the largest layer
However…
![Page 18: Intro to ArcMap Customization with Visual Basic Create your own toolbars, buttons, interactive tools, and programs Runs behind the scenes in ArcMap.](https://reader031.fdocuments.us/reader031/viewer/2022013106/56649d4a5503460f94a27a76/html5/thumbnails/18.jpg)
You can create a button that zooms exactly to a certain spot as a shortcut
Or a button that selects a subset of features of interest without the user having to specify the select by attribute query
![Page 19: Intro to ArcMap Customization with Visual Basic Create your own toolbars, buttons, interactive tools, and programs Runs behind the scenes in ArcMap.](https://reader031.fdocuments.us/reader031/viewer/2022013106/56649d4a5503460f94a27a76/html5/thumbnails/19.jpg)
Classroom Finder 1
You can tell a button to load a specialized form that takes input, then does processing that you specify in code.
![Page 20: Intro to ArcMap Customization with Visual Basic Create your own toolbars, buttons, interactive tools, and programs Runs behind the scenes in ArcMap.](https://reader031.fdocuments.us/reader031/viewer/2022013106/56649d4a5503460f94a27a76/html5/thumbnails/20.jpg)
Classroom Finder 2
Restrict input to options in drop-down boxes . . .
![Page 21: Intro to ArcMap Customization with Visual Basic Create your own toolbars, buttons, interactive tools, and programs Runs behind the scenes in ArcMap.](https://reader031.fdocuments.us/reader031/viewer/2022013106/56649d4a5503460f94a27a76/html5/thumbnails/21.jpg)
Classroom Finder 3
You can simplify a query, and then condense the query, zooming, and display of the results as you choose
Beginnings of a classrom finder?
![Page 22: Intro to ArcMap Customization with Visual Basic Create your own toolbars, buttons, interactive tools, and programs Runs behind the scenes in ArcMap.](https://reader031.fdocuments.us/reader031/viewer/2022013106/56649d4a5503460f94a27a76/html5/thumbnails/22.jpg)
Wrap-Up
Familiarization will require some experimentation, but very rewarding
Full libraries, discussion forums, and code examples online at: http://edn.esri.com/index.cfm?fa=docLibrary.gateway
Multiple programming languages supported VB, VB.NET, C, C++, Java