Add Stop Iteration Rule (Network Diagram)

Summary

Adds a diagram rule to specify the end of a rule sequence during diagram building based on an existing template.

Learn more about rules used to iterate on a particular sequences of diagram rules

Caution:

This tool is a configuration and administration tool.

Note:

This tool impacts the consistency of any existing diagrams based on the input diagram template. All of the existing diagrams become inconsistent and open with a consistency warning icon May be inconsistent until they are updated.

Usage

  • This tool is not supported when working with a utility network or trace network service. You must use either a utility network or trace network in a file or mobile geodatabase, or a database connection to a utility network or trace network in an enterprise geodatabase. When working with an enterprise geodatabase the following are requirements:

  • The Stop Iteration rule specifies the end of the rule sequence on which the diagram builder will iterate.

Parameters

LabelExplanationData Type
Input Network

The utility network or trace network containing the diagram template that will be modified.

Utility Network; Trace Network
Input Diagram Template

The name of the diagram template that will be modified.

String
Active

Specifies whether the rule will be active when generating and updating diagrams based on the specified template.

  • Checked—The added rule will become active during the generation and update of any diagrams based on the input template. This is the default.
  • Unchecked—The added rule will not become active during the generation or update of any diagrams based on the input template.

Boolean
Description
(Optional)

The description of the rule.

String

Derived Output

LabelExplanationData Type
Output Network

The updated utility network or trace network.

Utility Network; Trace Network
Output Diagram Template

The name of the diagram template.

String

arcpy.nd.AddStopIterationRule(in_utility_network, template_name, is_active, {description})
NameExplanationData Type
in_utility_network

The utility network or trace network containing the diagram template that will be modified.

Utility Network; Trace Network
template_name

The name of the diagram template that will be modified.

String
is_active

Specifies whether the rule will be enabled when generating and updating diagrams based on the specified template.

  • ACTIVEThe added rule will become enabled during the generation and update of any diagrams based on the input template. This is the default.
  • INACTIVEThe added rule will not become enabled during the generation or update of any diagrams based on the input template.
Boolean
description
(Optional)

The description of the rule.

String

Derived Output

NameExplanationData Type
out_utility_network

The updated utility network or trace network.

Utility Network; Trace Network
out_template_name

The name of the diagram template.

String

Code sample

AddStopIterationRule example (stand-alone example)

Create a template configured to trace a subnetwork, remove containers, and loop on a set of reduction rules. The rules will reduce all system and miscellaneous junctions that are connected to 0, 1, or 2 other junctions, reduce all distribution devices except circuit breakers and switches that are connected to 0, 1, or 2 other junctions, and reduce all system and miscellaneous junctions that are connected to 3 or more other junctions.

import arcpy

input_Network = "D:/MyProjectLocation/MyDatabaseConnection.sde/MyDatabase.MAP.Electric/MyDatabase.MAP.Electric"
input_DiagramTemplate = "Template1"
input_StructureJunction = "D:/MyProjectLocation/MyDatabaseConnection.sde/MyDatabase.MAP.Electric/MyDatabase.MAP.StructureJunction"
input_DistributionAssembly = "D:/MyProjectLocation/MyDatabaseConnection.sde/MyDatabase.MAP.Electric/MyDatabase.MAP.ElectricDistributionAssembly"
input_DistributionDevice = "D:/MyProjectLocation/MyDatabaseConnection.sde/MyDatabase.MAP.Electric/MyDatabase.MAP.ElectricDistributionDevice"
input_MiscJunction = "D:/MyProjectLocation/MyDatabaseConnection.sde/MyDatabase.MAP.Electric/MyDatabase.MAP.ElectricDistributionJunction"
input_SystemJunctions = "D:/MyProjectLocation/MyDatabaseConnection.sde/MyDatabase.MAP.Electric/MyDatabase.MAP.UN_112_SystemJunctions"

arcpy.AddDiagramTemplate_nd(input_Network, input_DiagramTemplate)

arcpy.AddTraceRule_nd(input_Network, input_DiagramTemplate, "ACTIVE", 
                      "SUBNETWORK", "ElectricDistribution", "Medium Voltage", 
                      "Low Voltage Mesh")

arcpy.AddRemoveFeatureRule_nd(input_Network, input_DiagramTemplate, 
                              'ACTIVE', 'INCLUDE_SOURCE_CLASSES', 
                              input_StructureJunction + ";" + input_DistributionAssembly)

arcpy.AddStartIterationRule_nd(input_Network, input_DiagramTemplate, 
                               'ACTIVE')

arcpy.AddReduceJunctionRule_nd(input_Network, input_DiagramTemplate, 
                               'ACTIVE', 'INCLUDE_SOURCE_CLASSES', 
                               input_SystemJunctions + ";" + input_MiscJunction, 
                               "MAX_2_CONNECTED_JUNCTIONS", 
                               "REDUCE_UNCONNECTED_JCT", 
                               "REDUCE_JCT_TO_1JCT", "REDUCE_JCT_TO_2JCTS")

arcpy.AddReduceJunctionByAttributesRule_nd(input_Network, 
                                           input_DiagramTemplate, 'ACTIVE', "", 
                                           input_DistributionDevice, 
                                           "ASSETGROUP NOT IN (4, 15)", 
                                           "MAX_2_CONNECTED_JUNCTIONS", 
                                           "REDUCE_UNCONNECTED_JCT", 
                                           "REDUCE_JCT_TO_1JCT", 
                                           "REDUCE_JCT_TO_2JCTS")

arcpy.AddReduceJunctionRule_nd(input_Network, input_DiagramTemplate, 
                               'ACTIVE', 'INCLUDE_SOURCE_CLASSES', 
                               input_SystemJunctions + ";" + input_MiscJunction, 
                               "MIN_3_CONNECTED_JUNCTIONS")

arcpy.AddStopIterationRule_nd(input_Network, input_DiagramTemplate, 
                              'ACTIVE')

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: No
  • Standard: Yes
  • Advanced: Yes

Related topics