ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Editing.Attributes Namespace / Inspector Class / Shape Property
Example

In This Topic
    Shape Property (Inspector)
    In This Topic
    Gets or sets the geometry (shape) of objects within the inspector.
    Syntax
    Public Property Shape As Geometry
    public Geometry Shape {get; set;}
    Remarks
    If multiple features are loaded into the inspector, getting the shape returns null. A shape can be set for multiple features.
    Example
    Get selected feature's attribute value
    // Retrieves the value of a specific attribute and the geometry of the first selected feature from the provided selection set.
    await QueuedTask.Run(() =>
    {
      // 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 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;
    });
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also