Set Network Attribute (Trace Network)

Summary

Assigns a network attribute to a feature class to be used during trace operations.

A trace network can include network attribute. A network attribute is a value stored in the network topology derived from attributes on corresponding features in the network. While a network attribute can be associated with only one attribute in a feature class, there is no limit to the number of network attributes a trace network can include. Network attributes are used as weights to control traversability and to model the cost of paths in the network.

Usage

  • Network attributes are used in trace analyses to control how the network can be traversed.

  • A network attribute can be associated with only one attribute in a feature class but can be assigned to multiple feature classes in the network.

  • The network topology must be disabled.

  • This tool can be used in conjunction with the Add Network Attribute tool, which adds a network attribute to the trace network.

    Learn more about assigning network attributes

Syntax

SetNetworkAttribute(in_trace_network, network_attribute, featureclass, field)
ParameterExplanationData Type
in_trace_network

The trace network that contains the network attribute to set.

Trace Network; Trace Network Layer
network_attribute

The network attribute to be assigned to the feature class field.

String
featureclass

The input feature class that contains the field that will be used to set the network attribute.

String
field

An existing field that will be assigned the network attribute. The field data type must match the data type of the network attribute. For example, if the network attribute is a short integer type, the field must also be a short integer type. Network attributes that do not support null values can only be assigned to fields that do not allow null values.

String

Derived Output

NameExplanationData Type
out_trace_network

The updated trace network.

Trace Network

Code sample

SetNetworkAttribute example (Python window)

Set a network attribute named Friction Factor to use the frictionvalue field in the BlackLines feature class.

import arcpy
arcpy.SetNetworkAttribute_tn("Trace Network", "Friction Factor", 
                             "BlackLines", "frictionvalue")

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: No
  • Standard: Yes
  • Advanced: Yes

Related topics