Evaluator properties

Synthèse

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

Propriétés

PropriétéExplicationType de données
evaluatorType
(Lecture seule)

The type of evaluator used for the assignment.

String
fieldName
(Lecture seule)

The field name used for the evaluator.

String

Exemple de code

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