Select to view content in your preferred language

ArcGIS Pro SDK for .NET: Editing add-samples

190
0
Tuesday
JMutunga
Esri Contributor
3 0 190

This blog highlights resources to extend data editing capabilities in ArcGIS Pro using the ArcGIS Pro SDK for .NET. If the idea to tailor your editing experience to better suit your organization's needs has crossed your mind, the resources and samples discussed here can help you get started. 

Download samples and get started

To download the ArcGIS Pro 3.6 add-in samples, go to the GitHub ArcGIS Pro Community Samples page, expand Code and click Download ZIP. Note that the downloaded ZIP file contains all of the repository's files.

Code.jpg

Download the ZIP folder of the repository's files locally so you can use or customize any of the samples. 

See also Downloading files from GitHub for other options to acquire a copy of the repository's files. 

Unzip the folder and look for the Editing subfolder which contains all the samples discussed in this blog. Next, you will need a supported version of Visual Studio installed. You can then download and install ArcGIS Pro SDK for .NET components from within Visual Studio. Samples discussed in this blog pertain to ArcGIS Pro 3.6, but if you are using an older 3.x series, do the following:

  1. Open the sample solution in Visual Studio
  2. From the Solution Explorer, open Config.daml and change desktopVersion.

Hint: You can get the full version of ArcGIS Pro through Start > Settings > Apps > Installed apps.

InstalledApps.jpgVisualStudio.jpg

Get ArcGIS Pro version details from Windows Installed Apps to update desktopVersion 

For more information about each editing sample, including but not limited to setup steps and how to use it, open the ReadMe.md file within Visual Studio or any other text file editor. You can download sample data mentioned in some of the samples from here.

Editing subfolder samples

These samples have been categorized based on function for easy understanding and discoverability. Note that these samples may require further customization to achieve meaningful functionality.    

Feature/Row construction

  • BeforeSketchCompleted - Explores how to use an event to adjust sketch geometry before finalizing it, specifically setting Z values to match a defined elevation surface regardless of existing Z settings.
  • ConstructionTool  - Highlights the use of the SketchTool to construct features and perform attribute edits.
  • ConstructionSplitTool (new!) - Introduces three tools for constructing and splitting geographic features in a single edit. The PointSplitsLines tool creates a point feature using the active template and splits any intersecting line features at that location. The LineSplitsLines tool generates a line feature that splits intersecting lines from both the same layer and other editable line layers in the map. Lastly, the LineSplitsPolygons tool creates a line that splits intersecting polygon features and is itself divided at points where it intersects those polygons.
  • ConstructionToolWithOptions - Presents construction tools with runtime parameters. It includes a BufferedLineTool that creates polygons from buffered lines, and a CircleTool that generates circular arcs from points using a user-defined radius. The CircleTool supports adjusting tool options for multiple templates, but the BufferedLineTool does not.
  • ConstructToolWithOptions - Illustrates how to build a point construction tool with the option to select the feature subtype when the point is created.
  • CrowdPlannerTool - Features a crowd planning construction tool that automatically populates attributes from a sample record, allows users to digitize new polygons, and provides interactive controls for adjusting values—all in the Crowd Planner pane.
  • ReplaceSketch - Adds the Replace Sketch command to the sketch context menu, allowing users to quickly incorporate the shape of an existing line or polygon feature into their editing sketch by right-clicking the feature. This functionality is especially helpful when creating a sketch based on existing features, such as using a road or stream to split a polygon.
  • RestartSketch - Demonstrates how to use an edit sketch context menu to restart a sketch from the last vertex when creating offset-based sketches. After starting editing on a polyline layer, the user places the first vertex by snapping to a point and setting direction and distance constraints. A new vertex is added at the specified offset, and then the sketch can be restarted from this vertex using the Restart Sketch option in the context menu, allowing the user to continue drawing from the adjusted starting point. This can be useful when designing utility or road alignments that require precise offsets. Restart Sketch is different from built-in Continue Feature, which extends an existing, completed feature by adding new segments.
  • SketchRemoveCurves - Focuses on removing curves from a sketch before completion, replacing them with straight segments.
  • TableConstructionTool - The Table Construction tool supports a range of workflows — basic, intermediate, and advanced—designed to extend its capabilities beyond standard record creation. In the basic workflow, users can create a single record in a nonspatial table, such as the out-of-the-box functionality. The intermediate workflow introduces interactive map-based selection, allowing users to select multiple features on the map, with each selection generating a corresponding record in the table and enabling attribute transfer from the selected features. The advanced workflow builds on this by automatically guiding users to the Active Template pane, where they can choose the source layer and configure attribute transfer by selecting both source and target fields. This tiered approach empowers users with increasing levels of control and automation, making the Table Construction tool adaptable to a wide variety of data entry and mapping scenarios.

