I am creating a tool for ArcGIS Desktop that will execute a command when I click a place on the map.
The Code looks like this:
public class TileLasLoader_Tool : ESRI.ArcGIS.Desktop.AddIns.Tool{ private static EsriTools.Forms.TileLasLoader_Form _form; ICommandItem _previousCommand = null; public TileLasLoader_Tool() { _form = EsriTools.Forms.TileLasLoader_Form.instance; } protected override void OnUpdate() { } protected override void OnMouseDown(MouseEventArgs arg) { base.OnMouseDown(arg); if (arg.Button == MouseButtons.Left) { _form.LoadLasFile(arg.X, arg.Y); ArcMap.Application.CurrentTool = _previousCommand; } }My Only problem is getting the tool to revert back to the previous "Command Item" that it was before I used the tool. If it was not using a tool I would just make it null so it reverts back to the windows mouse cursor.
أكثر...
The Code looks like this:
public class TileLasLoader_Tool : ESRI.ArcGIS.Desktop.AddIns.Tool{ private static EsriTools.Forms.TileLasLoader_Form _form; ICommandItem _previousCommand = null; public TileLasLoader_Tool() { _form = EsriTools.Forms.TileLasLoader_Form.instance; } protected override void OnUpdate() { } protected override void OnMouseDown(MouseEventArgs arg) { base.OnMouseDown(arg); if (arg.Button == MouseButtons.Left) { _form.LoadLasFile(arg.X, arg.Y); ArcMap.Application.CurrentTool = _previousCommand; } }My Only problem is getting the tool to revert back to the previous "Command Item" that it was before I used the tool. If it was not using a tool I would just make it null so it reverts back to the windows mouse cursor.
أكثر...