ArcGIS: Difference between revisions

From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs)
mNo edit summary
Brian Wilson (talk | contribs)
Line 18: Line 18:


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.
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.
You can visit the ESRI Support Center [http://support.esri.com/index.cfm?fa=downloads.geoprocessing.gateway Geoprocessing] page
Many ESRI books are available from [http://support.esri.com/index.cfm?fa=knowledgebase.documentation.viewDoc&PID=43&MetaID=694 ESRI documentation library] as PDF files.
'''Python resources:''' The official [http://www.python.org/topics/learn/ Beginner's Guide to Python] and the book for programners, [http://diveintopython.org/ Dive into Python] (available online, PDF, or even on paper.)


==== What about older versions of ArcGIS? 8.3?? ====
==== What about older versions of ArcGIS? 8.3?? ====

Revision as of 20:57, 23 September 2005

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.

You can visit the ESRI Support Center Geoprocessing page

Many ESRI books are available from ESRI documentation library as PDF files.

Python resources: The official Beginner's Guide to Python and the book for programners, Dive into Python (available online, PDF, or even on paper.)

What about older versions of ArcGIS? 8.3??

What if I don't have ArcGIS Desktop?

What if I want an application or tool to run on a Windows client that does not have ArcGIS installed?

What if I want the tool to run on a Linux system?

ArcObjects containers

You can group tools for ArcCatalog into toolboxes called .tbx files. This is just a convenient way to handle them as groups in the ArcToolbox UI. The tools themselves still live in their .py files.

Languages

VB and VBA

Use VB to create complete standalone executables. Or C++ or C#.

VBA is the version of VB that is embedded in other apps like ArcMap and Powerpoint. Use it to glue your own custom GIS functionality to those apps.

What about .NET?

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" where you can learn more about it. Using .NET requires Visual Studio .NET, which I don't have. That's that.

Python

Python is supported in ArcGIS 9.x as a scripting language. (In fact some of the ArcToolbox tools are written in it.) This is nice because it's available cross-platform; if you learn Python you might not have ArcObjects on your Linux box but the language itself is probably already installed there so all the other features are available.

Other languages

Not officially supported. Any scripting language that runs under Windows and supports COM should work. How about perl?

Perl

Sample ArcObjects applications

Check the Conversion Tools in ArcToolbox. Any tool with an "S" icon is a script. Right-click it and select "edit" to see the code. I have Python 2.4 installed so this does not work. But I can use the Properties dialog for the script, copy the file name from the Source tab and then open the file in PythonWin 2.4

gpstools GPS data processing

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

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.