欢迎您来到GIS动力

加入收藏 免费注册 用户登陆 帮助中心
首页 新闻动态 技术专栏 银杏树下 学习考研 软件下载 求职招聘 许愿瓶 节日祝福 用户中心 精彩推荐 资源搜索 地图
专栏导航: AO开发 | SO开发 | ArcGIS桌面 | 超图桌面 | 开发语言 | 数据库 | WebGIS | 银杏文学 | 研究生考题 | FreeMap FreeTalk
   您现在位于: 首页技术专栏ArcGIS应用与开发AO开发 → 正文
在AE中取得选择要素的方法
07-08-09 19:33:01 作者:gispower 出处:

1、使用IEnumFeature对象获取map中的FeatureSelection,该方法可以获取所有图层的选择要素

Dim m_pMap as Imap

Set m_pMap=Mapcontrol1.Map

    Dim pEnumFeature As IEnumFeature

    Set pEnumFeature = m_pMap.FeatureSelection

Dim pfeat As IFeature

Set pfeat = pEnumFeature.Next

Do while not pfeat is nothing

       ‘opera

       Set pfeat=pEnumFeature.Next

Loop

 

2、使用ISelectionSetIEnumIDsFeatureClass.GetFeature()方法获取某个图层中的选择要素

Dim lyr2 As IFeatureLayer

Set lyr2 = MapControl1.Layer(1)

Dim selection As IFeatureSelection

Set selection = lyr2

Dim psel As ISelectionSet

Set psel = selection.SelectionSet

Dim lID As Long

Dim pEnumIDs As IEnumIDs

Set pEnumIDs = psel.IDs

Dim s As String

Dim pFeature As IFeature

lID = pEnumIDs.Next

Do

Set pFeature = lyr2.FeatureClass.GetFeature(lID)

‘opera

lID = pEnumIDs.Next

Loop Until lID = -1 '-1 is returned after last valid ID has been reached


(本文已被浏览 次)
发布人:
推荐给好友:发送给好友
上篇新闻:
下篇新闻:
相关评论
发表我的评论
  • 尊重网上道德,遵守《全国人大常委会关于维护互联网安全的决定》及中华人民共和国其他各项有关法律法;
  • 本站有权保留或删除您发表的任何评论内容;
  •   相关文章  

    关于我们友情链接 ┋ 与我在线 ┋ 管理 ┋ TOP
     
    网站当前版本:GisPower CMS V3.0
    『GIS 动力』- http://www.gispower.org/
    联系我们:webmaster#gispower.org
    Copyright (c) 2003-2007 GisPOwer.Org. All Rights Reserved.
     

                   滇ICP备05006901号