ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Aide
  • Sign Out
ArcGIS Desktop

ArcGIS Online

La plateforme cartographique de votre organisation

ArcGIS Desktop

Un SIG professionnel complet

ArcGIS Enterprise

SIG dans votre entreprise

ArcGIS Developers

Outils de création d'applications de localisation

ArcGIS Solutions

Modèles d'applications et de cartes gratuits pour votre secteur d'activité

ArcGIS Marketplace

Téléchargez des applications et des données pour votre organisation.

  • Documentation
  • Support
Esri
  • Se connecter
user
  • Mon profil
  • Déconnexion

ArcMap

  • Accueil
  • Commencer
  • Carte
  • Analyser
  • Gérer les données
  • Outils
  • Extensions

CheckExtension

  • Résumé
  • Syntaxe
  • Exemple de code

Résumé

Checks to see if a license is available to be checked out for a specific type of extension.

Once the extension license has been retrieved by the script, tools using that extension can be used. Once a script is finished with an extension's tools, the CheckInExtension function should be used to return the license to the License Manager so other applications can use it. All checked-out extension licenses and set product licenses are returned to the License Manager when a script completes.

Learn more about licensing and extensions

Syntaxe

CheckExtension (extension_code)
ParamètreExplicationType de données
extension_code

Keyword for the extension product that is being checked.

  • 3D —ArcGIS 3D Analyst extension
  • Aeronautical —ArcGIS Aviation Charting
  • Airports —ArcGIS Aviation Airports
  • ArcScan —ArcScan
  • Bathymetry —ArcGIS Bathymetry
  • Business —ArcGIS Business Analyst
  • DataReviewer —ArcGIS Data Reviewer Desktop
  • DataInteroperability —ArcGIS Data Interoperability extension for Desktop
  • Defense —ArcGIS Defense Mapping
  • Foundation —ArcGIS Production Mapping
  • GeoStats —ArcGIS Geostatistical Analyst extension
  • Highways —ArcGIS Roads and Highways
  • JTX —ArcGIS Workflow Manager (Classic) Desktop
  • LocationReferencing —ArcGIS Pipeline Referencing
  • Nautical —ArcGIS Maritime
  • Network —ArcGIS Network Analyst extension
  • Publisher —ArcGIS Publisher
  • Schematics —ArcGIS Schematics extension
  • SMPAsiaPacific —StreetMap Premium Asia Pacific
  • SMPEurope —StreetMap Premium Europe
  • SMPJapan —StreetMap Premium Japan
  • SMPLatinAmerica —StreetMap Premium Latin America
  • SMPMiddleEastAfrica —StreetMap Premium Middle East Africa
  • SMPNorthAmerica —StreetMap Premium North America
  • Spatial —ArcGIS Spatial Analyst extension
  • Tracking —ArcGIS Tracking Analyst extension
String

Valeur renvoyée

Type de donnéesExplication
String

There are four possible returned values for CheckExtension:

  • Available —The requested license is available to be set.
  • Unavailable —The requested license is unavailable to be set.
  • NotLicensed —The requested license is not valid.
  • Failed —A system failure occurred during request.

Exemple de code

CheckExtension example

Check for availability of ArcGIS 3D Analyst extension before checking it out.

import arcpy

class LicenseError(Exception):
    pass

try:
    if arcpy.CheckExtension("3D") == "Available":
        arcpy.CheckOutExtension("3D")
    else:
        # raise a custom exception
        raise LicenseError

    arcpy.env.workspace = "c:/GrosMorne"
    arcpy.HillShade_3d("WesternBrook", "wbrook_hill", 300)
    arcpy.Aspect_3d("WesternBrook", "wbrook_aspect")
    arcpy.CheckInExtension("3D")

except LicenseError:
    print("3D Analyst license is unavailable")
except arcpy.ExecuteError:
    print(arcpy.GetMessages(2))

Rubriques connexes

  • CheckInExtension
  • CheckOutExtension
  • Accès aux licences et aux extensions dans Python
  • Aperçu des extensions ArcMap

ArcGIS Desktop

  • Accueil
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

A propos d'Esri

  • A propos de la société
  • Carrières
  • Blog d’Esri
  • Conférence des utilisateurs
  • Sommet des développeurs
Esri
Donnez-nous votre avis.
Copyright © 2021 Esri. | Confidentialité | Légal