• 大小: 787KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-09
  • 语言: 其他
  • 标签: ArcGIS  Deskt  Addin  

资源简介

ArcMap拓展开发实习指导书,基于ArcGIS 10.1版本,包含AddinTest源码工程

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.Display;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.esriSystem;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using ESRI.ArcGIS.DataSourcesGDB;
using ESRI.ArcGIS.DataSourcesFile;
using ESRI.ArcGIS.ADF;

namespace AddinTest
{
    public class AddinTest : ESRI.ArcGIS.Desktop.AddIns.Button
    {
        private IWorkspace pWs = null;
        private IMap pMap = null;
        private string strConfigTablePath = @“C:\Users\zh\Desktop\地图分版合版测试数据\DbConfig.gdb“;
        private Dictionary> dicConvertMappingInfo = new Dictionary>();
        public AddinTest()
        {
            pMap = ArcMap.Document.FocusMap;


            pWs = CommonAPI.OpenGeodatabase(strConfigTablePath);

            dicConvertMappingInfo = CommonAPI.intialMappInfo(pWs strConfigTablePath);
        }

        protected override void onclick()
        {
            //
            //  TODO: Sample code showing how to access button host
            //
            ArcMap.Application.CurrentTool = null;

            //喷绘转出版
            ConvertToType convertToType = ConvertToType.ChuBan;

            foreach (KeyValuePair> pValuerPair in dicConvertMappingInfo)
            {
                string strlayerName = pValuerPair.Key.Substring(0 pValuerPair.Key.LastIndexOf(‘_‘));
                string strJBCode = pValuerPair.Key.Substring(pValuerPair.Key.LastIndexOf(‘_‘) + 1);
                List plistMappingInfo= pValuerPair.Value as List;

                ilayer pLyr = CommonAPI.Getlayer(pMap strlayerName);
                if (pLyr != null)
                {
                    UpdateRepColor(pLyr strJBCode plistMappingInfo convertToType);
                }
            }
            MessageBox.Show(“转换完成!“ “提示“);
            //for (int i = 0; i < pMap.layerCount; i++)
            //{
            //    ilayer pLyr = pMap.get_layer(i);
            //    UpdateRepColor(pLyr);
            //}
        }

        private void UpdateRepColor(ilayer pLyr string JBConde List plistMappingInfo ConvertToType convertToType)
        {
            IWorkspaceEdit2 pWsEdit = pWs as IWorkspaceEdit2;

            try
            {
                IFeatureCursor pFeaCursor = (pLyr as IFeaturelayer).FeatureClass.Update(null false);
                IFeature pFea = null;

                //开启编辑会话
                WorkspaceAPI.StartWorkspaceEdit(pWs);
                pWsEdit.StartEditOperation();
                while ((pFea = pFeaCursor.NextFeature()) != null)
                {
                    IRepresentation pRepresentation = CommonAPI.getRepresentation(pLyr ArcMap.Document.ActivatedView 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       9942  2017-09-14 17:07  ArcMap扩展开发\AddinTest\AddinTest\AddinTest.cs

     文件       8214  2017-09-14 17:07  ArcMap扩展开发\AddinTest\AddinTest\AddinTest.csproj

     文件        916  2017-08-30 09:34  ArcMap扩展开发\AddinTest\AddinTest\AddinTest.csproj.user

     文件      18944  2017-09-14 17:14  ArcMap扩展开发\AddinTest\AddinTest\bin\Debug\AddinTest.dll

     文件      43185  2017-09-14 17:14  ArcMap扩展开发\AddinTest\AddinTest\bin\Debug\AddinTest.esriAddIn

     文件      48640  2017-09-14 17:14  ArcMap扩展开发\AddinTest\AddinTest\bin\Debug\AddinTest.pdb

     文件      32768  2014-02-13 20:40  ArcMap扩展开发\AddinTest\AddinTest\bin\Debug\ESRI.ArcGIS.ADF.Connection.Local.dll

     文件      26300  2009-07-14 08:55  ArcMap扩展开发\AddinTest\AddinTest\bin\Debug\ESRI.ArcGIS.ADF.Connection.Local.xml

     文件      10111  2017-09-14 17:07  ArcMap扩展开发\AddinTest\AddinTest\CommonAPI.cs

     文件      10968  2017-08-30 15:36  ArcMap扩展开发\AddinTest\AddinTest\Config.Designer.cs

     文件        791  2017-08-30 15:36  ArcMap扩展开发\AddinTest\AddinTest\Config.esriaddinx

     文件       2472  2017-08-31 11:14  ArcMap扩展开发\AddinTest\AddinTest\CovertMappingInfo.cs

     文件       1453  2017-08-30 09:34  ArcMap扩展开发\AddinTest\AddinTest\Images\AddinTest.png

     文件       8045  2017-08-30 09:34  ArcMap扩展开发\AddinTest\AddinTest\Images\AddinTest_1.png

     文件       1395  2017-08-31 19:13  ArcMap扩展开发\AddinTest\AddinTest\LogManage.cs

     文件       1022  2017-09-14 17:14  ArcMap扩展开发\AddinTest\AddinTest\obj\Debug\AddinTest.csproj.FileListAbsolute.txt

     文件      18944  2017-09-14 17:14  ArcMap扩展开发\AddinTest\AddinTest\obj\Debug\AddinTest.dll

     文件      48640  2017-09-14 17:14  ArcMap扩展开发\AddinTest\AddinTest\obj\Debug\AddinTest.pdb

     文件       6857  2017-09-14 17:14  ArcMap扩展开发\AddinTest\AddinTest\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件         40  2017-09-14 17:14  ArcMap扩展开发\AddinTest\AddinTest\obj\Debug\esriAddIn\AddInID.txt

     文件       1448  2017-08-30 09:34  ArcMap扩展开发\AddinTest\AddinTest\Properties\AssemblyInfo.cs

     文件       1911  2017-08-31 17:24  ArcMap扩展开发\AddinTest\AddinTest\WorkspaceAPI.cs

     文件       1401  2017-09-14 17:20  ArcMap扩展开发\AddinTest\AddinTest.sln

    ..A..H.     79360  2017-09-14 18:05  ArcMap扩展开发\AddinTest\AddinTest.suo

     文件      18944  2017-09-14 17:52  ArcMap扩展开发\AddinTest\JBMapPrint\bin\Debug\JBMapPrint.dll

     文件      52023  2017-09-14 17:52  ArcMap扩展开发\AddinTest\JBMapPrint\bin\Debug\JBMapPrint.esriAddIn

     文件      48640  2017-09-14 17:52  ArcMap扩展开发\AddinTest\JBMapPrint\bin\Debug\JBMapPrint.pdb

     文件      10057  2017-09-14 18:05  ArcMap扩展开发\AddinTest\JBMapPrint\CommonAPI.cs

     文件      11020  2017-09-14 17:29  ArcMap扩展开发\AddinTest\JBMapPrint\Config.Designer.cs

     文件        840  2017-09-14 17:29  ArcMap扩展开发\AddinTest\JBMapPrint\Config.esriaddinx

............此处省略42个文件信息

评论

共有 条评论