Set Network Attribute (Trace Network)


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.


  • 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


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

The trace network that contains the network attribute to set.

Trace Network; Trace Network Layer

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


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


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.


Derived Output

NameExplanationData Type

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")


This tool does not use any geoprocessing environments.

Licensing information

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

Related topics