Сводка
При использовании tiers инженерной сети возвращаются следующие свойства объекта Describe.
Свойства
Владение | Объяснение | Тип данных |
aggregatedLinesForSubnetLine (только чтение) | Объект aggregatedLinesForSubnetLine. Объект может использоваться для получения свойств агрегированных линий для класса SubnetLine. | Object |
creationTime (только чтение) | Время создания этого уровня. | String |
diagramTemplates (только чтение) | Список шаблонов схемы, используемых уровнем. | String |
name (только чтение) | Имя уровня. | String |
rank (только чтение) | Значение ранга уровня. | Integer |
subnetworkFieldName (только чтение) | Имя поля подсети. | String |
supportDisjointSubnetwork (только чтение) | Определяет, поддерживает ли уровень непересекающуюся подсеть или нет.
| Boolean |
tierGroupName (только чтение) | Если в сети есть определение иерархических уровней, это имя группы уровней, к которой уровень относится. | String |
tierID (только чтение) | ID уровня. | Integer |
tierTopology (только чтение) | Тип топологии уровня. Например, радиальная или ячеистая топология уровня. | String |
updateSubnetworkTraceConfiguration (только чтение) | Объект updateSubnetworkTraceConfiguration. Объект может использоваться для получения свойств конфигурации трассировки при обновлении подсети. | Object |
validDevices (только чтение) | Объект validDevices. Этот объект может использоваться для получения свойств допустимых устройств. | Object |
validLines (только чтение) | Объект validLines. Объект может использоваться для получения свойств допустимых линий. | Object |
validSubnetworkControllers (только чтение) | Объект validSubnetworkControllers. Этот объект может использоваться для получения свойств допустимых контроллеров подсети. | Object |
Пример кода
Этот автономный скрипт Python возвращает отчет о свойствах, возвращаемых объектом tiers.
'''****************************************************************************
Name: DescribeUN_TierProperties.py
Description: This script reports the tier properties of a utility network
Created by: Esri
****************************************************************************'''
# Import required modules
import arcpy
# Describe functions on a Utility Network
UN = "C:\\Projects\\MyProject\\unowner.sde\\Naperville.UNOWNER.Naperville\\Naperville.UNOWNER.Naperville"
d = arcpy.Describe(UN)
# Domain Network properties
domnets = d.domainNetworks
for dom in domnets:
print("*** - Domain Network properties - ***")
print("Domain Network Creation Time: {0}".format(dom.creationTime))
print("Domain Network Release Number: {0}".format(dom.releaseNumber))
print("Domain Network Name: {0}".format(dom.domainNetworkName))
print("Domain Network ID: {0}".format(dom.domainNetworkId))
print("Domain Network Alias Name: {0}".format(dom.domainNetworkAliasName))
print("Domain Network is Structure Network: {0}".format(dom.isStructureNetwork))
print("Domain Network Tier Definition: {0}".format(dom.tierDefinition))
print("Domain Network Subnetwork Controller Type: {0} \n".format(dom.subnetworkControllerType))
print("Domain Network Subnetwork Table Name: {0}".format(dom.subnetworkTableName))
print("Domain Network Subnetwork Label Field Name: {0}".format(dom.subnetworkLabelFieldName))
for tier in dom.tiers:
print("Tier Name: {0}".format(tier.name))
print("Rank: {0}".format(tier.rank))
print("Tier topology type: {0}".format(tier.tierTopology))
print("Tier group name: {0} \n".format(tier.tierGroupName))
print("Subnetwork field name: {0}".format(tier.subneworkFieldName))
print("Supports disjoint subnetwork: {0}".format(tier.supportDisjointSubnetwork))
print("Diagram templates: {0} \n".format(tier.diagramTemplates))
# Subnetwork Controller Properties
for sc in tier.validSubnetworkControllers:
print(" -- Subnetwork Controllers Properties -- ")
print("Asset Group Code: {0} \n".format(sc.assetGroupCode))
print(" - Asset Type Properties - ")
for at in sc.assetTypes:
print("Asset Type Code: {0} \n".format(at.assetTypeCode))
# Valid Device Properties
for vd in tier.validDevices:
print(" -- Valid Devices Properties -- ")
print("Asset Group Code: {0} \n".format(vd.assetGroupCode))
print(" - Asset Type Properties - ")
for at in vd.assetTypes:
print("Asset Type Code: {0} \n".format(at.assetTypeCode))
# Valid Lines Properties
for vl in tier.validLines:
print(" -- Valid Lines Properties -- ")
print("Asset Group Code: {0} \n".format(vl.assetGroupCode))
print(" - Asset Type Properties - ")
for at in vl.assetTypes:
print("Asset Type Code: {0}".format(at.assetTypeCode))
# Aggregated Lines for SubnetLine Properties
for al in tier.aggregatedLinesForSubnetLine:
print(" -- Aggregated Lines for SubnetLine Properties -- ")
print("Asset Group Code: {0} \n".format(al.assetGroupCode))
print(" - Asset Type Properties - ")
for at in al.assetTypes:
print("Asset Type Code: {0} \n".format(at.assetTypeCode))
# Update Subnetwork Trace Configuration Properties
print(" -- Update Subnetwork Trace Properties -- ")
ust = tier.updateSubnetworkTraceConfiguration
print("Include Containers: {0}".format(ust.includeContainers))
print("Include Content: {0}".format(ust.includeContent))
print("Include Structures: {0}".format(ust.includeStructures))
print("Include Barriers: {0}".format(ust.includeBarriers))
print("Validate Consistency: {0}".format(ust.validateConsistency))
print("Domain Network Name: {0}".format(ust.domainNetworkName))
print("Tier Name: {0}".format(ust.tierName))
print("Target Tier Name: {0}".format(ust.targetTierName))
print("Subnetwork Name: {0}".format(ust.subnetworkName))
print("Diagram Template Name: {0}".format(ust.diagramTemplateName))
print("Shortest Path Network Attribute Name: {0}".format(ust.shortestPathNetworkAttributeName))
print("Filter Bitset Network Attribute Name: {0}".format(ust.filterBitsetNetworkAttributeName))
print("Traversability Scope: {0}".format(ust.traversabilityScope))
print("Filter Scope: {0} \n".format(ust.filterScope))
# Condition Barrier Properties
print(" - Condition Barrier Properties - ")
for cb in ust.conditionBarriers:
try:
print("Name: {0} ".format(cb.name))
print("Type: {0} ".format(cb.type))
print("Operator: {0} ".format(cb.operator))
print("Value: {0} ".format(cb.value))
print("CombineUsingOr: {0}".format(cb.combineUsingOr))
print("Is Specific Value: {0} \n".format(cb.isSpecificValue))
except:
print("Skipped condition barrier properties. \n")
# Function Barrier Properties
print(" - Function Barrier Properties - ")
for fb in ust.functionBarriers:
try:
print("Name: {0} ".format(fb.networkAttributeName))
print("Type: {0} ".format(fb.functionType))
print("Operator: {0} ".format(fb.networkAttributeOperator))
print("Value: {0} ".format(fb.value))
print("Use Local Values: {0} \n".format(fb.useLocalValues))
except:
print("Skipped function barrier properties. \n")
# Filter Barrier Properties
print(" - Filter Barrier Properties - ")
for filb in ust.filterBarriers:
try:
print("Name: {0} ".format(filb.name))
print("Type: {0} ".format(filb.type))
print("Operator: {0} ".format(filb.operator))
print("Value: {0} ".format(filb.value))
print("CombineUsingOr: {0}".format(filb.combineUsingOr))
print("Is Specific Value: {0} \n".format(filb.isSpecificValue))
except:
print("Skipped filter barrier properties. \n")
# Filter Function Barrier Properties
print(" - Filter Function Barrier Properties - ")
for ffb in ust.filterFunctionBarriers:
try:
print("Name: {0} ".format(ffb.networkAttributeName))
print("Type: {0} ".format(ffb.functionType))
print("Operator: {0} ".format(ffb.networkAttributeOperator))
print("Value: {0} ".format(ffb.value))
print("Use Local Values: {0} \n".format(ffb.useLocalValues))
except:
print("Skipped filter function properties. \n")
# Functions Properties
print(" - Functions Properties - ")
for f in ust.functions:
# Try to get these properties if the exist, else, print the empty list
try:
print("Function Type: {0} ".format(f.functionType))
print("Function Network Attribute Name: {0} ".format(f.networkAttributeName))
print("Function Summary Attribute Name: {0} \n".format(f.summaryAttributeName))
# Function Conditions
print(" - Function Conditions - ")
for fc in f.conditions:
print("Name: {0} ".format(fc.name))
print("Type: {0} ".format(fc.type))
print("Operator: {0} ".format(fc.operator))
print("Value: {0} ".format(fc.value))
print("CombineUsingOr: {0}".format(fc.combineUsingOr))
print("Is Specific Value: {0} \n".format(fc.isSpecificValue))
except:
print("Skipped functions properties. \n")
# Nearest Neighbor Properties
print(" - Nearest Neighbor Properties - ")
nn = ust.nearestNeighbor
# Try to get these properties if the exist, else, print the empty list
try:
print("Count: {0} ".format(nn.count))
print("Cost Network Attribute Name: {0} ".format(nn.costNetworkAttributeName))
print("Nearest Categories: {0} \n".format(nn.nearestCategories))
print(" - Nearest Asset Properties - ")
for nsta in nn.nearestAssets:
try:
print("Network Source ID: {0}".format(nsta.networkSourceID))
print("Asset Group Code: {0}".format(nsta.assetGroupCode))
print("Asset Type Code: {0} \n".format(nsta.assetTypeCode))
except:
print("Skipped nearest assets properties. \n")
except:
print("Skipped nearest neighbor properties. \n")
# Output Filter Properties
print(" - Output Filter Properties - ")
for ofp in ust.outputFilters:
# Try to get these properties if the exist, else, print the empty list
try:
for of in ofp:
print("Network Source ID: {0}".format(of.networkSourceID))
print("Asset Group Code: {0}".format(of.assetGroupCode))
print("Asset Type Code: {0} \n".format(of.assetTypeCode))
except:
print("Skipped output filter properties. \n")
# Output Condition Properties
print(" - Output Condition Properties - ")
for oc in ust.outputConditions:
# Try to get these properties if the exist, else, print the empty list
try:
print("Name: {0} ".format(oc.name))
print("Type: {0} ".format(oc.type))
print("Operator: {0} ".format(oc.operator))
print("Value: {0} ".format(oc.value))
print("CombineUsingOr: {0}".format(oc.combineUsingOr))
print("Is Specific Value: {0} \n".format(oc.isSpecificValue))
except:
print("Skipped output condition properties. \n")
# Propagators Properties
print(" - Propagator Properties - ")
for p in ust.propagators:
# Try to get these properties if the exist, else, print the empty list
try:
print("Network Attribute Name: {0} ".format(p.networkAttributeName))
print("Trace Propagator Function Type: {0} ".format(p.tracePropagatorFunctionType))
print("Network Attribute Filter Operator: {0} ".format(p.networkAttributeOperator))
print("Network Attribute Value: {0} ".format(p.value))
print("Propagated Attribute Name: {0} ".format(p.propagatedAttributeName))
print("Substitution Attribute Name: {0} ".format(p.substitutionAttributeName))
except:
print("Skipped propagator properties. \n")