I do see this Pro SDK snippet which looks for the availability of extension to checkout and check-in. Is there a way to just check whether the extension is licensed/enabled or not ?
Thanks for your response. I could not find a C# SDK alternative for CheckExtension method.
<SPAN class="keyword token">import</SPAN> arcpy checks <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="string token">'3D'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'Spatial'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'ImageAnalyst'</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="keyword token">for</SPAN> c <SPAN class="keyword token">in</SPAN> checks<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"{} ... {}"</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>c<SPAN class="punctuation token">,</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>CheckExtension<SPAN class="punctuation token">(</SPAN>c<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="number token">3D</SPAN> <SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN> Available Spatial <SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN> Available ImageAnalyst <SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN> Available<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
CheckExtension—ArcPy Functions | Documentation perhaps
May be my question was not so clear, I would like to validate whether the tool is licensed/assigned and show user a message that the tool requires an extension rather than showing an error halfway through the execution where the extension comes into picture and throws an error cannot run the tool without license.
If an extension is licensed for you, it is available for you
CheckOutExtension—ArcPy Functions | Documentation
Use extensions—ArcGIS Pro | Documentation
If your organization has purchased extension licenses, and a license has been assigned to you, the tools and functionality associated with the extension are available automatically.
Unlike arcmap where you have to enable/disable and extension
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.