Feature templates editing

  • EditingTemplates - Demonstrates how to create and modify editing templates using the Cartographic Information Model (CIM), including group templates. It also shows how to retrieve templates and use them to create features with customized attribute values.

Attribute editing

  • EditorInspectorUI - Shows how to use the Inspector and InspectorProvider classes to display and customize feature attributes in a grid UI. Users can modify field visibility, order, and behavior, creating a tailored inspector experience through code-based customization.
  • Inspector_AddAttributeAsync -  Applies user-defined attributes to selected features using Inspector.AddAttributeAsync. After entering values in a grid, users sketch a rectangle to identify features, which are then updated with the specified attributes.
  • InspectorTool - Allows users to select point features and edit their attributes directly through the Inspector interface in the Modify Features pane.
  • TransferAttributes - Demonstrates two methods for transferring attributes between features while also accessing and leveraging Field Mapping options to define how source layer attributes are processed and copied to target layer fields. In this sample, the Transfer Attributes between Features tool copies attributes from one polygon feature to another, updating its symbology. The Transfer Attributes from Templates tool is used to apply attributes from a predefined template to other features by clicking them on the map.
  • UpdateAttributesWithSketch - Introduces a sketch tool that updates attributes of intersected features by detecting intersections and applying edits through an edit operation.
  • ViewAndEditData - Demonstrates how to display and edit tabular data using a Table Control and Inspector (like Attribute pane view). Users can view and modify attributes from map layers or tables and browse external datasets in read-only mode.
  • TableFeatureClassOperations - Includes a sequence of attribute editing operations such as computing a field’s maximum value, duplicating and updating records, selecting new records, and logging changes in a table.

Modify features

  • DivideLines - Provides a line-splitting tool that divides a line into equal parts or segments of a specified length. It uses a map tool with a user input dialog, following the MVVM pattern common to editing tools in the Modify Features pane.
  • ExtendTool - This custom sketch tool sample emulates the Extend functionality from ArcMap by allowing users to interactively extend a line feature toward a selected polyline or polygon using a point-based sketch and an edit operation. Unlike the built-in Extend or Trim tool in ArcGIS Pro—which provides a streamlined, out-of-the-box experience for extending or trimming line geometries based on spatial relationships—the sample tool showcases how developers can build similar functionality from scratch, providing flexibility in customizing behavior, geometry handling, and user interaction. While the ArcGIS Pro tool is optimized for quick editing tasks in the Modify Features pane, the sample tool demonstrates deeper control over the editing workflow, including how to programmatically manage geometry updates and integrate with the editing framework. Both tools serve the same core purpose—modifying line geometry—but the sample is ideal for learning or tailoring the experience, whereas the ArcGIS Pro tool is designed for efficiency and ease of use in production environments.
  • SketchToolDemo - Introduces a cut tool that splits intersected polygons by sketching a line across existing features.
  • SplitPolygon - Demonstrates how to split a polygon using a selected line that crosses the polygon and then updates attributes of the newly created feature. 

Automated editing workflows

  • AddFeatureTest - Highlights how to create feature classes with attributes and how to add new features to those newly created feature classes within the map extent.
  • CopyLayer - Shows how to duplicate a feature layer into the default geodatabase, re-create its spatial attributes, add two new fields, copy the spatial data, and add the new feature class to the map.
  • DatasetCompatibility - Shows how to check dataset compatibility when building an editing add-in. It helps determine whether datasets use long transaction semantics (supporting undo/redo) or short semantics (direct edits without undo/redo).
  • DemoUseSelection - Demonstrates how editing tools can use keyboard shortcuts to switch selection mode and how to check or change a project's editing status. It highlights using default and custom keys for selection and managing editing state with IsEditingEnabled.
  • DuplicateAndSelect - Introduces a quality assurance(QA) review workflow with tools for visually inspecting and annotating data. Users can duplicate selected features and table rows using controls on the Add-in tab, helping streamline data validation and maintain selection context during review.
  • EditEvents - Features the EditEventsSpy dock pane, which listens to the editing Row, Completing, and Completed events.
  • EditOperationRowEvent - Shows how to track edits using the running EditOperation within row events. It includes tools to initialize an edit log, create features, and monitor real-time updates to a log table as features are edited or undone.
  • ModifyNewlyAddedFeatures - Demonstrates how to update polygon geometry and attributes while preventing overlaps with existing features. It also logs each change by storing the polygon’s center point and a description in a separate feature class, showcasing geometry correction and change tracking. See Row Events ProConcepts for more information.
  • RowEventTest - Uses row events to track feature creation and modification. It includes tools to generate and edit polygons, with event details shown in a dock pane.
  • TableViewerTest - Exercises the functionality of the TableView control.

