Show / Hide Table of Contents

Method CreateAsync

CreateAsync(UtilityNetwork, UtilityAssetType)

Analyzes a UtilityNetwork for the rules which allow or limit the snapping of the given UtilityAssetType to other features, and returns a SnapRules which can be used to configure interactive snapping behavior in a GeometryEditor.

Declaration
public static Task<SnapRules> CreateAsync(UtilityNetwork utilityNetwork, UtilityAssetType assetType)
Parameters
Type Name Description
UtilityNetwork utilityNetwork

The UtilityNetwork object to analyze for its connectivity rules relating to the given assetType.

UtilityAssetType assetType

The asset type of the feature geometry that will be edited in the GeometryEditor. Connectivity rules involving this asset type are included in the returned SnapRules.

Returns
Type Description
System.Threading.Tasks.Task<SnapRules>

A SnapRules appropriate for interactively editing the geometry of a feature of the given UtilityAssetType.

Remarks

To configure rule-based snapping, use this method to create a SnapRules that you can then pass to SyncSourceSettings(SnapRules, SnapSourceEnablingBehavior). This method is ideal for creating SnapRules when you have a reference to the UtilityAssetType, for example if you have identified an existing feature to be edited, you can call CreateElement(ArcGISFeature), then get AssetType to pass in.

Ensure that the feature tables underlying the given UtilityNetwork are the same used by operational layers in the map, so that the SnapRules are based on the same underlying data sets.

If your map view displays a web map, or is set from a MobileMapPackage, the UtilityNetworks collection may already contain the relevant utility network object to use. Alternatively you may get the utility network from the same Geodatabase that backs your operational layers, or call UtilityNetwork(Uri, Map) to create the network from a feature service URI and associate it with your Map.

Ensure that the UtilityAssetType is from the given UtilityNetwork.

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0200.7
.NET200.7
.NET Windows200.7
.NET Android200.7
.NET iOS200.7
.NET Framework200.7
UWP200.7

CreateAsync(UtilityNetwork, FeatureTable, IEnumerable<KeyValuePair<String, Object>>)

Analyzes a UtilityNetwork for the rules which allow or limit the snapping of a feature in the given featureTable with the given attributes, and returns a SnapRules which can be used to configure interactive snapping behavior in a GeometryEditor.

Declaration
public static Task<SnapRules> CreateAsync(UtilityNetwork utilityNetwork, FeatureTable featureTable, IEnumerable<KeyValuePair<string, object>> attributes)
Parameters
Type Name Description
UtilityNetwork utilityNetwork

The UtilityNetwork object to analyze for its connectivity rules relating to a feature of the asset type described by the given featureTable and attributes.

FeatureTable featureTable

The feature table that will contain the feature whose geometry will be edited in the GeometryEditor using the returned SnapRules. Must be part of the given utilityNetwork.

System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.Object>> attributes

The attributes for the feature whose geometry will be edited in the GeometryEditor using the returned SnapRules.

Returns
Type Description
System.Threading.Tasks.Task<SnapRules>

A SnapRules appropriate for interactively editing the geometry of a feature in the given featureTable with the given attributes.

Remarks

To configure rule-based snapping, use this method to create a SnapRules that you can then pass to SyncSourceSettings(SnapRules, SnapSourceEnablingBehavior). This method is ideal for creating SnapRules where you have a set of attributes, for example, if you are creating a new feature from a FeatureTemplate or by using a FeatureForm. Connectivity rules involving the UtilityAssetType of the feature are described by those attributes are included in the resulting rules.

Ensure that the feature tables underlying the given UtilityNetwork are the same used by operational layers in the map, so that the SnapRules are based on the same underlying data sets.

If your map view displays a web map, or is set from a MobileMapPackage, the UtilityNetworks collection may already contain the relevant utility network object to use. Alternatively you may get the utility network from the same Geodatabase that backs your operational layers, or call UtilityNetwork(Uri, Map) to create the network from a feature service URI and associate it with your Map.

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0200.7
.NET200.7
.NET Windows200.7
.NET Android200.7
.NET iOS200.7
.NET Framework200.7
UWP200.7
In This Article
Back to top Copyright © 2022 Esri.