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 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 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).
Syntax
AddRemoveFeatureByAttributeRule(in_utility_network, template_name, is_active, network_source, {where_clause}, {description})
Parameter | Explanation | Data 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.
| 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
Name | Explanation | Data 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
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
Licensing information
- Basic: No
- Standard: Yes
- Advanced: Yes