ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Core.CIM Namespace / CIMExtensions Class / SetExcludedToolIDs Method
String array of DAML IDs.
Example

In This Topic
    SetExcludedToolIDs Method
    In This Topic
    Sets the excluded construction tools on the template.
    Syntax
    public static void SetExcludedToolIDs( 
       CIMEditingTemplate templateDef,
       string[] damlIDs
    )
    Public Shared Sub SetExcludedToolIDs( _
       ByVal templateDef As CIMEditingTemplate, _
       ByVal damlIDs() As String _
    ) 

    Parameters

    templateDef
    damlIDs
    String array of DAML IDs.
    Remarks
    Sets all the non visible tools on the template.
    Example
    Hide or show editing tools on templates
    await QueuedTask.Run(async () =>
       {
         //hide all tools except line tool on a given feature layer
         var editTemplates = featureLayer.GetTemplates();
         var newCIMEditingTemplates = new List<CIMEditingTemplate>();
    
         foreach (var et in editTemplates)
         {
           //initialize template by activating default tool
           await et.ActivateDefaultToolAsync();
           var cimEditTemplate = et.GetDefinition();
           //get the visible tools on this template
           var allTools = et.ToolIDs.ToList();
           //add the hidden tools on this template
           allTools.AddRange(cimEditTemplate.GetExcludedToolIDs().ToList());
           //hide all the tools then allow the line tool
    
           allTools.AddRange(cimEditTemplate.GetExcludedToolIDs().ToList());
    
           cimEditTemplate.SetExcludedToolIDs(allTools.ToArray());
           cimEditTemplate.AllowToolID("esri_editing_SketchLineTool");
           newCIMEditingTemplates.Add(cimEditTemplate);
         }
         //update the layer templates
         var layerDef = featureLayer.GetDefinition() as CIMFeatureLayer;
         // Set AutoGenerateFeatureTemplates to false for template changes to stick
         layerDef.AutoGenerateFeatureTemplates = false;
         layerDef.FeatureTemplates = newCIMEditingTemplates.ToArray();
         featureLayer.SetDefinition(layerDef);
       });
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also