一、'获取当前图层FeatureLayer选择要素: ly选择要素
Dim selSet As Selection = ly.GetSelection()
二、获取当前激活的地图选择要素集: 不同层的所有的选择要素
Dim selSet As SelectionSet = ArcGIS.Desktop.Mapping.MapView.Active.Map.GetSelection()
三、用例
Map:获取地图的选择。 必须在 MCT 上调用此方法。使用 QueuedTask.Run
1、将地图选择加载到 Inspector 中
c+
// 获取地图中的当前所选要素
var selectedFeatures = ArcGIS.Desktop.Mapping.MapView.Active.Map.GetSelection();
// 获取第一个图层及其对应的所选要素OID
var firstSelectionSet = selectedFeatures.ToDictionary().First();
// 创建检查器类的实例
var inspector = new ArcGIS.Desktop.Editing.Attributes.Inspector();
// 使用对象ID列表将所选要素加载到检查器中
await inspector.LoadAsync(firstSelectionSet.Key, firstSelectionSet.Value);
vb :将地图选择加载到 Inspector 中
'获取当前地图选择要素
Dim selSet As SelectionSet = ArcGIS.Desktop.Mapping.MapView.Active.Map.GetSelection()
'获取第一个图层及其对应的所选要素OID
Dim firstSelectionSet = selSet.T