By Daniel Du

在Map 3D Geospatial Platform API中,AcMapMap.GroupModified 和AcMapMap.LayerModified 事件的参数类型由AcMapMappingEventArgs 变成了AcMapMapObjectModifiedEventArgs. 这个变化主要是在参数中增加了一个Modification 属性。通过这个属性我们可以判断是什么东西发生了变化。Modification 可能的取值是:

/// <summary>

/// Name property changed during the event.

///</summary>

static const INT32 Name               = 1;

/// <summary>

/// Visibility changed during the event.

///</summary>

static const INT32 Visibility         = 2;

/// <summary>

/// Layer selectability during the event.

///</summary>

static const INT32 LayerSelectability = 4;

/// <summary>

/// Parent changed during the event.

///</summary>

static const INT32 ParentChanged      = 8;

下面是如何使用的示例代码:

[CommandMethod("ListenToLayerChange")]

public void ListenToLayerChange()

{

AcMapMap currentMap = AcMapMap.GetCurrentMap();

currentMap.GroupModified +=

new GroupModifiedHandler(currentMap_GroupModified);

currentMap.LayerModified +=

new LayerModifiedHandler(currentMap_LayerModified);

}

void currentMap_LayerModified(object sender,

AcMapMapObjectModifiedEventArgs args)

{

OutputChanges(args.Modification);

}

void currentMap_GroupModified(object sender,

AcMapMapObjectModifiedEventArgs args)

{

OutputChanges(args.Modification);

}

private static void OutputChanges(int modification)

{

Editor ed = Autodesk.AutoCAD.ApplicationServices.Application

.DocumentManager.MdiActiveDocument.Editor;

/ <summary>

/ Name property changed during the event.

/</summary>

//static const INT32 Name               = 1;

/ <summary>

/ Visibility changed during the event.

/</summary>

//static const INT32 Visibility         = 2;

/ <summary>

/ Layer selectability during the event.

/</summary>

//static const INT32 LayerSelectability = 4;

/ <summary>

/ Parent changed during the event.

/</summary>

//static const INT32 ParentChanged      = 8;

switch (modification)

{

case 1:

ed.WriteMessage("\n Layer or LayerGroup name is changed.");

break;

case 2:

ed.WriteMessage(" \nLayer or LayerGroup Visibility  is changed.");

break;

case 4:

ed.WriteMessage(" \nLayer or LayerGroup LayerSelectability is changed.");

break;

case 8:

ed.WriteMessage(" \nLayer or LayerGroup Parent is changed.");

break;

default:

break;

}

}

当我在任务面板里对图层或者图层组进行更改时,就可以收到哪些发生变化的提示信息。

when I change the name of layer in task pane of Map 3D, the LayerModified event is trigger, with “args.Modification”, I know that it is the layer’s name is changed. Similarly, when I turn on/off a layer, I get a notification of the changes of visibility of layer. And when I drag one layer from one layer group to another, I get a notification saying that the parent of layer is changed.

The result output is as below:

-------------------------------------

Command:
Command: netload
Command: LISTENTOLAYERCHANGE
Layer or LayerGroup name is changed.
Layer or LayerGroup Visibility  is changed
Layer or LayerGroup Parent is changed.
Command:

-------------------------------------

Hope this helps.

转载于:https://www.cnblogs.com/junqilian/archive/2012/07/18/2598002.html

