ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.Data.UtilityNetwork.Trace Namespace / NetworkAttributeComparison Class / NetworkAttributeComparison Constructor / NetworkAttributeComparison Constructor(NetworkAttribute,Operator,Object)
The NetworkAttribute to use in the comparison.
The Operator to use (equals, less than, etc.).
The specific value that the NetworkAttribute should be compared against. This value cannot be null.
Example Version

NetworkAttributeComparison Constructor(NetworkAttribute,Operator,Object)
Initializes a new instance of the NetworkAttributeComparison class.
Syntax
public NetworkAttributeComparison( 
   NetworkAttribute networkAttribute,
   Operator comparisonOperator,
   object value
)

Parameters

networkAttribute
The NetworkAttribute to use in the comparison.
comparisonOperator
The Operator to use (equals, less than, etc.).
value
The specific value that the NetworkAttribute should be compared against. This value cannot be null.
Example
Create a Condition to compare a Network Attribute against a set of values
// Create a NetworkAttribute object for the Lifecycle network attribute from the UtilityNetworkDefinition
using (NetworkAttribute lifecycleNetworkAttribute = utilityNetworkDefinition.GetNetworkAttribute("Lifecycle"))
{
  // Create a NetworkAttributeComparison that stops traversal if Lifecycle <> "In Design" (represented by the constant InDesign)
  NetworkAttributeComparison inDesignNetworkAttributeComparison = new NetworkAttributeComparison(lifecycleNetworkAttribute, Operator.NotEqual, InDesign);

  // Create a NetworkAttributeComparison to stop traversal if Lifecycle <> "In Service" (represented by the constant InService)
  NetworkAttributeComparison inServiceNetworkAttributeComparison = new NetworkAttributeComparison(lifecycleNetworkAttribute, Operator.NotEqual, InService);

  // Combine these two comparisons together with "And"
  And lifecycleFilter = new And(inDesignNetworkAttributeComparison, inServiceNetworkAttributeComparison);

  // Final condition stops traversal if Lifecycle <> "In Design" and Lifecycle <> "In Service"
  traceConfiguration.Traversability.Barriers = lifecycleFilter;
}
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3 or higher.
See Also