Skip to content

ProConcepts ArcGIS Pro Add in Samples

Wolf edited this page Feb 22, 2023 · 20 revisions
Language:      C# and Visual Basic
Subject:       Framework
Contributor:   ArcGIS Pro SDK Team <arcgisprosdk@esri.com>
Organization:  Esri, https://www.esri.com
Date:          01/31/2023
ArcGIS Pro:    3.1
Visual Studio: 2022

In this topic

What is an ArcGIS Pro Sample?
Purpose of the ArcGIS Pro Samples
ArcGIS Pro Samples Topics
Contribute Samples
Elements of an ArcGIS Pro Sample
Sample Face Page


What is an ArcGIS Pro Sample?

An ArcGIS Pro Add-In Sample is a standalone C# or Visual Basic project that demonstrates a specific functionality of ArcGIS Pro using its .NET API. ArcGIS Pro Add-In Samples are available in this repository arcgis-pro-sdk-community-samples.

arcgis-pro-sdk: Samples in this repository are the cannonical ArcGIS Pro Add-In Samples. The samples in this repository are written and maintained by the ArcGIS Pro teams. The purpose of these are samples are for demonstrating the key functionalities in the following areas of ArcGIS Pro: Content, Framework, Editing, Geodatabase, Geometry, Geoprocessing, Layouts, Map Authoring, Map Exploration, CoreHost, DataReviewer, Tasks, Sharing, and Workflow Manager. If you encounter any issues with these samples, please submit a GitHub issue in this repo. Browse the table of contents to your right to see the available samples in this repository.

arcgis-pro-sdk-community-samples: New sample contributions from the user community are welcomed into this repository. Click here to learn how to contribute code samples.

Purpose of the ArcGIS Pro Samples

The goal of ArcGIS Pro Samples is to provide developers some guidance on how to use the new ArcGIS Pro .NET API to extend ArcGIS Pro. We hope to illustrate common tasks, useful workflows, UI design tips that integrates the add-in well within the application and other powerful capabilities of ArcGIS Pro. These samples also demonstrate the coding guidlines to use while you develop with ArcGIS Pro.

ArcGIS Pro Samples Topics

ArcGIS Pro Samples in the arcgis-pro-sdk-community-samples repository are categorized into a set of pre-defined topics. The sample will be placed in a physical folder that corresponds to the topic name. The add-in's config.daml file will also contain metadata that lists the topic. For example, if the Add-in illustrates Map Authoring and Geoprocessing then the <Subject></Subject> tag in the Config.daml would look like this:

