有效配置路径属性

摘要

下面是在公共设施网络中使用 Describe 时由 validConfigurationPaths 对象返回的属性。

属性

属性说明数据类型
description
(只读)

有效配置路径的描述。

String
ID
(只读)

有效配置路径的 ID。

Integer
name
(只读)

有效配置路径的名称。

String
terminalPaths
(只读)

terminalPaths 对象。 此对象可用于检索终端路径的属性。

Object

代码示例

公共设施网络有效配置路径属性示例(独立脚本)

此独立 Python 脚本用于打印某些公共设施网络属性的报表,包括为公共设施网络定义的 validConfigurationPaths(如果存在)。

'''****************************************************************************
Name:        DescribeUtilityNetworkProperties.py
Description: This script reports the properties of a utility network
Created by:  Esri
****************************************************************************'''

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

# Terminal Configuration properties
termconfigs = d.terminalConfigurations
for tc in termconfigs:
    print("*** - Terminal Configuration Properties - ***")
    print(f"ID: {tc.terminalConfigurationId}")
    print(f"Name: {tc.terminalConfigurationName}")
    print(f"Traversability Model: {tc.traversabilityModel}")
    print(f"Default Configuration: {tc.defaultConfiguration} \n")

    # For each terminal in the terminals object:
    for t in tc.terminals:
        print(" -- Terminal Properties -- ")
        print(f"Terminal ID: {t.terminalId}")
        print(f"Terminal Name: {t.terminalName}")
        print(f"Terminal Is Upstream: {t.isUpstreamTerminal} \n")

    # For each configuration in the valid configuration paths object:
    try:
        for lc in tc.validConfigurationPaths:
            print(" - Configuration Properties - ")
            print(f"Configuration Id: {lc.id}")
            print(f"Configuration Name: {lc.name}")
            print(f"Description: {lc.description} \n")
            try:
                for tp in lc.terminalPaths:
                    print(f"From terminal id: {tp.fromTerminalId}")
                    print(f"To terminal id: {tp.toTerminalId}")
            except:
                print(f"{lc.name} does not have any terminal paths \n")
    except:
        print(f"{t.terminalName} does not have any valid configuration paths \n")

在本主题中