Add Remove Feature Rule (Network Diagram)

Summary

Adds a diagram rule to automatically remove diagram features during diagram building based on an existing template. This rule removes diagram features based on different network source classes and object tables.

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 May be inconsistent until they are updated.

Usage

  • This tool is not supported when working with a utility network service. You must work with either a utility network or trace network in a file geodatabase or a database connection to a utility network in an enterprise geodatabase. When working with an enterprise geodatabase, the connection must be established as the database utility network owner.

  • When performing this operation on a utility network in an enterprise geodatabase, the connected ArcGIS Enterprise portal account must be the portal utility network owner.

  • The network data element specified for the input network parameter must be from either a utility network or trace network in a file geodatabase or a database connection to a utility network in an enterprise geodatabase.

  • 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 is used to configure the Remove Feature rule so it removes 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, this tool is configured with Rule Process set to Include source classes (inverse_source_selection = "INCLUDE_SOURCE_CLASSES" in Python) and expects one or more network source classes or object tables with all their features or objects, respectively, to be systematically discarded in the generated diagram.

    When this tool is configured with Rule Process set to Exclude source classes (inverse_source_selection = "EXCLUDE_SOURCE_CLASSES" in Python), 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 regardless of what the end user selects as input for the diagram generation will be returned.

  • This tool is useful 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 any features and you want the diagram from this area to show only the primary equipment, you can configure a Remove Feature rule to automatically remove any secondary equipment that may be present in the input network elements set.

  • 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.

  • 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 executed at the end of the rule sequence.

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

Syntax

AddRemoveFeatureRule(in_utility_network, template_name, is_active, source_type, inverse_source_selection, network_source, {description})
ParameterExplanationData 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
source_type

Specifies the geometry type of the source class or object table to 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, Rule Process is set to Include source classes (inverse_source_selection = "INCLUDE_SOURCE_CLASSES" in Python), 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

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)

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