<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Remove Unwanted Sketch Tools and Set Default in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/remove-unwanted-sketch-tools-and-set-default/m-p/842097#M3889</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can only do part of this at the moment.&lt;/P&gt;&lt;P&gt;The default template tool can be set through CIMEditingTemplate.SetDefaultToolDamlID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can get a list of visible tools for a template with&amp;nbsp;EditingFeatureTemplate.ToolIDs which returns an array of damlID's.&lt;/P&gt;&lt;P&gt;Tools are hidden on a template through&amp;nbsp;CIMEditingTemplate.ToolFilter which takes a string array of guids.&lt;/P&gt;&lt;P&gt;You cant get a tool guid from the damlID in the public api. This will be enhanced in a future release...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Nov 2018 00:08:42 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2018-11-07T00:08:42Z</dc:date>
    <item>
      <title>Remove Unwanted Sketch Tools and Set Default</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/remove-unwanted-sketch-tools-and-set-default/m-p/842096#M3888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to programatically remove some tools from my configuration that I don't want a user to be able to use and also to set a default tool other than polygon.&amp;nbsp; So below for my Active template, I ant to remove all tools but polygon and RAD Tool, then make the RAD Tool the default.&amp;nbsp; I feel like I need to update the ToolOptions of the&amp;nbsp;CIMEditingTemplate, but it is always null?&amp;nbsp; Am I even on the correct place to accomplish this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/427848_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;private&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;static&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;async&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;UpdateEditTemplates&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;FeatureLayer inFeatLayer&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;

 &lt;SPAN class="keyword token"&gt;try&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; QueuedTask&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Run&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="comment token"&gt;//Get CIM layer definition&lt;/SPAN&gt;

 &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;inFeatLayer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GetDefinition&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; CIMFeatureLayer layerDef &lt;SPAN class="operator token"&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;!&lt;/SPAN&gt;layerDef&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FeatureTemplates&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;IsNullOrEmpty&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="comment token"&gt;//Get all templates on this layer&lt;/SPAN&gt;
 List&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;CIMEditingTemplate&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; layerTemplates &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; layerDef&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FeatureTemplates&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ToList&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

 &lt;SPAN class="comment token"&gt;//Remove templates matching a pattern&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;foreach&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;CIMEditingTemplate CIMTemp &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; layerTemplates&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="comment token"&gt;//TOOL OPTIONS IS NULL?&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

 &lt;SPAN class="comment token"&gt;//Set the templates and layer definition back on the layer&lt;/SPAN&gt;
 layerDef&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FeatureTemplates &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; layerTemplates&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ToArray&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 inFeatLayer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;SetDefinition&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layerDef&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;catch&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token class-name"&gt;Exception&lt;/SPAN&gt; e&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;return&lt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;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:17:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/remove-unwanted-sketch-tools-and-set-default/m-p/842096#M3888</guid>
      <dc:creator>MKa</dc:creator>
      <dc:date>2021-12-12T10:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Unwanted Sketch Tools and Set Default</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/remove-unwanted-sketch-tools-and-set-default/m-p/842097#M3889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can only do part of this at the moment.&lt;/P&gt;&lt;P&gt;The default template tool can be set through CIMEditingTemplate.SetDefaultToolDamlID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can get a list of visible tools for a template with&amp;nbsp;EditingFeatureTemplate.ToolIDs which returns an array of damlID's.&lt;/P&gt;&lt;P&gt;Tools are hidden on a template through&amp;nbsp;CIMEditingTemplate.ToolFilter which takes a string array of guids.&lt;/P&gt;&lt;P&gt;You cant get a tool guid from the damlID in the public api. This will be enhanced in a future release...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2018 00:08:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/remove-unwanted-sketch-tools-and-set-default/m-p/842097#M3889</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2018-11-07T00:08:42Z</dc:date>
    </item>
  </channel>
</rss>

