I'm looking for a way to place, select, move, delete features inside a custom C# ArcObjects application (using AxMapControl). I found the exact behavior in ArcMap, but I want to save the user some steps and avoid all of the dialogs, etc. It appears to be creating a point sketch geometry.
In ArcMap, I can do the following steps:
- Open a new map doc
- Choose start editing from the Editor toolbar
- Then I get a dialog asking me to choose the layer to edit
- After selecting a layer, a panel appears that is titled "Create Features". Under it, there is another panel named "Construction Tools"
- When I click on a feature in the upper panel, I get a "Point" option in the lower panel
- Now when I move the mouse over the map, the cursor has the same icon as the feature I selected.
- Clicking will place a feature, then I can drag or delete.
So ... how can I replicate this behavior in a custom app using ArcObjects. I've already been able to replicate the behavior of other tools by doing something like this:
ICommandPoolEdit _commandPool = new CommandPoolClass(); ICommand solveRouteToolCmd = new ControlsNetworkAnalystSolveCommand(); _commandPool.AddCommand(solveRouteToolCmd, null); ICommand command = commandPool.get_Command((int)solveRouteToolCmd ); //pass the MapControl to the oncreate method command.OnCreate(_axMapControl.Object); //run the tool command.OnClick();
However, I can't seem to find a tool class object that corresponds to this behavior. In this example ControlsNetworkAnalystSolveCommand class is the hook to the same behavior that happens when you click the solve route button in ArcMap. I'm looking for that same hook for the scenario described above.
Note that I found the tools by looking at the customize menu dialog. They are in the commands tab, in the editor category. The specific command is called Point and the description says, "Creates a point sketch geometry".