SetProduct (arcpy)

Resumen

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

HerenciaHerencia:

The product level should be set by importing the appropriate product module (arcinfo, arceditor, arcview, arcserver, arcenginegeodb, or arcengine) prior to importing arcpy. The SetProduct function is a legacy function and cannot set the product once arcpy has been imported.

For scripts using the arcgisscripting module, the equivalent SetProduct method is still supported.

Debate

SugerenciaSugerencia:

Solamente es necesario establecer el producto y las extensiones dentro de las secuencias de comandos independientes. Si está ejecutando las herramientas desde la ventana de Python o utilizando herramientas de secuencia de comandos, el producto ya está establecido dentro de la aplicación y las extensiones activas están basadas en el cuadro de diálogo Extensiones.

Sintaxis

SetProduct (product)
ParámetroExplicaciónTipo de datos
product

Product code for the product being set.

  • 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
Valor de retorno
Tipo de datosExplicación
String

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

  • CheckedOut —License successfully set.
  • AlreadyInitialized —License has already been set.
  • NotLicensed —The license is not valid or available.
  • Failed —A system failure occurred during the set request.

Ejemplo de código

SetProduct example

Sets an ArcGIS for Desktop Basic product license using the arcview module.

# Set the ArcGIS for Desktop Basic 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)

Temas relacionados

9/11/2013