⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 新建 文本文档.txt

📁 ao的一些代码集合
💻 TXT
字号:
'选择要素
Sub SelectFeatures()

  Dim mxDoc As IMxDocument    '地图文档
  Dim lyr As IFeatureLayer    '要素层
  Dim sel As IFeatureSelection    '选择集
  Dim filter As IQueryFilter    '查询过滤器
  Dim selEvents As ISelectionEvents    '???

  Set mxDoc = Application.Document    '获取当前地图文档
  Set lyr = FindLayer(mxDoc.FocusMap, "BUILDING")    '调用FindLayer函数查找图层
  Set sel = lyr    '将找到的图层设为选择集
  Set filter = New QueryFilter    '创建查询过滤器
  filter.WhereClause = "BDNAME ='实验楼A'"    '设置where子句
  sel.SelectFeatures filter, esriSelectionResultNew, False    '选中满足条件的要素
  mxDoc.ActiveView.PartialRefresh esriViewGeoSelection, Nothing, Nothing    '绘出选中的要素
  Set selEvents = mxDoc.FocusMap    '???
  selEvents.SelectionChanged    '通知系统选择已经改变了

End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -