Returns a run-time wrapper around the specified DAML component.
Programmatically start Edit Annotation
// programmatically activates the Edit Annotation tool by invoking the corresponding
// plugin. The tool must be enabled for the operation to succeed.
{
var plugin = FrameworkApplication.GetPlugInWrapper("esri_editing_EditVerticesText");
if (plugin.Enabled)
((ICommand)plugin).Execute(null);
}
Execute a command
{
IPlugInWrapper wrapper = FrameworkApplication.GetPlugInWrapper("esri_editing_ShowAttributes");
// tool and command(Button) supports this
if (wrapper is ICommand command && command.CanExecute(null))
command.Execute(null);
}
Set the current tool
{
// use SetCurrentToolAsync with await
FrameworkApplication.SetCurrentToolAsync("esri_mapping_selectByRectangleTool").Wait();
// or use ICommand.Execute
if (FrameworkApplication.GetPlugInWrapper("esri_mapping_selectByRectangleTool") is ICommand cmd && cmd.CanExecute(null))
cmd.Execute(null);
}
Change a buttons caption or image
{
IPlugInWrapper wrapper = FrameworkApplication.GetPlugInWrapper("MyAddin_MyCustomButton");
if (wrapper != null)
{
wrapper.Caption = "new caption";
// ensure that T-Rex16 and T-Rex32 are included in your add-in under the images folder and have
// BuildAction = Resource and Copy to OutputDirectory = Do not copy
wrapper.SmallImage = buildImage;
wrapper.LargeImage = buildImage2;
}
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)
ArcGIS Pro version: 3.0 or higher.