would like to activate:
1) Create feature
2) Modify feature, and in particular the Move option
3) Delete feature
tools under the Edit tab, programmatically for a specific feature layer, and subscribe to the edit completion events.
Is this possible in arcpro sdk?
Solved! Go to Solution.
I think, you can't select template directly from Create Features pane. But your workflow could be like in sample below:
protected async override void OnClick()
{
await QueuedTask.Run(() =>
{
// Find layer you will work with
var featLayer = MapView.Active.Map.FindLayers("Poly1").First();
// Get all templates and then select template you need or use GetTemplate if you know template name
var editTemplates = featLayer.GetTemplates();
if (editTemplates != null && editTemplates.Count > 0)
{
var editTemplate = editTemplates[0];
// Activate default tool
editTemplate.ActivateDefaultToolAsync();
}
});
}
Works...
is there a way to programmatically select a template once the Create Feature tool is activated?
I think, you can't select template directly from Create Features pane. But your workflow could be like in sample below:
protected async override void OnClick()
{
await QueuedTask.Run(() =>
{
// Find layer you will work with
var featLayer = MapView.Active.Map.FindLayers("Poly1").First();
// Get all templates and then select template you need or use GetTemplate if you know template name
var editTemplates = featLayer.GetTemplates();
if (editTemplates != null && editTemplates.Count > 0)
{
var editTemplate = editTemplates[0];
// Activate default tool
editTemplate.ActivateDefaultToolAsync();
}
});
}