ArcGIS

From Wildsong
Jump to navigationJump to search

ArcObjects

What is "ArcObjects"

A set of classes that provide an interface to ESRI's desktop GIS product.

Where to start?

You might want to get a handle on Visual Basic first... or some object-oriented language anyway.

  • First take the ESRI Campus workshop "Getting Started with ArcObjects in ArcGIS"
  • Next try "Getting Started with Scripting in ArcGIS" - includes an intro to Python.
  • Next read the book "Getting To Know ArcObjects" (by Robert Burke)
  • If you did not already install the Devoper's Tools when you installed ArcMap on your computer, do that. Then go peruse the online help. (Start->Programs->ArcGIS->Developer Help->VB6 Help)

Both the workshop and the book are based on VBA. Any application (such as PowerPoint) or language (Python) that supports COM (or has VBA) can use ArcObjects.

VBA Toolkit CD - There is a toolkit CD available for free from ESRI. Mentioned in the ArcObjects course. I could not find mention of it on the Web site.

What about .NET?

Yeah, what about it? And like, what is it anyway? Why should I care?

ArcObjects does not require .NET; any language that supports COM can use ArcObjects. But you can do more with ArcWEB using .NET.

There is an ESRI campus workshop called "Migrating to VB .NET".

Using .NET requires Visual Studio .NET, which I don't have. That's that.

Sample ArcObjects applications

flightcheck - A utility to read an mxd file and to make creating a cdrom containing all data required

Languages

VBA

Python

Misc

From the ArcGIS mailing list

Method to insert data entry forms

Eric O’ Neal

Make a new project, or open the macro editor of your old one, and add the form. After that, go back to the map and right click somewhere in one of the grey toolbars. Scroll down to 'Customize'. Click the 'Commands' tab at the top and change the "save in:" to 'your project' (not ' Normal.mxt'. In the left box, scroll down to 'UIcontrols'. Click 'New Control'.->>'Button Control' Drag the new button to a toolbar. Right click the new button and select 'View Source'. You will see the click event. type in:

'frm1.show'

The button should work now. You can make new Toolbars in the 'Customize' part and drag this button on to them if you want.

Lawrence Hartpence

The way that I have brought data entry forms into ArcGIS is by adding UIControls. In ArcMap, go to the "Tools" menu and then select "Customize". Select the "Commands" tab and scroll down to the "UIControls". After you select "UIControls", three buttons will appear below the pick list, click on the one that says "New UIControl..." A window will pop up with an array of different controls you may create. Choose new UIButton Control. Once this control is created, you will see it in a pick list on the Right side of the "Customize" window. Click on the new UIButton control and drag it to one of the toolbars. Once on the toolbar, right click on the button and in the menu which Pops up, choose "View Source". This takes you to VBA. You access the form by typing the form's name Then ".show (0)" in the Sub which is automatically set up for your UIButton control. It will look something like this: Private Sub UIButtonControl1_Click() QueryForm.Show (0) End Sub

Nick Seigal

(1) VBA is embedded in ArcGIS. You can access the Visual Basic Editor from the Tools menu. VBA has its own forms engine that is different from that in VB (more on that later). Much like in Excell or Access, you can create code and even forms that run like macros. These can be added by hand to the interface of a map document or even to the Normal template (so that they are available in all new Map Documents).

(2) VB6 is often used (although you could also use VB.Net, C++ or C#) to create what is called an "extension" to ArcMap. An example of this approach are ESRI's own extensions, such as Spatial Analyst. To add functionality to ArcMap in this way requires fairly advanced VB skills, although there are many small and fairly easily tweaked samples that you might get to work without having to mess with the extension sturcture. All you would need to do is have the Visual Basic 6 development environment on your machine and take an ESRI sample, add the VB form and data editing functionality you want to that extension framwork and compile the extension as a .dll file. Then, when this file is registered with Windows and with the ESRI COM Categories (ESRI Add Ins to VB6 help with these tasks), the fuctionality will Appear like magic in ArcMap.

(3) Model Builder can be used to create tools for ArcToolbox that use form-like interfaces and which do basic editing tasks. Check out the documentation on that tool for more details.