CheckExtension

摘要

核查是否存在可为特定类型的扩展模块检出的许可。

了解关于许可和扩展模块的详细信息

语法

CheckExtension (extension_code)
参数说明数据类型
extension_code

正进行检查的扩展模块产品的关键字。

  • 3DArcGIS 3D Analyst extension
  • AeronauticalArcGIS Aviation Charting
  • AirportsArcGIS Aviation Airports
  • ArcScanArcScan
  • BathymetryArcGIS Bathymetry
  • BusinessPremArcGIS Business Analyst
  • DataReviewerArcGIS Data Reviewer
  • DataInteroperabilityArcGIS Data Interoperability extension for Desktop
  • DefenseArcGIS Defense Mapping
  • FoundationArcGIS Production Mapping
  • GeoStatsArcGIS Geostatistical Analyst extension
  • IndoorsArcGIS Indoors
  • ImageAnalystImage Analyst
  • JTXArcGIS Workflow Manager (Classic) Desktop
  • LocationReferencingArcGIS Pipeline Referencing or ArcGIS Roads and Highways
  • LocateXTLocateXT
  • NauticalArcGIS Maritime
  • NetworkArcGIS Network Analyst extension
  • PublisherArcGIS Publisher
  • SchematicsArcGIS Schematics extension
  • SMPAsiaPacificStreetMap Premium Asia Pacific
  • SMPEuropeStreetMap Premium Europe
  • SMPJapanStreetMap Premium Japan
  • SMPLatinAmericaStreetMap Premium Latin America
  • SMPMiddleEastAfricaStreetMap Premium Middle East Africa
  • SMPNorthAmericaStreetMap Premium North America
  • SpatialArcGIS Spatial Analyst extension
  • TrackingArcGIS Tracking Analyst extension
String
返回值
数据类型说明
String

CheckExtension 可能会返回以下四个值:

  • Available申请的许可存在,可以设置。
  • Unavailable申请的许可不存在,无法设置。
  • NotLicensed申请的许可无效。
  • Failed请求期间发生系统失败。

代码示例

CheckExtension 示例

检出前,请检查 ArcGIS 3D Analyst extension 的可用性。

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))

相关主题