Network Attribute Parameter

Resumen

Provides information about attribute parameters associated with the network analysis layer.

Debate

The attributeName, parameterName, and parameterValue properties for the attribute parameter object are dynamic. This means that the total number of properties supported by a given attribute parameter object depends on the parameterCount property. For example, if the value of the parameterCount property is 2, then the attribute parameter object will support attributeName0, attributeName1, parameterName0, parameterName1, parameterValue0, and parameterValue1 properties.

Propiedades

PropiedadExplicaciónTipo de datos
attributeNameX
(Sólo lectura)

The name of a network attribute for which the parameter is defined.

String
parameterNameX
(Sólo lectura)

The name of the parameter.

String
parameterValueX
(Sólo lectura)

The value for the parameter as specified in the network analysis layer. This parameter value is used during the solve operation. The data type of the parameter value matches the data type of the attribute parameter as defined in the network dataset.

For restriction usage parameters, the value returned will be a numerical value corresponding to the standard restriction usage options:

  • Prohibited: -1
  • Avoid (high): 5
  • Avoid: 2
  • Avoid (low): 1.3
  • Prefer (low): 0.8
  • Prefer: 0.5
  • Prefer (high): 0.2

Object

Muestra de código

Network Analyst Layer Attribute Parameter example

Display the attribute parameter information for a network analysis layer.

# Name: NALayerAttributeParameterProperties_ex01.py
# Description: Prints the attribute parameter information for a given network 
#              analysis layernetwork analysis layer.

import arcpy 

in_layer = "C:/Data/Route.lyr" 

# Create Describe object from layer file.
desc = arcpy.Describe(in_layer) 

count = desc.parameterCount 
parameters = desc.parameters 

# Print attribute parameter values
print "Total Attribute Parameters: ", count 
for i in range(0, count): 
    attrName = getattr(parameters,"attributeName" + str(i))
    paramName = getattr(parameters,"parameterName" + str(i))
    paramValue = getattr(parameters,"parameterValue" + str(i))
    print "%s : %s : %s" % (attrName,paramName,paramValue)