Add Network Attribute (Trace Network)

Summary

Adds a network attribute to a trace network.

Usage

  • A network attribute can be associated with only one attribute on a feature class; however, it can be associated with multiple feature classes.

  • The network topology must be disabled.

  • This tool can be used with the Set Network Attribute tool, which is used to assign the network attribute to a feature class field in the trace network.

    Learn more about creating network attributes

  • When working with an enterprise geodatabase, the requirements are as follows:

    • The input trace network must be from a database connection established as the database trace network owner.

    • License:
      The active portal account must be licensed with the ArcGIS Trace Network user type extension to create, publish, and work with a trace network in an enterprise geodatabase.
    • This tool must be executed when connected to the default version.

Parameters

LabelExplanationData Type
Input Trace Network

The input trace network to which the network attribute will be added.

Trace Network; Trace Network Layer
Attribute Name

The name of the network attribute to add to the trace network.

String
Attribute Type

Specifies the data type of the network attribute.

  • Short (small integer)The field is short integer type.
  • Long (large integer)The field is long integer type.
  • Double (double precision)The field is double precision type.
  • DateThe field is date type.
String
Nullable
(Optional)

Specifies whether the network attribute will support null values.

  • Checked—The network attribute will allow support values.
  • Unchecked—The network attribute will not allow support values. This is the default.

Boolean

Derived Output

LabelExplanationData Type
Updated Trace Network

The updated trace network.

Trace Network

arcpy.tn.AddNetworkAttribute(in_trace_network, attribute_name, attribute_type, {is_nullable})
NameExplanationData Type
in_trace_network

The input trace network to which the network attribute will be added.

Trace Network; Trace Network Layer
attribute_name

The name of the network attribute to add to the trace network.

String
attribute_type

Specifies the data type of the network attribute.

  • SHORTThe field is short integer type.
  • LONGThe field is long integer type.
  • DOUBLEThe field is double precision type.
  • DATEThe field is date type.
String
is_nullable
(Optional)

Specifies whether the network attribute will support null values.

  • NULLABLEThe network attribute will support null values.
  • NOT_NULLABLEThe network attribute will not support null values. This is the default.
Boolean

Derived Output

NameExplanationData Type
out_trace_network

The updated trace network.

Trace Network

Code sample

AddNetworkAttribute example (Python window)

Add a network attribute named Velocity with a double attribute type.

import arcpy
arcpy.AddNetworkAttribute_tn("Trace Network", "Velocity", "DOUBLE")

Environments

This tool does not use any geoprocessing environments.

Licensing information

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

Related topics