Getting started with ArcObjects 1
In this post we will see how to use the ArcGis templates in .Net, how to create the default toolbar and add some default command buttons in the toolbar.
Expected prerequisites for this session is 1.DotNet 2010 and 2.ArcGIS 10.2 should be installed your desktop. Installations part we will cover in coming posts.
Run DotNet 2010 with administrator privileges
Create new project by clicking on File -> New -> Project
From installed templates list select ArcGIS -> Extending ArcObjects then choose Class Library (ArcMap) and .Net Framework 4. If you want you can change the Project Name, Location and Solution name by changing the below textbox text.
.
Once you done with all click on OK button. Right now i am creating with default name ArcMapClassLibrary1. As soon as you click on OK, you will prompt with other wizard as shown in below
For now i suggest to select all the Assemblies under Desktop ArcMap by holding Ctrl and select. Then click Add, you can see all the selected items listed below. Then click Finish.
You can see one empty class with some default code as shown in below.
Select the project and right click and choose add -> NewItem as shown below
As soon as you choose you select you can prompt with Add New Item wizard.
Goto ArcGIS -> Extending ArcObjects select Base Toolbar. If you want you can change the name. I changes it as "BloggerTestToolbar.cs".
Click Add. You will prompt with another wizard
Change the caption, and uncomment the constructor code as shown in below. I changed the caption to "My Blogger First C# Toolbar".
Once its done, its done. You created your first ArcMap tool bar with Zoom, Undo and Redo commands. Don't believe.... build your application and open the ArcMap, Go to Customize -> Customize Mode..
Toolbars -> search for your toolbar and select
New toolbar created with Zoom, Undo and Redo commands. Its as simple as we don't believe.You can add layers and you can play with these buttons.
In next post we will see how its possible and some important points on this toolbar class.