Skip To Content

Add Diagram Feature Capability By Attribute Rule

Summary

Adds a diagram rule to a diagram template to assign a particular capability on diagram features currently represented in the diagram. This capability is considered by some other rules executed later in the rule sequence. The diagram features to process are queried from a utility network source class by attributes.

Learn about the Add Diagram Feature Capability rule

Usage

  • Use the Prevent container collapse and Allow container collapse options to flag diagram features so they prevent or allow their related container to be collapsed by Collapse Container rules executed later in the rule sequence, that is, rules set up using the Add Collapse Container Rule or Add Collapse Container By Attribute Rule tools later.

Syntax

AddDiagramFeatureCapabilityByAttributeRule(in_utility_network, template_name, is_active, network_source, where_clause, {capability}, {description})
ParameterExplanationData Type
in_utility_network

The utility network referencing the diagram template to modify.

Utility Network
template_name

The name of the diagram template to modify.

String
is_active

Specifies whether the rule is enabled when generating and updating diagrams based on the specified template.

  • ACTIVEThe added rule becomes enabled during the generation and update of any diagrams based on the input template. This is the default.
  • INACTIVEThe added rule is not enabled during the generation or update of any diagrams based on the input template.
Boolean
network_source

The network source class that references the features associated with the diagram features to which the particular capability will be assigned.

Table; Feature Class
where_clause

An SQL expression used to filter out the features of interest among all the source class features. For more information on SQL syntax, see SQL reference for query expressions used in ArcGIS.

SQL Expression
capability
(Optional)

The capability assigned to the queried diagram features at the end of the rule execution. This capability will be considered by other rules executed later in the rule sequence.

  • PREVENT_TO_COLLAPSE_CONTAINER All queried features will be flagged to prevent their containers from being collapsed by Collapse Container rules executed later in the rule sequence. This is the default.
  • ALLOW_TO_COLLAPSE_CONTAINER All queried features will be flagged to allow their related container to be collapsed by Collapse Container rules executed later in the rule sequence.
String
description
(Optional)

The description of the rule.

String

Derived Output

NameExplanationData Type
out_utility_network

The updated utility network.

Utility Network
out_template_name

The name of the network template.

String

Code sample

AddDiagramFeatureCapabilityByAttributeRule example (stand-alone script)

Add a Diagram Feature Capability rule to the MyTemplate1 template to flag all the switches so they prevent their container from being collapsed later.

import arcpy
input_UtilityNetwork = "D:/MyProjectLocation/MyDatabaseConnection.sde/MyDatabase.MAP.Electric/MyDatabase.MAP.Electric"
input_DistributionDevice = "D:/MyProjectLocation/MyDatabaseConnection.sde/MyDatabase.MAP.Electric/MyDatabase.MAP.ElectricDistributionDevice"

input_DiagramTemplate = "MyTemplate1"

arcpy.AddDiagramFeatureCapabilityByAttributeRule_un(
    input_UtilityNetwork, input_DiagramTemplate, 'ACTIVE', 
    input_DistributionDevice, 'ASSETGROUP=14', "PREVENT_TO_COLLAPSE_CONTAINER")

Environments

This tool does not use any geoprocessing environments.

Licensing information

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

Related topics