Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
CSharp
VBNet
images
ReadMe.xml
Readme.html
Readme.md

Readme.md

Custom reshape polyline edit task

This sample illustrates how to create a custom ArcGIS Engine edit task that can be used in conjunction with the out-of-the-box editing commands. The Reshape Polyline edit task allows the user to perform a reshape on the selected feature within an edit session.

Language:              C#, VB
Subject:               Controls
Organization:          Esri, http://www.esri.com
Date:                  11/17/2017
ArcObjects SDK:        10.6
Visual Studio:         2015, 2017
.NET Target Framework: 4.5

Resources

Usage

  1. Build and run the sample.
  2. Start editing.
  3. Zoom in on a polyline feature that you want to reshape.
  4. Select this feature with the Edit tool.
  5. Select the Reshape Polyline edit task from the Edit Task Tool control.
  6. Using the Sketch tool, digitize a new line that intersects the selected feature in at least two places.
  7. Finish the sketch to perform the reshape.
  8. Stop editing and save edits to persist changes. See the following illustration:

Illustration of performing a reshape on the selected feature.
Illustration of performing a reshape on the selected feature.

Additional information

The edit task is created by implementing the IEngineEditTask interface. Compiling this sample registers the edit task in the ESRI Engine Edit Tasks component category, which is used to populate the ControlsEditingTaskToolControl at runtime. The position of the task within the ControlsEditingTaskToolControl list is controlled using the IEngineEditTask.GroupName property and the display name using the IEngineEditTask.Name property. The IEngineEditTask.Activate method is called when the end user selects the edit task in the ControlsEditingTaskToolControl. The Activate method is used to set up listeners to the following IEngineEditEvents:
These event listeners set the IEngineEditSketch.GeometryType to null if the following conditions are met, thereby, disabling the Sketch tool:
The IEngineEditLayers.TargetLayer property on the EngineEditor singleton is used to return to the target layer selected in the ControlsEditingTargetToolControl. The IEngineEditTask.OnFinishSketch method is used to reshape the geometry of the selected feature using the IPolyline.Reshape method, passing in a path created from the digitized sketch as an argument. The task calls the IFeature.Store method within an edit operation to commit the changes.

See Also

EngineEditorClass


Licensing

Development licensing Deployment licensing
Engine Developer Kit Engine
ArcGIS Desktop Basic
ArcGIS Desktop Standard
ArcGIS Desktop Advanced
You can’t perform that action at this time.