CheckProduct (arcpy)

サマリ

Checks to see if the requested license is available.

構文

CheckProduct (product)
パラメータ説明データ タイプ
product

Product code for the product being checked.

  • arcview —ArcGIS for Desktop Basic product code
  • arceditor —ArcGIS for Desktop Standard product code
  • arcinfo —ArcGIS for Desktop Advanced product code
  • engine —Engine Runtime product code
  • enginegeodb —Engine Geodatabase Update product code
  • arcserver — Server product code
String
戻り値
データ タイプ説明
String

There are five possible return values for CheckProduct:

  • AlreadyInitalized — License has already been set in the script.
  • 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 the request.

コードのサンプル

CheckProduct example

Check to see if an ArcGIS for Desktop Advanced license is available.

import arcpy
from arcpy import env
import sys

env.workspace = "C:/Data/World.gdb"
if arcpy.CheckProduct("ArcInfo") == "Available":
    arcpy.PolygonToLine_management("Lakes", "LakeLines")
else:
    print "ArcGIS for Desktop Advanced license not available"
    sys.exit("ArcGIS for Desktop Advanced license not available")

関連トピック

9/14/2013