Greetings!
I'm trying to re-create an ArcMap add-in in Pro that opens the Divide command frame, and then executes some custom attribute updates after the user divides a polyline. The button opens the Divide tool, but doesn't wait for user interaction before executing additional code. How do I get the button to wait for a successful divide operation before executing the custom code?
Thanks!
Here's my add-in structure (with a message box replacing the custom code):
protected override void OnClick()
{
QueuedTask.Run(() =>
{
// ArcGIS Pro Command's DAML ID.
var commandId = "esri_editing_DivideCommand";
// get the ICommand interface from the ArcGIS Pro Button
// using command's plug-in wrapper
var iCommand = FrameworkApplication.GetPlugInWrapper(commandId) as ICommand;
if (iCommand != null)
{
// Let ArcGIS Pro do the work for us
if (iCommand.CanExecute(null))
{
iCommand.Execute(null);
MessageBox.Show("Any custom code written here executes without waiting for the user to divide a polyline");
}
}
MessageBox.Show("iCommand is done");
});
}