Project 3: Intro to Programming ArcObjects (Part 2)

GEOG 484

Brian Buchanan

My boss liked the zoom toolbar I had created for Project 2, but asked me to program a function where the status bar flashed the map scale prior to zooming and after zooming.  While I did this, I also redesigned my code to be easier to read and access.  I put my code into a sub module, and then I made a call to the sub module while writing the program to display the status bar map scale.  These steps made the code easier to understand for other users.  I decided to add a message box displaying the map scale, because the status bar message flashed too quickly to actually be effective.  This is shown in Figure 1.

In addition to the main project, two exercises were included.  The main purpose of Exercise 1 was to expand or collapse the data frame’s list of layers within the Table of Contents.  An important first step was to make sure there were multiple data frames within the map document.  I then wrote a program that looped through all the data frames in the document.  The program identified if a layer within the Table of Contents was currently collapsed or expanded.  The program then took the results of the “If” statement and did the opposite in Figure 2.  When the program was run, the layers collapsed or expanded depending on their current condition.

Exercise 2 was concerned with taking an input string, and capitalizing the first three letters of the string.  This exercise was difficult at first until I figured out that I need to make a call to a function, and that within the function was where I used the VB functions “Left” and “UCase”.  After I figured this out, it was fairly straight forward programming to make an input box where the user entered a word (“String”) and returned in a message box the first three letters of the word in capital letters.

As always, I found using the OMD and the VB help to be the most confusing aspect of the project and exercises.  I have a feeling that even with a lot of programming experience; this will always be the case.  I feel that I am starting to understand the basics of the programming more and more; however, I still get lost very easily, and spend way too much time just trying to figure out what the lesson is trying to teach me.  In addition, the quizzes are becoming more confusing to me, even though I feel like I am able to understand the lesson and the projects.