zoukankan      html  css  js  c++  java
  • ArcGIS AddIN 与ArcMap自带工具进行交互

    参考示例代码:C:Program Files (x86)ArcGISDeveloperKit10.1SamplesArcObjectsNetBrushing

    核心代码:

    //获取Select Tool工具
        Type oType = Type.GetTypeFromProgID("esriArcMapUI.SelectTool");
          if (oType != null)
          {
            m_gSelectTool = Activator.CreateInstance(oType);
          }
    
          // create and initialize SelectTool command
          ICommand pCommand;
          pCommand = (ICommand)m_gSelectTool;
          pCommand.OnCreate(ArcMap.Application);
    
          // emulate mouse click for m_gSelectTool
          ITool pTool;
          pTool = (ITool)m_gSelectTool;
        //当前工具的事件与Select Tool的事件绑定,其他事件中处理方式类似
          pTool.OnMouseDown(GetButtonCode(arg), Convert.ToInt32(arg.Shift), arg.X, arg.Y);
          pTool.OnMouseUp(GetButtonCode(arg), Convert.ToInt32(arg.Shift), arg.X, arg.Y);   
    
          m_bAction = SelectFromGraphics();
    
          // if there's selected graphics then start moving it
          if (m_bAction == true)
          {
            pTool.OnMouseDown(GetButtonCode(arg), Convert.ToInt32(arg.Shift), arg.X, arg.Y);  
          }
          else
          {
            m_gSelectTool = null;
          } 

    ProId查询方式:

    http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/ArcMap_commands/00010000029s000000/

    Name And Ids节点 如下图

           
  • 相关阅读:
    TensorFlow神经网络集成方案
    过滤节点
    获取子节点
    获取兄弟节点
    获取父节点
    遍历DOM树
    获取修改CSS
    获取修改元素属性
    获取修改value
    获取更新元素文本html()
  • 原文地址:https://www.cnblogs.com/DayDreamEveryWhere/p/7992331.html
Copyright © 2011-2022 走看看