<ArcGIS defaultAssembly="MySample.dll" ...>
  <AddInInfo id={ae979067-......>
    ---
    <Subject>Map Authoring,Geoprocessing</Subject>
    ---
  </AddInInfo>

Note: the default topic, if none are selected, is Framework

Content

Functionality that alters, edits, and/or manipulates the project content of ArcGIS Pro. This includes sharing and search APIs, portal, database, and server connections. Content functionality is primarily found in the ArcGIS.Desktop.Core.dll and ArcGIS.Desktop.Catalog.dll.

Framework

Functionality that customizes, extends, or uses the ArcGIS Pro framework to include executing core commands, events, notifications, menus, conditions, tasks, DAML configuration, custom property sheets, backstage tabs, or custom project and application settings. Framework functionality is found in ArcGIS.Desktop.Framework.dll.

Editing

Functionality that edits features or uses edit settings such as snapping. Editing functionality is found in ArcGIS.Desktop.Editing.dll.

Geodatabase

Functionality that uses the fine-grained Geodatabase API. Geodatabase API functionality is found in ArcGIS.Core.dll. Geodatabase would commonly be used in conjunction with Map Exploration, Map Authoring, and Editing.

Geometry

Functionality that uses the fine-grained Geometry API. Geometry API functionality is found in ArcGIS.Core.dll. Geometry would commonly be used in conjunction with Map Exploration and Editing.

Geoprocessing

Functionality that uses the Geoprocessing API (to execute and manipulate GP tools). Geoprocessing API functionality is primarily found in ArcGIS.Desktop.Core.dll.

Layouts

Functionality that manipulates, configures, edits, or uses Layouts. Layouts API functionality is found in ArcGIS.Desktop.Mapping.dll and ArcGIS.Desktop.Layouts.dll.

Map Authoring

Functionality that creates, manipulates, edits, or uses Maps and Layers. This includes properties, symbology, renderers, and table of contents, Map Authoring API functionality is primarily found in ArcGIS.Desktop.Mapping.dll.

Map Exploration

Functionality that manipulates and interacts with the mapview. This includes bookmarks, camera, time, feature selection tools, identify, SLAP, and measure. Map Exploration API functionality is primarily found in ArcGIS.Desktop.Mapping.dll.

CoreHost

This topic provides a brief introduction to building stand-alone apps with the ArcGIS Pro ArcGIS.CoreHost and ArcGIS.Core assemblies. CoreHost API functionality is primarily found in ArcGIS.CoreHost.dll and ArcGIS.Core.dll.

DataReviewer

The ArcGIS.Desktop.DataReviewer namespace provides access to the classes and members that offer the ability to manage Reviewer results, sessions, and batch job items. DataReviewer API functionality is primarily found in ArcGIS.Desktop.DataReviewer.dll.

Raster

Functionality that manipulates, configures, edits, or uses Raster data. Raster API functionality is found in ArcGIS.Desktop.Core.dll.

Tasks

The ArcGIS.Desktop.TaskAssistant namespace provides access to the classes and members that offer the ability to access, open, close or export task items. Tasks API functionality is primarily found in ArcGIS.Desktop.TaskAssistant.dll.

Sharing

The ArcGIS.Desktop.Core namespace provides access to the classes and member that offer access to Portal and ArcGIS Online resources. Sharing API functionality is primarily found in ArcGIS.Desktop.Sharing.dll.

Workflow Manager

The ArcGIS.Desktop.Workflow namespace provides access to classes and members that allow you to, establish and manage a Workflow Manager database connection, create jobs and configure their properties, execute job workflows and queries, and retrieve configuration information from the Workflow Manager database. Workflow Manager API functionality is primarily found in ArcGIS.Desktop.Workflow.dll.

Contribute Samples

We welcome sample contributions from everyone to the arcgis-pro-sdk-community-samples repo. Samples have to follow certain guidelines in order to be accepted into this repo. This wiki provides step by step instructions on how to create an ArcGIS Pro Sample that is ready for the arcgis-pro-sdk-community-samples repo.

Elements of an ArcGIS Pro Sample

When you have an ArcGIS Sample ready for contribution, use the checklist below to confirm that you have met all the requirements for it to be accepted into the arcgis-pro-sdk-community-samples repository. Once the sample has been accepted a Sample Face Page is automatically generated and added to your solution.

1. Turn on the XML Documentation for your sample. (Required)

Right click the project node and select Properties from the context menu choices. In the project Properties dialog, select the Build tab and turn on XML Documentation File checkbox.

XML-doc.png

2. Provide triple slash comment for the Module class. (Required)

At a minimum, the Summary tag should explain the purpose of the sample. The information provided in the Summary tag will be the Abstract for the sample face page. Additionally, the Remarks tag can be filled with some extra information that you want to share about the sample. This is where you can provide screenshots of your sample. Screenshots should be included in your project in a screenshots folder. This information will be used in the How to use the sample section of the sample face page. This triple slash comment you provide will enhance the search engine hits for your sample. A good example of a triple slash comments for a Module class is illustrated below.

/// <summary>
/// This sample provides a new tab and controls that allow you to set the 
/// time in the map view, step through time, and navigate between time 
/// enabled bookmarks in the map.
/// </summary>
///<remarks>
/// ##### How to use the sample

/// 1. In Visual Studio click the Build menu. Then select Build Solution.
/// 2. Click Start button to open ArcGIS Pro.
/// 3. ArcGIS Pro will open. 
/// 4. Open a map view that contains time aware data. Click on the new 
/// Navigation tab within the 
/// Time tab group on the ribbon.
/// ![UI](screenshots/UICommands.png)
/// 6. Within this tab there are 3 groups that provide functionality to 
/// navigate through time.
/// 7. The Map Time group provides two date picker controls to set the 
/// start and end time in the map.
/// 8. The Time Step group provides two combo boxes to set the time step 
/// interval. The previous and next 
/// button can be used to offset the map time forward or back by the 
/// specified time step interval.
/// 9.. The Bookmarks group provides a gallery of time enabled bookmarks 
/// for the map. Clicking a bookmark in the 
/// gallery will zoom the map to that location and time. 
/// It also provides play, previous and next buttons that can be used to 
/// navigate between the time enabled bookmarks. 
/// These commands are only enabled when there are at least 2 bookmarks 
/// in the map. Finally it provides a 
/// slider that can be used to set how quickly to move between 
/// bookmarks during playback.
///</remarks>
internal class TimeModule : Module
{..

3. Provide triple slash comments for all the classes in your sample. (Required)

4. Fill the metadata section at the top of config.daml. (Required)

The information you provide here will be used in the sample face page to create the Shipping Label.

<AddInInfo id="{57f1bfc8-4ec8-4178-9000-2a7d2b956cea}" version="1.0"  
		desktopVersion="1.0.1387">
	<Name>Time Navigation</Name>
	<Subject>Map Exploration</Subject>
	<Description>Adds additional controls to navigate through time.</Description>
	<Image>Images\AddinDesktop32.png</Image>
	<Author>ArcGIS Pro SDK Team</Author>
	<Company>Esri</Company>
	<Date>9/3/2014 4:45:39 PM, 2014</Date>
</AddInInfo>

5. Add this exact Copyright header to the top of every source file. (Required)

C#
//   Copyright 2019 Esri
//   Licensed under the Apache License, Version 2.0 (the "License");
//   you may not use this file except in compliance with the License.
//   You may obtain a copy of the License at

//       https://www.apache.org/licenses/LICENSE-2.0

//   Unless required by applicable law or agreed to in writing, software
//   distributed under the License is distributed on an "AS IS" BASIS,
//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//   See the License for the specific language governing permissions and
//   limitations under the License. 
Visual Basic
'   Copyright 2019 Esri
'   Licensed under the Apache License, Version 2.0 (the "License");
'   you may not use this file except in compliance with the License.
'   You may obtain a copy of the License at

'       https://www.apache.org/licenses/LICENSE-2.0

'   Unless required by applicable law or agreed to in writing, software
'   distributed under the License is distributed on an "AS IS" BASIS,
'   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
'   See the License for the specific language governing permissions and
'   limitations under the License. 

Samples face page

Each sample has a face page in markdown format (.md) which contains metadata and description information for the sample. Key elements of a face page are:

  1. Title of the Sample
  2. Abstract
  3. Shipping Label
  4. Navigation links
  5. How to use the Sample section

Anatomy of a Sample Face Page