0 Comment

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: Kazisida Migal
Country: Gabon
Language: English (Spanish)
Genre: Love
Published (Last): 10 April 2012
Pages: 97
PDF File Size: 16.61 Mb
ePub File Size: 5.20 Mb
ISBN: 593-2-50882-556-8
Downloads: 46273
Price: Free* [*Free Regsitration Required]
Uploader: Vudozuru

Second wizard screen for creating command button. The Add-In Manager dialog box.

ArcObjects SDK for VBA

Side-by-side view of VBA code and. If the ArcGIS templates do not show up when creating a new project, make sure you have.

There is one last thing to do before the code is ready to use. This code could be improved. Arcobjecys the button to show the county form that was just dragged to the toolbar. It must be manually re-created.

From the Solution Explorer, right-click FormButton. After changing the labels from caption to text, only one error remains. This is really the only major error in converting the code.


An easy way to do this is to export the form to be upgraded out of the VBA editor and open the exported file with the. That’s it for converting arcobjcets code.

How To: Create a new graticule using VBA and ArcObjects

Another way demonstrates one of the benefits of using the Visual Studio environment. They are authored in. All the code has been converted for the form. Copy the subroutine and paste it into the newly created form in the add-in project.

This opens the County Info dialog box. The Esri online help is very useful. However, note that when pasting the code, Visual Studio did convert some code automatically. Most of these will go away once the right references are added. This brings up Intelli-Sense and shows all the properties available to set on vna label. Right-click the form created in Visual Studio and pick View Code.

An error is triggered by ThisDocument. Close the Customize dialog box. This added a command button to the project. For more information on these topics, see the online help for ArcObjects for.

This is easily fixed by adding import statements at the top of the code. You might ask this after installing ArcGIS Go to the error lblCountyName.

In the OnClick event, add the following two lines:. Click the Close button to close the County Info dialog box. However, as demonstrated vbaa the next section, the code is reusable and easily upgraded. This will read the selected county information and display it on the form. At the very top of the code for the form, above the public class, add three import statements Figure 4. Now go to the Build menu and build the project. Drag the My Form Button from Commands and drop it on any toolbar.


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. Figure 5 shows the code before and after.

ArcGIS Desktop Help – Sample VBA code

In ArcMap, select a county on the map. It contains counties and states for the entire United States. They provide a declaratively based framework for creating a collection of customizations that can be conveniently packaged in a single compressed file that is easily shared.