Add Remove Feature Rule (Network Diagram)

Summary

Adds a diagram rule to the rule sequence specified on a diagram template to automatically remove diagram features during diagram buildings. This rule removes diagram features based on different network source classes and object tables. You can constrain the removal of features based on connectivity.

Learn more about feature and nonspatial object removal in network 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 processes on network source classes or object tables, or on network categories. When the remove operation is configured to process on a network source class or object table, you can filter out these network elements by attributes. The process can also be run for specific connectivity constraints depending on the geometry type of the removed network elements.

    You can use this tool to configure the Remove Feature rule to remove either all diagram features that are based on specified network source classes and object tables or all diagram features except those based on the specified network source classes and object tables.

    By default, the Rule Process parameter is set to Include source classes and one or more network source classes or object tables with all their features or objects, respectively, must be systematically discarded in the generated diagram.

    When the Rule Process parameter is set to Exclude source classes, all network features and objects represented in the diagrams are removed except those based on the specified network source classes and object tables. Use this parameter to remove all features in diagrams except those representing electric transmission lines, for example, and to guarantee that diagrams showing only the electric transmission part of the network will be returned, regardless of what the end user selects as input for the diagram generation.

  • Starting with ArcGIS Pro 2.9, you can configure particular constraints based on connectivity so that the Remove Feature rule only applies to unconnected junctions or junctions connected to a single junction in the network diagram. These constraints can be set up to process network features or objects represented as diagram junctions or diagram containers.

  • You can use this tool to configure automatic discard of diagram features based on network source classes or object tables that may be present among the input network features and objects set during diagram building. For example, when an area is selected without prefiltering features and you want the diagram from this area to show only the primary equipment, you can configure the Remove Feature rule to automatically remove secondary equipment that may be present in the input network elements set.

  • 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, you can also use this tool to remove linear container edges from diagrams. In this case, the Remove Feature rule is typically configured at the end of the rule sequence.

  • When the SystemJunctions class exists among the specified Network Sources parameter values, the rule is systematically applied to both system junctions and system junction objects.

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

Specifies the geometry type of the source class or object table that will be processed.

  • Junctions onlyOnly junction source classes or object tables (network polygon source classes, network point source classes, or junction object tables) will be processed.
  • Edges onlyOnly edge source classes or object tables (network line source classes or edge object tables) will be processed.
  • Both junctions and edgesBoth junction and edge types will be processed. This is the default.
String
Rule Process

Specifies how the specified network source classes and object tables will be processed.

  • Exclude source classesFeatures and objects based on the specified network source classes and object tables will not be removed, while other features and objects will be removed.
  • Include source classesFeatures and objects based on the specified network source classes and object tables will be removed. This is the default.
String
Network Sources

The network source class (or classes) and object table (or tables) that will be excluded or included depending on the rule process.

By default, the Rule Process parameter is set to Include source classes, and one or more network source classes or object tables will be processed. All diagram features related to network features and objects that belong to those classes and object tables will be removed.

Note:

When specifying the SystemJunctions class among the network source classes, the rule will systematically process both system junctions and system junction objects.

Table; Feature Class
Description
(Optional)

The description of the rule.

String
Junctions must be unconnected

Specifies whether diagram junction and diagram container candidates must be unconnected to be removed.

  • Checked—Diagram junction and diagram container candidates must be unconnected to be removed.
  • Unchecked—Neither diagram junction nor diagram container candidates need to be unconnected to be removed. This is the default.

Note:

This parameter is active only when the Source Type parameter is set to Junctions only.

Boolean
Junctions must be connected to a single junction

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

  • Checked—Diagram junction and diagram container candidates must be connected to a single diagram junction or diagram container to be removed.
  • Unchecked—Neither diagram junction nor diagram container candidates need to be connected to a single diagram junction or diagram container to be removed. This is the default.
Note:

This parameter is active only when the Source Type parameter is set to Junctions only.

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.AddRemoveFeatureRule(in_utility_network, template_name, is_active, source_type, inverse_source_selection, network_source, {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
source_type

Specifies the geometry type of the source class or object table that will be processed.

  • JUNCTIONSOnly junction source classes or object tables (network polygon source classes, network point source classes, or junction object tables) will be processed.
  • EDGESOnly edge source classes or object tables (network line source classes or edge object tables) will be processed.
  • BOTHBoth junction and edge types will be processed. This is the default.
String
inverse_source_selection

Specifies how the specified network source classes and object tables will be processed.

  • EXCLUDE_SOURCE_CLASSESFeatures and objects based on the specified network source classes and object tables will not be removed, while other features and objects will be removed.
  • INCLUDE_SOURCE_CLASSESFeatures and objects based on the specified network source classes and object tables will be removed. This is the default.
String
network_source
[network_source,...]

The network source class (or classes) and object table (or tables) that will be excluded or included depending on the rule process.

By default, the inverse_source_selection parameter is set to INCLUDE_SOURCE_CLASSES, and one or more network source classes or object tables will be processed. All diagram features related to network features and objects that belong to those classes and object tables will be removed.

Note:

When specifying the SystemJunctions class among the network source classes, the rule will systematically process both system junctions and system junction objects.

Table; Feature Class
description
(Optional)

The description of the rule.

String
unconnected_junctions

Specifies whether diagram junction and diagram container candidates must be unconnected to be removed.

  • MUST_BE_UNCONNECTEDDiagram junction and diagram container candidates must be unconnected to be removed.
  • NO_CONSTRAINTNeither diagram junction nor diagram container candidates need to be unconnected to be removed. This is the default.
Note:

This parameter is only used when the source_type parameter is set to JUNCTIONS.

Boolean
one_connected_junction

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

  • MUST_BE_CONNECTED_TO_SINGLE_JUNCTIONDiagram junction and diagram container candidates must be connected to a single diagram junction or diagram container to be removed.
  • NO_CONSTRAINTNeither diagram junction nor diagram container candidates need to be connected to a single diagram junction or diagram container to be removed. This is the default.
Note:

This parameter is only used when the source_type parameter is set to JUNCTIONS.

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

AddRemoveFeatureRule example (stand-alone script)

Add a Remove Feature rule to the MyTemplate1 template existing for a given network to remove all network features and objects, except the electric transmission lines, and to build diagrams that only focus on the electric transmission part of the network.

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

arcpy.nd.AddRemoveFeatureRule(input_Network, input_DiagramTemplate, 
                              'ACTIVE', 'EDGES', 'EXCLUDE_SOURCE_CLASSES', 
                              input_DoNotRemoveThisClass)

Environments

This tool does not use any geoprocessing environments.

Licensing information

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

Related topics