Build your first add-in
This tutorial demonstrates how to create and run a basic ArcGIS Pro add-in.
With the ArcGIS Pro SDK for .NET, you can extend ArcGIS Pro with your own unique tools and workflows. Using Microsoft Visual Studio and the Pro SDK, developers can build Pro add-ins and solution configurations that provide users with custom functionality specific to their organization or industry. Add-ins can be developed and tailored to your specific users’ needs; for example, providing a new custom spatial analysis processing routine which leverages a custom dataset, or create a new set of Pro tools that streamline a complex editing workflow.
This tutorial is an introduction to developing ArcGIS Pro add-ins. You will use C# to create a new button which returns the current project path on the ArcGIS Pro UI.
Prerequisites
- Microsoft Visual Studio is required. See the ArcGIS Pro system requirements for latest version and compatibility.
- Install ArcGIS Pro version 3.0 or higher.
- Install the ArcGIS Pro SDK for .NET. See the Installation ProGuide for more information.
Steps
Create a new ArcGIS Pro Add-In Visual Studio Project
Start Visual Studio.
Choose File > New > Project and then from ArcGIS templates group, select ArcGIS Pro Module Add-in.
Compile and build the project.
From Windows Explorer, navigate to C:\Users\<Your user name>\Documents\ArcGIS\AddIns\ArcGISPro. You should see the add-in folder for your newly compiled add-in. Double-click the folder to find your add-in file within the folder, reflecting the name of your project with an
.esri
extension. The name of the folder corresponds to the ID (GUID) of your add-in as found in yourAddin X Config.daml
file.
Create a new button using a Pro SDK template
If your project is running, stop it. In the Solution Explorer, right-click the project and choose Add > New Item and then from the ArcGIS Pro Add-ins group select ArcGIS Pro Button from the list of item templates.
Use the default name of
Button1.cs
for the new class file and press Add to close the dialog box.Type the following code into the existing
O
method.n Click Use dark colors for code blocks Copy Compile and build the add-in project.
Run the project
Place a breakpoint in the margin of the
string
variable declaration, and then press Start to run the add-in project in the Visual Studio debugger. ArcGIS Pro will start and show the start page.URI From the start page, create a new empty project using a template of your choice or open an existing project. If creating a new project, specify a name and location of your choice.
Once the project opens, click the Add-In tab. Click your new button, named Button1, which used the default name of your button class. Your breakpoint will be hit in Visual Studio which you can review in your code.
Press F5 or Continue to continue execution. The message box should display with the project path. Press OK to close the message box.
Press Stop Debugging in Visual Studio, which will close ArcGIS Pro.
What's next?
Learn how to use additional ArcGIS Pro SDK for .NET features in these tutorials: