Summary
Adds a network attribute to a utility network.
A network attribute is a value derived from attributes on corresponding features in the network and is stored in the network topology. Network attributes are used by tracing analysis to control how the network can be traversed. While a network attribute can be associated with only one attribute on a feature class, there is no limit to the number of network attributes a single utility network can have. Network attributes are used as weights to control traversability and to model the cost of paths in the 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.
When working with an enterprise geodatabase, the connected ArcGIS Enterprise portal account must be the portal utility network owner.
The network topology must be disabled.
When working with an enterprise geodatabase, this tool must be connected to the default version when executed.
When working with an enterprise geodatabase, the Input Utility Network must be from a database connection established as the database utility network owner.
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 utility network.
The following table lists the network attribute types and their applicable parameters:
Attribute Type In line Apportionable Nullable Substitution Short
Long
(Out of line only)
Double
Date
Syntax
arcpy.un.AddNetworkAttribute(in_utility_network, attribute_name, attribute_type, {is_inline}, {is_apportionable}, {domain}, {is_overridable}, {is_nullable}, {is_substitution}, {network_attribute_to_substitute})
Parameter | Explanation | Data Type |
in_utility_network | The input utility network where the network attribute will be added. | Utility Network; Utility Network Layer |
attribute_name | The name of the network attribute to add to the utility network. | String |
attribute_type | Specifies the data type of the network attribute.
| String |
is_inline (Optional) | Specifies whether the network attribute will be persisted in line. In-line network attributes are slightly more efficient, but the number of bits for in-line attributes is limited to 28 per utility network. The most frequently used network attributes (for example, phase for electric networks, pressure for gas and water networks) should be stored in line if possible. The size of the bits is determined by the domain parameter. In-line attributes are only supported for integer network attributes.
| Boolean |
is_apportionable (Optional) | Specifies whether the network attribute will be apportioned across multiple edges belonging to the same feature. For example, with the shape_length network attribute, if one line feature consists of five edge elements, and if the total length of that line feature is 100 feet, that attribute will be apportioned across all edges, with 20 feet for each. The distribution of the value depends on the percentage along each edge element with respect to the from point of the original feature.
| Boolean |
domain (Optional) | The domain with which the network attribute is to be associated. This parameter is required when is_inline is True. This domain is used to determine how many bits to allocate for the in-line attribute and must be a coded value type. For example, the LifeCycleStatusDomain (0, Unknown | 1, In-Service | 2, Proposed | 3, Abandoned) domain has four entries, which means 2 bits are required to store the in-line attribute. The coded value domain must have sequential codes starting from 0. | String |
is_overridable (Optional) | Note:This parameter is not used, and any entered value will be ignored in the current release. The functionality of this parameter is under development and will be applicable in a future release.
| Boolean |
is_nullable (Optional) | Specifies whether the network attribute will support null values.
| Boolean |
is_substitution (Optional) | Specifies whether the network attribute will be used as a substitution. Substitution network attributes allow a substituted value to be used instead of bitset network attribute values during a propagation in a trace operation.
| Boolean |
network_attribute_to_substitute (Optional) | The network attribute to be used for substitution. Substitutions are encoded based on the number of bits in the network attribute being propagated. The network attribute must be in-line and an integer field type less than or equal to 8 bits. | String |
Derived Output
Name | Explanation | Data Type |
out_utility_network | The updated utility network. | Utility Network |
Code sample
Add a network attribute named Device Status with a short attribute type.
import arcpy
arcpy.AddNetworkAttribute_un("Utility Network", "Device Status", "SHORT",
"INLINE", "NOT_APPORTIONABLE", "",
"ElectricDistributionDeviceStatus",
"NOT_OVERRIDABLE")
Add a network attribute to be used for substitution.
import arcpy
arcpy.AddNetworkAttribute_un("Utility Network",
"Phases", "LONG", "NOT_INLINE",
"NOT_APPORTIONABLE",
"ElectricDistributionDeviceStatus", "",
"NOT_NULLABLE", "SUBSTITUTION",
"Phases current")
Environments
Licensing information
- Basic: No
- Standard: Yes
- Advanced: Yes