3D editing

  • CreatePointsAlongLine3D - Provides a point construction tool to create points along a 3D line.
  • MainConnectorManhole  - Showcases a sketch tool that creates multiple features in 3D. It demonstrates a line sketch tool, working with 3D geometry, and edit templates.
  • MultipatchBuilder - Demonstrates how to construct and modify multipatch geometries using the MultipatchBuilderEx class, including support for applying materials and textures.

Geometry properties grid

  • GeometryControl - Demonstrates the use of the GeometryControl UI to view sketch or geometry vertices. Users can select a feature to display its geometry vertices in a dock pane or activate a sketch tool to view live sketch vertices as they draw.

Drawing guides

  • LayerSnapModes - Shows how to manage snap modes per layer. Users enable global snap modes, then switch individual layer settings to control snapping behavior during editing tasks.

Sketch display

  • CustomToolSketchSymbology - Demonstrates how to customize sketch symbology using a construction tool and a MapTool. It shows how to change the appearance of sketch segments and vertices during editing, and how the SketchSymbol property differs from sketch geometry. Changes are temporary and revert when the tool is deactivated.
  • SketchToolWithHalos - Builds a sketch tool that displays distance-based halos around the cursor using an embeddable control shown as a SketchTip.

Annotation editing

  • AnnoTools - Showcases tools for creating and editing annotation features in ArcGIS Pro, including text, geometry, symbols, callouts, and leader lines. It emphasizes working with CIMTextGraphic geometry and highlights schema differences from ArcGIS 10.x, especially regarding editable text formatting fields.

Topological editing

  • MapTopologyAddIn - Provides two buttons in ArcGIS Pro: one builds a map topology graph for the current view and displays node and edge counts; the other opens a dock pane to show topologically connected features for the selected feature.

Knowledge graph editing

  • KnowledgeGraphConstructionTools - Builds a sketch tool for creating KnowledgeGraph relationships, guiding users through entity selection and relationship setup via an overlay UI.
  • KnowledgeGraphRelateTool - Uses a sketch tool with an overlay UI to create KnowledgeGraph-related records. Users select source and destination entities, define relationship details, and the tool builds related records using EditOperation.

COGO editing

  • COGOLineFeatures - This tool allows users to click two map locations to generate and edit COGO attributes without changing the line’s endpoints. It functions as an advanced direction-distance or measurement tool that preserves both snapped locations and entered values.
  • GroundToGrid - This sample shows how to update ground-to-grid corrections in the active map by switching settings, adjusting direction offset by 10°, and doubling the scale factor—all via a button on the Add-In tab.
  • GroundToGridEvents - Shows how to listen for changes to ground-to-grid properties in the active map. When a property is modified, the tool logs the previous and new values into a dedicated dock pane, helping track updates in real time.
  • SequentialNumberTool - Provides a custom edit tool that sequentially numbers point, line, or polygon features along a sketch, with enhanced formatting for parcel pin numbering, for example.

CAD editing

  • TransformCADLayer - This sample transforms a CAD layer by applying scale, rotation, and coordinate inputs to generate a world file, updating the layer’s map location accordingly.

In conclusion, ArcGIS Pro SDK for .NET allows you to customize your data editing experience. A supported version of Visual Studio is required plus additional Microsoft .NET components, which can be installed from within Visual Studio. Before building your sample solution, make sure that the desktopVersion in  Config.daml matches ArcGIS Pro version installed on your machine. You can then download our editing add-in samples and ‘plug and play’ or extend them further to complement your existing editing workflows.

 

Contributors