public Dictionary<MapMember,List<long>> ToDictionary()
Public Overloads Function ToDictionary() As Dictionary(Of MapMember,List(Of Long))
Return Value
Dictionary of mapMembers and their corresponding objectIDs.
public Dictionary<MapMember,List<long>> ToDictionary()
Public Overloads Function ToDictionary() As Dictionary(Of MapMember,List(Of Long))
// get the currently selected features in the map var selectedFeatures = ArcGIS.Desktop.Mapping.MapView.Active.Map.GetSelection(); // get the first layer and its corresponding selected feature OIDs var firstSelectionSet = selectedFeatures.ToDictionary().First(); // create an instance of the inspector class var inspector = new ArcGIS.Desktop.Editing.Attributes.Inspector(); // load the selected features into the inspector using a list of object IDs await inspector.LoadAsync(firstSelectionSet.Key, firstSelectionSet.Value);
// get the currently selected features in the map var selectedFeatures = ArcGIS.Desktop.Mapping.MapView.Active.Map.GetSelection(); // get the first layer and its corresponding selected feature OIDs var firstSelectionSet = selectedFeatures.ToDictionary().First(); // create an instance of the inspector class var inspector = new ArcGIS.Desktop.Editing.Attributes.Inspector(); // load the selected features into the inspector using a list of object IDs await inspector.LoadAsync(firstSelectionSet.Key, firstSelectionSet.Value);
QueuedTask.Run(() => { // get the currently selected features in the map var selectedFeatures = ArcGIS.Desktop.Mapping.MapView.Active.Map.GetSelection(); // get the first layer and its corresponding selected feature OIDs var firstSelectionSet = selectedFeatures.ToDictionary().First(); // create an instance of the inspector class var inspector = new ArcGIS.Desktop.Editing.Attributes.Inspector(); // load the selected features into the inspector using a list of object IDs inspector.Load(firstSelectionSet.Key, firstSelectionSet.Value); //get the value of var pscode = inspector["STATE_NAME"]; var myGeometry = inspector.Shape; });
QueuedTask.Run(() => { // get the currently selected features in the map var selectedFeatures = ArcGIS.Desktop.Mapping.MapView.Active.Map.GetSelection(); // get the first layer and its corresponding selected feature OIDs var firstSelectionSet = selectedFeatures.ToDictionary().First(); // create an instance of the inspector class var inspector = new ArcGIS.Desktop.Editing.Attributes.Inspector(); // load the selected features into the inspector using a list of object IDs inspector.Load(firstSelectionSet.Key, firstSelectionSet.Value); //get the value of var pscode = inspector["STATE_NAME"]; var myGeometry = inspector.Shape; });
await QueuedTask.Run(() => { MapMemberIDSet rootNodes = MapView.Active.GetRootNodes(); var rootNodeDict = rootNodes.ToDictionary(); // rootNodeDict is a Dictionary<MapMember, List<long>> // access a particular mapMember in the Dictionary if (rootNodeDict.ContainsKey(mapMember)) { var oids = rootNodeDict[mapMember]; } // OR iterate through the dictionary foreach (var (mm, oids) in rootNodeDict) { // do something } });
Target Platforms: Windows 11, Windows 10