Hook into ArcGIS command and get events

453
2
Jump to solution
11-25-2019 02:41 AM
RehmSoftware
New Contributor III

Hi,

ArcGIS has a nice command to edit the vertices (add, delete, move etc.) of a polyline and it also makes it easy for me to actually call it from a Button:

var iCommand = FrameworkApplication.GetPlugInWrapper("esri_editing_EditVerticesModifyFeature") as ICommand;
if (iCommand != null && iCommand.CanExecute(null)) 
    iCommand.Execute(null);

Now whenever a polyline vertice is added, moved or deleted through this command I need to update an internal data structure. Is there a way to get this information somehow? Maybe there's an event or something?

Because it would be great if I could just use the ArcGIS functionality instead of having to re-implement most of the stuff..

Thanks in advance!

Best regards

Christian

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
SeanJones
Esri Regular Contributor

Hi Christian,

The best way to do this would be to listen to the row changed events for the layers you are interested in. You can then check for geometry changes and act accordingly.

There's a similar thread here: https://community.esri.com/message/903262-capturing-edit-event-on-vertex-basis 

View solution in original post

0 Kudos
2 Replies
PauloBarthelmess
New Contributor

EditCompletedEvent is invoked after this command wraps, but only if there was an actual change. Completing with no changes or cancelling does not raise the event. Would be nice if it still called it with CompletedType == EditCompletedType.Discard, but that is not what I see. Good enough for my purposes, but you may need to see if some other related event (e.g. EditCompletingEvent) is raised in case you need more control.

https://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic9762.html

0 Kudos
SeanJones
Esri Regular Contributor

Hi Christian,

The best way to do this would be to listen to the row changed events for the layers you are interested in. You can then check for geometry changes and act accordingly.

There's a similar thread here: https://community.esri.com/message/903262-capturing-edit-event-on-vertex-basis 

0 Kudos