Add Diagram Feature Capability By Attribute Rule (Network Diagram)

Summary

Adds a diagram rule to a diagram template to assign a particular capability on diagram features currently represented in the diagram. This capability is used by other rules executed later in the rule sequence. The diagram features that will be processed are queried from a network source class or object table by attributes.

Learn more about the Add Diagram Feature Capability rule

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:

  • Use the Prevent related container from collapse or Allow related container to collapse option to flag content diagram features so they prevent or allow their related container to be collapsed by Collapse Container rules executed later in the rule sequence. These are rules that are set up using the Add Collapse Container Rule or Add Collapse Container By Attribute Rule tool.

  • Use the Prevent reduce junction or Allow reduce junction option to flag diagram junctions so they are discarded or allowed by Reduce Junction rules executed later in the rule sequence. These are rules that are set up using the Add Reduce Junction Rule or Add Reduce Junction By Attribute Rule tool.

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
Network Source

The network source class or object table that references the features or objects associated with the diagram features to which the particular capability will be assigned.

Table; Feature Class
Expression

An SQL expression used to filter out the features or objects of interest among the specified network source feature class or objet table. For more information on SQL syntax, see SQL reference for query expressions used in ArcGIS.

SQL Expression
Capability
(Optional)

Specifies the capability that will be assigned to the queried diagram features at the end of the rule execution. This capability will be used by other rules executed later in the rule sequence.

  • Prevent related container from collapse All queried features will be flagged to prevent their related container from being collapsed by Collapse Container rules executed later in the rule sequence. This is the default.
  • Allow related container to collapse All queried features will be flagged to allow their related container to be collapsed by Collapse Container rules executed later in the rule sequence.
  • Prevent reduce junction All queried junctions will be flagged to prevent Reduce Junction rules executed later in the rule sequence to reduce them.
  • Allow reduce junction All queried junctions will be flagged to allow Reduce Junction rules executed later in the rule sequence to reduce them.
String
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.AddDiagramFeatureCapabilityByAttributeRule(in_utility_network, template_name, is_active, network_source, where_clause, {capability}, {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
network_source

The network source class or object table that references the features or objects associated with the diagram features to which the particular capability will be assigned.

Table; Feature Class
where_clause

An SQL expression used to filter out the features or objects of interest among the specified network source feature class or objet table. For more information on SQL syntax, see SQL reference for query expressions used in ArcGIS.

SQL Expression
capability
(Optional)

Specifies the capability that will be assigned to the queried diagram features at the end of the rule execution. This capability will be used by other rules executed later in the rule sequence.

  • PREVENT_TO_COLLAPSE_CONTAINER All queried features will be flagged to prevent their related container from being collapsed by Collapse Container rules executed later in the rule sequence. This is the default.
  • ALLOW_TO_COLLAPSE_CONTAINER All queried features will be flagged to allow their related container to be collapsed by Collapse Container rules executed later in the rule sequence.
  • PREVENT_TO_REDUCE_JUNCTION All queried junctions will be flagged to prevent Reduce Junction rules executed later in the rule sequence to reduce them.
  • ALLOW_TO_REDUCE_JUNCTION All queried junctions will be flagged to allow Reduce Junction rules executed later in the rule sequence to reduce them.
String
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

AddDiagramFeatureCapabilityByAttributeRule example (stand-alone script)

Add a Diagram Feature Capability rule to the MyTemplate1 template to flag all the switches so they prevent their container from being collapsed later.

import arcpy
input_Network = "D:/MyProjectLocation/MyDatabaseConnection.sde/MyDatabase.MAP.Electric/MyDatabase.MAP.Electric"
input_DistributionDevice = "D:/MyProjectLocation/MyDatabaseConnection.sde/MyDatabase.MAP.Electric/MyDatabase.MAP.ElectricDistributionDevice"

input_DiagramTemplate = "MyTemplate1"

arcpy.AddDiagramFeatureCapabilityByAttributeRule_nd(
    input_Network, input_DiagramTemplate, 'ACTIVE', 
    input_DistributionDevice, 'ASSETGROUP=14', "PREVENT_TO_COLLAPSE_CONTAINER")

Environments

This tool does not use any geoprocessing environments.

Licensing information

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

Related topics