Map 3D 2013中的AcMapMap.GroupModified 和AcMapMap.LayerModified 事件的参数变化相关推荐

  1. AutoCAD Map 3D 2013正式版发布

    AutoCAD Map 3D 2013版已经正式发布.困扰n多人的DWG到AIMS(或者说MapGuide)的问题在这个版本中得到了解决,在Map 3D中可以直接发布DWG文件到AIMS,不经过任何格 ...

  2. AutoCAD Map 3D 2013新功能视频中文版

    此版本的 AutoCAD Map 3D 包括以下新要素: 准备布局图纸以供公众查看 观看视频 (3:25) 将显示地图与视口关联. 使用"显示管理器"控制可见性. 为每个视口/地图 ...

  3. 在Map 3D显示管理器中更改当前地图的名字

    By Daniel Du 当前地图在显示管理器中默认的名字是"Default",如果你想通过程序更改地图的名字,可以用下面的代码来实现.你需要使用Display Manager A ...

  4. Map 3D API二次开发学习指南

    作者:杜长宇 – Autodesk开发技术顾问 2012年9月26日 AutoCAD Map 3D 是构建于AutoCAD之上,面向基础设施领域的产品,他采用FDO技术来实现对业界常见GIS数据格式的 ...

  5. Map 3D中通过程序删除图层及数据源

    在Map 3D中可以通过API来连接到SHP,Oracle等各种数据源,如果你对这个过程不熟悉,可以参考Map 3D ObjectARX SDK中的BuildMap示例,但BuildMap中没有演示如 ...

  6. AutoCAD Map 3D对ArcGIS shp文件的操作详解!

    在之前的一篇推文中,介绍了用AutoCAD Map 3D将多段线转换为shp格式线或面文件,实际上,AutoCAD Map 3D作为CAD和GIS的桥梁,它对GIS数据格式的操作远不止这些. 例如:A ...

  7. Map 3D中程序设置地图中心点

    你可能需要在Map 3D中通过程序把某块地图拉到屏幕中央来,下面通过程序的方式来实现这个功能. 这里有两种情况,如果你在Map 3D中通过Data Connect连接到了一下FDO数据源(SDF.SH ...

  8. AutoCAD 2013 .net插件创建向导现在支持Map 3D,Civil 3D,AutoCAD Architecture 和AutoCAD MEP...

    相信大家都用过AutoCAD .net插件创建向导了,这个向导可以帮助大家很方便的创建AutoCAD插件,而且可以实现在Visual Studio Express版中进行调试.现在这个向导升级到了对A ...

  9. AutoCAD 2011、Map 3D 2011, Civil 3D 2011命令行中不能输入中文的修复补丁

    问题描述 该修复补丁能够修复一个导致用户无法在AutoCAD® 2011产品的命令行窗口中输入亚洲字符的问题. 适用产品 AutoCAD® 2011 AutoCAD® Architecture 201 ...

最新文章

  1. 用silverlight做动画-相机
  2. 数据结构实践——队列数组
  3. 【Android 组件化】路由组件 ( 构造路由表中的路由信息 )
  4. block学习(一)
  5. NET问答: 如何集中化统一验证 Authorization
  6. 文件系统ext3的文件大小限制
  7. 用C#生成不重复的随机数
  8. SMI/慧荣/SM32**主控量产通用教程,PNY U盘量产!
  9. 【Android开发】之编译脚本Makefile编写
  10. Nginx源码分析 - 初探Nginx的架构(01)
  11. ffmpeg 简单教程
  12. 混沌大学--喜茶模式拷贝指南
  13. mysql 怎样更新数据库_MySQL数据库更新语句update使用详解
  14. 查询昌吉州二中2021年高考成绩,2017新疆、昌吉州文理状元分数出炉!昌吉州这所中学喜摘文理状元桂冠!...
  15. BZOJ3894:文理分科
  16. CSS高度自适应问题
  17. DC靶机系列------6
  18. mysQL uuID 查询
  19. Tesra超算网络,招募内测用户,可优先体验免费GPU算力!
  20. Linux 网络协议栈开发—— 二层桥实现原理

热门文章

  1. HDOJ1216 Assistance Required 打表
  2. 深入Java虚拟机:Class文件实例解析
  3. golang中的sync.Map
  4. golang中的strings.Contains
  5. 把二叉搜索树转换为累加树
  6. golang中string长度
  7. c++几种STL比较
  8. 如何将字符数组里的内容转换成uint8的类型?将一个字符数组里面的所有元素变成一个字符串?
  9. linux64平台上编译32位程序: GCC编译选项 -m64 -m32 -mx32
  10. JUC并发编程八 并发架构--ReentrantLock