Class SnapRules
A table of snapping rules to apply to one or more ISnap
Inheritance
Namespace: Esri.ArcGISRuntime.UI.Editing
Assembly: Esri.ArcGISRuntime.dll
Syntax
public sealed class SnapRules
Remarks
When using the Geometry
-
Connect a Geometry
Editor to the map view, and ensure the Map is set and contains the pertinent utility network(s).-
See Geometry
Editor for more information about general GeometryEditor set up and configuration. -
The Operational
Layers collection should include, at a minimum, the layer you wish to edit, and the layers that have connectivity with the edit layer that will be used for snapping. The utility network data model makes use of sublayers, and adding the layers using SubtypeFeature offers the ability to change visibility and enable or disable snapping for specific subtypes. If you are programmatically adding layers to the map, ensure that you use a ServiceLayer Geodatabase when adding multiple layers from the same feature service.
-
See Geometry
-
Get the Utility
Network that you will be working with.-
If you are opening a web map or Mobile
Map , the UtilityPackage Networks collection may already contain the relevant utility network. 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.
-
If you are opening a web map or Mobile
-
Create a Snap
Rules object appropriate for use with the utility network and asset type you will edit:-
If you know the Utility
Asset , you can pass this to CreateType Async(Utility . For example, if you have identified an existing feature to be edited, you can call CreateNetwork, Utility Asset Type) Element(Arc , then get AssetGISFeature) Type . -
If you have a set of Attributes, you can pass these to
CreateAsync(UtilityNetwork, FeatureTable, IEnumerable<KeyValuePair<String, Object>>).
For example, you may be creating a new feature from a Feature
Template or by using a FeatureForm .
-
If you know the Utility
-
Get the Snap
Settings , and ensure IsEnabled and IsFeature areSnapping Enabled true
. -
Call Sync
Source , passing in the snap rules you created previously, and SetSettings(Snap Rules, Snap Source Enabling Behavior) From .Rules - If your workflow has previously synchronized snap sources, consider if Preserve is more appropriate instead.
-
Call Start(Geometry) passing in the
Geometry of the feature you wish to edit, or
Start(Geometry
Type) if you have no initial geometry.- The user can interactively edit the feature geometry.
- When edits are complete, set the feature geometry with the result of Stop().
After calling Sync
Ensure that your Utility
Utility network features are z-aware — each feature geometry includes z-values (Hastrue
). Two points, or vertices, are geometrically coincident when the x, y, and z-values of the points or
vertices are equal. When you configure rule-based snapping, by calling
Sync
See also: Network Rules ArcGIS Pro help topic
Methods
Name | Description |
---|---|
CreateAsync(UtilityNetwork, FeatureTable, IEnumerable<KeyValuePair<String, Object>>) | Analyzes a Utility |
Create |
Analyzes a Utility |
Get |
Returns the applicable Snap |
See Also
Applies to
Target | Versions |
---|---|
.NET Standard 2.0 | 200.7 |
.NET | 200.7 |
.NET Windows | 200.7 |
.NET Android | 200.7 |
.NET iOS | 200.7 |
.NET Framework | 200.7 |
UWP | 200.7 |