ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Desktop.Editing.Attributes Namespace / Inspector Class / Load Method / Load(MapMember,Int64) Method
mapMember
object ID
Example

In This Topic
    Load(MapMember,Int64) Method
    In This Topic
    Load a single feature into the inspector. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public void Load( 
       MapMember member,
       long oid
    )
    Public Overloads Sub Load( _
       ByVal member As MapMember, _
       ByVal oid As Long _
    ) 

    Parameters

    member
    mapMember
    oid
    object ID
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Example
    Get selected feature's attribute 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;
    });
    Read from a raster field
    QueuedTask.Run(() =>
    {
      var sel = MapView.Active.Map.GetSelection();
    
      //Read a raster from a raster field as an InteropBitmap
      //the bitmap can then be used as an imagesource or written to disk
      var insp = new ArcGIS.Desktop.Editing.Attributes.Inspector();
      insp.Load(sel.ToDictionary().Keys.First(), sel.ToDictionary().Values.First());
      var ibmp = insp["Photo"] as System.Windows.Interop.InteropBitmap;
    });
    Write an image to a raster field
    QueuedTask.Run(() =>
    {
      var sel = MapView.Active.Map.GetSelection();
    
      //Insert an image into a raster field
      //Image will be written with no compression
      var insp = new ArcGIS.Desktop.Editing.Attributes.Inspector();
      insp.Load(sel.ToDictionary().Keys.First(), sel.ToDictionary().Values.First());
      insp["Photo"] = @"e:\temp\Hydrant.jpg";
    
      var op = new EditOperation();
      op.Name = "Raster Inspector";
      op.Modify(insp);
      op.Execute();
    });
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also