Add Remove Feature By Attribute Rule (Network Diagram)

Summary

Adds a diagram rule to automatically remove diagram features during diagram building based on an existing template. The features to be removed are queried by attributes from a given network source class or object table. You can also constrain the removal of features based on connectivity.

Learn more about the removal of features in diagrams

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 Diagram to update 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 Remove Feature rule is used to remove specific network features or network objects represented in diagrams. This rule removes these network elements by source class or object table, and optionally filters them based on connectivity constraints or their attributes.

    This tool allows you to configure the Remove Feature rule to run by attributes. It allows the configuration of the removal of diagram features from a given network class or object table by filtering their attributes.

    Note:

    When the Remove Feature rule runs at the first position in the list of rules related to a template, it permanently deletes the initial diagram features, gaining space and improving performance for additional updates.

  • If representing network linear containers and their related contents together in diagrams is confusing or of little interest to you, you can also use this tool to remove linear container edges in diagrams (network lines or edge objects in which the Association status attribute is Container).

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 to Remove

The network source class or object table that will be processed. All diagram features related to network features or objects that belong to this source class or object table are removal candidates.

Table; Feature Class
Expression
(Optional)

An SQL expression that will be used to select the subset of network elements from the element removal candidates in the diagrams based on the input template. For more information about SQL syntax, see the SQL reference for query expressions used in ArcGIS help topic.

SQL Expression
Description
(Optional)

The description of the rule.

String
Junctions must be unconnected

Specifies whether diagram junctions and diagram containers must be unconnected to be removed.

  • Checked—Diagram junctions and diagram containers must be unconnected to be removed.
  • Unchecked—Diagram junctions and diagram containers do not need to be unconnected to be removed. This is the default.

Note:

This parameter is only active when the Network Source to Remove parameter value corresponds to junctions or containers in the network diagrams.

Boolean
Junctions must be connected to a single junction

Specifies whether diagram junctions and diagram containers must be connected to a single diagram junction or diagram container to be removed.

  • Checked—Diagram junctions and diagram containers must be connected to a single diagram junction or diagram container to be removed.
  • Unchecked—Diagram junctions and diagram containers do not need to be connected to a single diagram junction or diagram container to be removed. This is the default.

Note:

This parameter is only active when the Network Source to Remove parameter value corresponds to junctions or containers in the network diagrams.

Boolean

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.AddRemoveFeatureByAttributeRule(in_utility_network, template_name, is_active, network_source, {where_clause}, {description}, unconnected_junctions, one_connected_junction)
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 will be processed. All diagram features related to network features or objects that belong to this source class or object table are removal candidates.

Table; Feature Class
where_clause
(Optional)

An SQL expression that will be used to select the subset of network elements from the element removal candidates in the diagrams based on the input template. For more information about SQL syntax, see the SQL reference for query expressions used in ArcGIS help topic.

SQL Expression
description
(Optional)

The description of the rule.

String
unconnected_junctions

Specifies whether diagram junctions and diagram containers must be unconnected to be removed.

  • MUST_BE_UNCONNECTEDDiagram junctions and diagram containers must be unconnected to be removed.
  • NO_CONSTRAINTDiagram junctions and diagram containers do not need to be unconnected to be removed. This is the default.
Note:

This parameter is enabled when the specified network_source parameter value corresponds to junctions or containers in the network diagrams.

Boolean
one_connected_junction

Specifies whether diagram junctions and diagram containers must be connected to a single diagram junction or diagram container to be removed.

  • MUST_BE_CONNECTED_TO_SINGLE_JUNCTIONDiagram junctions and diagram containers must be connected to a single diagram junction or diagram container to be removed.
  • NO_CONSTRAINTDiagram junctions and diagram containers do not need to be connected to a single diagram junction or diagram container to be removed. This is the default.
Note:

This parameter is enabled when the specified network_source parameter value corresponds to junctions or containers in the network diagrams.

Boolean

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

AddRemoveFeatureByAttributeRule example (Python window)

Add a Remove Feature By Attribute rule to the MyTemplate1 template existing for a given network to systematically remove transmission lines that are underground—PLACEMENT=1—in the generated diagrams.

import arcpy
input_Network = "D:/MyProjectLocation/MyDatabaseConnection.sde/MyDatabase.MAP.Electric/MyDatabase.MAP.Electric"
input_DiagramTemplate = "MyTemplate1"
input_ClassToRemove = "D:/MyProjectLocation/MyDatabaseConnection.sde/MyDatabase.MAP.Electric/MyDatabase.MAP.ElectricTransmissionLine"

arcpy.nd.AddRemoveFeatureByAttributeRule(input_Network, input_DiagramTemplate,
                                         "ACTIVE", input_ClassToRemove, "PLACEMENT=1")

Environments

This tool does not use any geoprocessing environments.

Licensing information

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

Related topics