• ArcGIS Pro批量线分割面,也可以线分割线


    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;
    
    namespace TKPrint
    {
        internal class MapTool1 : MapTool
        {
            public MapTool1()
            {
                IsSketchTool = true;
                SketchType = SketchGeometryType.Line;
                SketchOutputMode = SketchOutputMode.Map;
            }
    
            protected override Task OnToolActivateAsync(bool active)
            {
                return base.OnToolActivateAsync(active);
            }
    
            protected override Task<bool> OnSketchCompleteAsync(Geometry geometry)
            {
                QueuedTask.Run(() =>
                {
                  
                    
                    //Delete all the selected features in the active view
                    //Select using a polygon (for example)
                    var selection = MapView.Active.SelectFeatures(geometry).Select(
                          k => new KeyValuePair<MapMember, List<long>>(k.Key as MapMember, k.Value));
                    foreach (var a in selection)
                    {
                        Layer featureLayer = a.Key as Layer;
                        foreach (var id in a.Value)
                        {
                            var deleteFeatures = new EditOperation();
                            deleteFeatures.Name = "Delete Features";
    
                            deleteFeatures.ShowProgressor = true;
                            deleteFeatures.EditOperationType = EditOperationType.Long;
                            deleteFeatures.Cut(featureLayer, id, geometry);
      //deleteFeatures.Split(featureLayer, id, geometry); deleteFeatures.ExecuteAsync(); } }
    //deleteFeatures.Delete(selection); //Execute to execute the operation //Must be called within QueuedTask.Run }); return base.OnSketchCompleteAsync(geometry); } } }
  • 相关阅读:
    C语言之逻辑运算符
    iOS:实现图片的无限轮播---之使用第三方库SDCycleScrollView
    Mac 环境下svn服务器的配置
    ld: warning: directory not found for option 去掉警告的方法
    Mac怎么设置wifi热点
    如何获取AppStore软件安装包的路径
    四种卸载Mac软件的方法
    UIAlertController
    uiview关联xib
    OC学习篇之---文件的操作
  • 原文地址:https://www.cnblogs.com/gisoracle/p/12573039.html
Copyright © 2020-2023  润新知