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 remove are queried by attributes from a given network source class or object table.

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 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 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 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 is executed 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.

  • Since representing network linear containers and their related contents together in diagrams may be confusing or of little interest, 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 to modify.

Utility Network; Trace Network
Input Diagram Template

The name of the diagram template to modify.

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 to process. 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 used to select the subset of network elements from the element removal candidates in the diagrams based on the input template. For more information on SQL syntax, see the SQL reference for query expressions used in ArcGIS help topic.

SQL Expression
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.AddRemoveFeatureByAttributeRule(in_utility_network, template_name, is_active, network_source, {where_clause}, {description})
NameExplanationData Type
in_utility_network

The utility network or trace network containing the diagram template to modify.

Utility Network; Trace Network
template_name

The name of the diagram template to modify.

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 to process. 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 used to select the subset of network elements from the element removal candidates in the diagrams based on the input template. For more information on SQL syntax, see the SQL reference for query expressions used in ArcGIS help topic.

SQL Expression
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

AddRemoveFeatureByAttributeRule example (Python window)

This sample script adds 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.AddRemoveFeatureByAttributeRule_nd(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