How To: Create a new graticule using VBA and ArcObjects. Summary. This article shows how to create a new graticule and set its properties in ArcMap. You might ask this after installing ArcGIS With the release of ArcMap 10, Visual Basic for Applications (VBA) is on the way out. As the online help article. Customizing and developing with ArcGIS > Writing macros using VBA the ArcGIS Desktop Developer Guide, or from Exploring ArcObjects.

Author: Zolorn Daijinn
Country: Martinique
Language: English (Spanish)
Genre: Photos
Published (Last): 13 April 2016
Pages: 150
PDF File Size: 8.87 Mb
ePub File Size: 12.20 Mb
ISBN: 271-9-58006-774-5
Downloads: 47048
Price: Free* [*Free Regsitration Required]
Uploader: Akigul

The Customize dialog box. Code view with errors and import statements.

After the project is built, the files are bundled as an add-in and automatically installed in ArcMap. Side-by-side view of VBA code and. In this example, it removed the word Set and it put parentheses around the command pFLayer.

Learning ArcObjects with VBA and .NET? – Geographic Information Systems Stack Exchange

Arcohjects 5 shows the code before and after. You might ask this after installing ArcGIS While it might have been easier to just retype Caption to Text, if the correct property is not known, this is a very useful feature.

NET, to set srcobjects text to the label, the property is called Text. The Esri online help is very useful. Because this article is intended to demonstrate the ease of converting VBA code to.


In conclusion, even though VBA is gone, with a little refactoring and a good bit of copying and pasting, existing VBA code can be reused in the new. There is one last thing to do before the code is ready to use. When the add-in project was created, the Button checkbox was checked. It contains counties and states for the entire United States. Migrating VB6 to VB. Arcohjects the code has been converted for the form.

NET, some of the description of the project creation process is not detailed. An error is triggered by ThisDocument. Now go to the Build menu and build the project.

Go to the error lblCountyName. This opens the County Info dialog box. Doing this lets Visual Studio use the shorter names also.

Not much has changed in the conversion between VBA and the add-in. Go to the Customize menu and pick Add-In Manager Figure 6verify the add-in loaded, and close the dialog box.

How To: Create a new graticule using VBA and ArcObjects

However, note that when pasting the code, Visual Studio did convert some code automatically. When all errors are fixed, Visual Studio displays the warning error “‘pFCursor’ is passed before it is assigned. This is where the work is done in the VBA sample, and this code needs to be copied and converted.


For more information on these topics, see the online arcobjeects for ArcObjects for. One way would be to simply replace the word caption with the word text. This opens the code for the button. There is one other major piece: For more detailed information, Esri has created a very good example. Paste the subroutine in the code vb.

How To: Create a new graticule using VBA and ArcObjects

They provide a declaratively based framework for creating a collection of customizations that can be conveniently packaged in a single compressed srcobjects that is easily shared. In the OnClick event, add the following two lines:. Most of these will go away once the right references are added. This is really the only major error in converting the code. In ArcMap, select a county on the map. The VBA sample for this exercise is a simple form that reads the selected county on the map and displays its information on the form.

Close the Customize dialog box. Go to the Customize menu and pick Customize Mode. Scroll down and pick the word Text.