public void SetToolActiveInToolBar(ESRI.ArcGIS.Framework.IApplication application, System.String toolName) { ESRI.ArcGIS.Framework.ICommandBars commandBars = application.Document.CommandBars; ESRI.ArcGIS.esriSystem.UID commandID = new ESRI.ArcGIS.esriSystem.UIDClass(); commandID.Value = toolName; // example: "esriArcMapUI.ZoomInTool"; ESRI.ArcGIS.Framework.ICommandItem commandItem = commandBars.Find(commandID, false, false); if (commandItem != null) { application.CurrentTool = commandItem; } }
/// <summary> /// Returns the editor /// </summary> /// <param name="mxApplication"></param> /// <returns>the editor</returns> public IEditor3 GetEditorFromArcMap(IMxApplication mxApplication) { if (mxApplication == null) { return(null); } ESRI.ArcGIS.esriSystem.UID uid = new ESRI.ArcGIS.esriSystem.UIDClass(); uid.Value = "{F8842F20-BB23-11D0-802B-0000F8037368}"; ESRI.ArcGIS.Framework.IApplication application = mxApplication as ESRI.ArcGIS.Framework.IApplication; // Dynamic Cast ESRI.ArcGIS.esriSystem.IExtension extension = application.FindExtensionByCLSID(uid); ESRI.ArcGIS.Editor.IEditor3 editor3 = extension as ESRI.ArcGIS.Editor.IEditor3; // Dynamic Cast return(editor3); }
/// <summary> /// Execute the Selection Tool /// </summary> public void ExecuteSelectionTool() { ESRI.ArcGIS.Framework.IApplication app = this.Hook as ESRI.ArcGIS.Framework.IApplication; // TODO: Handle Engine where the hook is a mapcontrol or toolbar control if (null != app) { ESRI.ArcGIS.esriSystem.UID uid = new ESRI.ArcGIS.esriSystem.UID(); uid.Value = "esriControls.SelectFeaturesTool"; ESRI.ArcGIS.Framework.ICommandItem selectCommand = app.Document.CommandBars.Find(uid, false, false); if (null != selectCommand) { selectCommand.Execute(); } } }
public DigitTool() { m_app = ArcMap.Application; }
public void FrmApplication(ESRI.ArcGIS.Framework.IApplication app) { m_app = app; return; }
public DigitTool() { m_app = ArcMap.Application; }
/// <summary> /// this is the first initialization code which binds to ArcMap objects and events /// </summary> public void InitArcMapBindings(ESRI.ArcGIS.Framework.IApplication application) { if (m_IsInitArcMapBindings) return; //reference ArcMap globals m_Application = application; m_MxDoc = (ESRI.ArcGIS.ArcMapUI.IMxDocument)m_Application.Document; //wireup ArcMap events WireDocumentEvents(m_Application.Document); m_IsInitArcMapBindings = true; }