• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

gisoracle

  • 博客园
  • 联系
  • 订阅
  • 管理

公告

View Post

arcgis pro 开发——调用现有命令进行执行操作(转)

来自:https://blog.csdn.net/laoqiao520/article/details/123681163

添加按钮:

<group id="MyFavoriteGroupOfTools" caption="My Favorite Tools" appearsOnAddInTab="false">       <button refID="esri_editing_ShowAttributes" size="small"/>  

    <button refID="esri_mapping_clearSelectionButton" size="small"/>  

</group>  

代码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ArcGIS.Core.CIM;
using ArcGIS.Core.Data;
using ArcGIS.Core.Geometry;
using ArcGIS.Desktop.Catalog;
using ArcGIS.Desktop.Core;
using ArcGIS.Desktop.Editing;
using ArcGIS.Desktop.Extensions;
using ArcGIS.Desktop.Framework;
using ArcGIS.Desktop.Framework.Contracts;
using ArcGIS.Desktop.Framework.Dialogs;
using ArcGIS.Desktop.Framework.Threading.Tasks;
using ArcGIS.Desktop.Mapping;

using System.Windows;

using System.Windows.Input;


using System.Windows.Media;

using System.Windows.Media.Imaging;


using ArcGIS.Desktop.Core.Events;

using ArcGIS.Core.Events;

using ArcGIS.Desktop.Mapping.Events;

namespace ylsetpro
{
    internal class btnAddData : Button
    {
        protected override void OnClick()
        {

            // FrameworkApplication.Close();

            IPlugInWrapper wrapper = FrameworkApplication.GetPlugInWrapper("esri_editing_ShowAttributes");

            var command = wrapper as ICommand; // tool and command(Button) supports this

            if ((command != null) && command.CanExecute(null))

                command.Execute(null);
        }
    }
}

常用命令代码:

esri_core_editDeleteButton   删除

esri_core_exitApplicationButton 退出

esri_core_previewZoomFullButton 全图

esri_core_previewZoomToSelectionButton 缩放到选择

esri_core_refresh   刷新

esri_core_saveProjectButton 保存

esri_core_showProjectDockPane 显示catalog面版

esri_folderConnectionAddButton  添加连接

esri_folderConnectionRemoveButton 移除连接

esri_mapping_addDataButton  添加数据

esri_mapping_clearLayerSelectionButton 清除选择

esri_mapping_fixedZoomInButton 固定放大

esri_mapping_fixedZoomOutButton 固定缩小

esri_mapping_gotoXYControl      gotoxy

esri_mapping_zoomToLayerSelectionButton 缩放到选择

esri_mapping_zoomToSelectedLayersButton 缩放到图层

esri_projectItemAddToNewMapButton   一个新地图窗口

esri_layouts_projectContainer_NewLayout 一个新的布局

参考地址:

所有的ID https://github.com/Esri/arcgis-pro-sdk/wiki/DAML-ID-Reference-ADCore.daml

https://github.com/Esri/arcgis-pro-sdk/wiki/DAML-ID-Reference-ADCore.daml
————————————————
版权声明:本文为CSDN博主「laoqiao520」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/laoqiao520/article/details/123681163

posted on 2022-04-11 09:47  gisai  阅读(148)  评论(0)    收藏  举报

刷新页面返回顶部
 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3