Assignment properties

Resumen

The properties below are returned by the assignments object when using Describe on a utility network.

Propiedades

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

The evaluator object. This object can be used to retrieve properties of the assignment evaluator.

Object
networkAttributeID
(Sólo lectura)

The ID of the attribute assignment.

Integer
networkSourceName
(Sólo lectura)

The name of the attribute source.

String

Muestra de código

Utility network assignments and evaluator properties example (stand-alone script)

This stand-alone Python script prints a report of some utility network properties.

# Import required modules
import arcpy

# Describe function on a Utility Network
UN = "C:\\MyProject\\databaseConn.sde\\mygdb.USER1.Naperville\\mygdb.USER1.ElectricNetwork"
d = arcpy.Describe(UN)

# Network Attribute properties
netattrs = d.networkAttributes

for na in netattrs:
    print(f"Name: {na.name}")

    # For each attribute assignment in the attribute assignments object:
    try:
        unas = na.assignments
        for una in unas:
            print(" -- Attribute Assignment Properties -- ")
            print(f"Utility Network Assignment Attribute ID: {una.networkAttributeId}")
            print(f"Utility Network Assignment Attribute Source Name: {una.networkSourceName} \n")
            # For each field evaluator in the attribute evaluator object:
            print(" - Field Evaluator Properties - ")
            fe = una.evaluator
            print(f"Field Evaluator Type: {fe.evaluatorType}")
            print(f"Field Evaluator Name: {fe.fieldName} \n")

    except:
        print(f"{na.name} does not have any attribute assignments \n")