CheckInExtension (arcpy)

摘要

Returns the license to the License Manager so other applications can use it.

脚本检索到扩展模块许可后,即可使用扩展模块工具。脚本使用完扩展模块中的工具后,应使用 CheckInExtension 函数将许可归还给许可管理器,以便其他应用程序使用。当脚本完成时,所有检出的扩展模块许可和设置的产品许可都将归还给许可管理器。

语法

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

Keyword for the extension product that is being checked.

  • 3D3D Analyst
  • SchematicsArcGIS Schematics
  • ArcScanArcScan
  • BusinessBusiness Analyst
  • DataInteroperabilityData Interoperability
  • GeoStatsGeostatistical Analyst
  • JTX Workflow Manager
  • NetworkNetwork Analyst
  • AeronauticalEsri Aeronautical Solution
  • DefenseEsri Defense Solution
  • FoundationEsri Production Mapping
  • DatareviewerArcGIS Data Reviewer
  • NauticalEsri Nautical Solution
  • NauticalbEsri Bathymetry
  • SpatialSpatial Analyst
  • StreetMapStreetMap
  • TrackingTracking
String
返回值
数据类型说明
String

There are three possible returned values for CheckInExtension:

  • NotInitializedNo desktop license has been set.
  • FailedA system failure occurred during the request.
  • CheckedIn The license has been returned successfully.

代码实例

CheckInExtension example

Return 3D extension license to License manager.

class LicenseError(Exception):
    pass

import arcview
import arcpy
from arcpy import env

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

    env.workspace = "D:/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:
    print arcpy.GetMessages(2)

相关主题

9/15/2013