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: Daigami Zulkigal
Country: Saint Lucia
Language: English (Spanish)
Genre: Relationship
Published (Last): 7 October 2015
Pages: 359
PDF File Size: 6.93 Mb
ePub File Size: 14.85 Mb
ISBN: 350-9-78763-905-5
Downloads: 24473
Price: Free* [*Free Regsitration Required]
Uploader: Tojakree

At the very top of the code for the form, above the public class, add three import statements Figure 4. The next fix addresses something that happens a lot when converting code from VBA to.

Scroll down and pick the word Text. Another way demonstrates one of the arcobjechs of using the Visual Studio environment. NET, to set the text to the label, the property is called Text. This example requires two references.

Drag the My Form Button from Commands and drop it on any toolbar. However, note that when pasting the code, Visual Studio did convert some code automatically.

Go to the error lblCountyName.

From the Solution Explorer, right-click FormButton. The Esri online help is very useful.

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

Figure 5 shows the code before and after. They are authored in. This is where the work is done in the VBA sample, and this code needs to be copied and converted. This code could be improved. In the OnClick event, add the following arcobjevts lines:. Because this arcobjetcs is intended to demonstrate the ease of converting VBA code to.


Migrating VB6 to VB. This is easily fixed by adding import statements at the top of the code. First wizard screen encountered when creating an add-in.

In this arcobjdcts, it removed the word Set and it put parentheses around the command pFLayer. That’s it for converting the code. Paste the subroutine in the code behind. Place the cursor at the end of the word lblCountyName and press the period key. Go to the Customize menu and pick Customize Mode.

How To: Create a new graticule using VBA and ArcObjects

He can be contacted at cgallant ljbinc. Side-by-side view of VBA code and.

Doing this lets Visual Studio use the shorter names also. In ArcMap, select a county on the map. For more detailed information, Esri has created a very good example.

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.

When the add-in project was created, the Button checkbox was checked. In the Customize dialog box, click the Commands tab Figure 7. To set the text to the labels in VBA, the property is called Caption. When all errors are fixed, Visual Studio displays the warning error “‘pFCursor’ is passed before it is assigned.


This brings up Intelli-Sense and shows all the properties available to set on the label. After changing the labels from caption to text, only one error remains. 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. Choose Add-In Controls from Categories the category that was defined when creating the add-in.

The Customize dialog box. This is easy enough to fix. Search the online help for the article “Walkthrough: The Add-In Manager dialog box. Click the button to show the county form that was just dragged to the toolbar. Most of these will go away once the right references are added. One way would be to simply replace the word caption with the word text. This opens the code for the button. This is really the only major error in converting the code.

It must be manually re-created. However, as demonstrated in the next section, the code is reusable and easily upgraded.