SetProduct

摘要

The SetProduct function defines the desktop license. SetProduct returns information on the license.

旧版本旧版本:

产品级别应通过在导入 arcpy 前,先导入相应的产品模块(arcinfoarceditorarcviewarcserverarcenginegeodbarcengine)进行设置。SetProduct 函数是遗留函数,导入 arcpy 后将无法设置产品。

讨论

提示提示:

只有在独立脚本中才必须设置产品和扩展模块。如果从 Python 窗口运行工具或者使用脚本工具,产品已在应用程序内进行设置,激活的扩展模块取决于“扩展模块”对话框。

语法

SetProduct (code)
参数说明数据类型
code

Product code for the product being set.

  • arcviewArcView product code.
  • arceditorArcEditor product code.
  • arcInfoArcInfo product code.
  • engineEngine Runtime product code.
  • enginegeodbEngine Geodatabase Update product code.
  • arcserverServer product code.
String
返回值
数据类型说明
String

The function returns the status on the product license. There are four possible values:

  • CheckedOutLicense successfully set.
  • AlreadyInitializedLicense has already been set.
  • NotLicensedThe license is not valid or available.
  • FailedA system failure occurred during the set request.

代码示例

SetProduct example

Sets an ArcView product license using the arcview module.

# Set the ArcView product by importing the arcview module.
#
import arcview
import arcpy

arcpy.env.workspace = "C:/Data/SanDiego.gdb"

arcpy.CreateRasterDataset_management(arcpy.env.workspace,
      "LandUse", "30", "8_BIT_UNSIGNED", "Freeways", 1)
 

相关主题


7/10/2012