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

添加按钮:

<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

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

laoqiao520

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值