Skip To Content

Add Set Starting Point By Attribute Rule


Adds a diagram rule to a diagram template to set diagram features currently represented in the diagrams as starting points for tracing rules. The diagram features are queried from a given utility network source class and can be filtered by their attributes.

Learn more about presetting starting points on diagrams


  • Configuring starting points on a diagram template makes sense when the template is set up to execute a Trace rule. In this case, the configured trace considers the specified starting points as the only starting points for execution instead of running all the features represented in the diagram at the time it executes.


AddSetStartingPointByAttributeRule_un (in_utility_network, template_name, is_active, network_source, {where_clause}, {junction_terminals}, {description})
ParameterExplanationData Type

The utility network referencing the diagram template to modify.

Utility Network

The name of the diagram template to modify.


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

  • ACTIVEThe added rule becomes enabled during the generation and update of any diagrams based on the input template. This is the default.
  • INACTIVEThe added rule is not enabled during the generation or update of any diagrams based on the input template.

The network source class that references the features that will be set as starting points.

Feature Class

An SQL expression to select the subset of features in the source class that will be set as starting points. For more information on SQL syntax, see SQL reference for query expressions used in ArcGIS.

SQL Expression

The terminal IDs that will be considered to start tracing if the network source class references junctions with terminals.


The description of the rule.


Derived Output

NameExplanationData Type

The updated utility network.

Utility Network

The name of the network template.


Code sample

AddSetStartingPointByAttributeRule example (stand-alone script)

Add a Set Starting Point By Attribute rule to the MyTemplate1 template to set starting points on the Load terminal of the Circuit Breaker distribution devices (ASSETGROUP<>4). This means that any Load terminal on circuit breakers in the generated diagrams will be set as starting points.

import arcpy
input_UtilityNetwork = "D:/MyProjectLocation/MyDatabaseConnection.sde/MyDatabase.MAP.Electric/MyDatabase.MAP.Electric"
input_DiagramTemplate = "MyTemplate1"
input_Device = "D:/MyProjectLocation/MyDatabaseConnection.sde/MyDatabase.MAP.Electric/MyDatabase.MAP.ElectricDistributionDevice"

arcpy.AddCollapseContainerByAttributeRule_un(input_UtilityNetwork, input_DiagramTemplate, 
                                             "ACTIVE", input_Device, 
                                             "ASSETGROUP <> 4", 3)


This tool does not use any geoprocessing environments.

Licensing information

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