日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

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

發布時間:2025/5/22 编程问答 21 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Map 3D 2013中的AcMapMap.GroupModified 和AcMapMap.LayerModified 事件的参数变化 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

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 事件的参数变化的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。