I am using my own tool to add points by user.
The code takes the point clicked by the user. Do some stuff and add it to the feature class.
I would like to snap the point just like it was added with the create feature standard tool.
Is there any way to take a geometry in the code and snap it by the current snap env?
Thanks
Hi,
In the constructor of your tool you need to add line :
UseSnapping = true;
Then in the "OnSketchCompleteAsync" create feature using EditOperation Create method:
// Create an edit operation
var createOperation = new EditOperation();
createOperation.Name = string.Format("Create {0}", layer.Name);
createOperation.SelectNewFeatures = true;
// Queue feature creation
createOperation.Create(layer, geometry);
return createOperation.Execute();