ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / ParcelLayer Class
Members Example

In This Topic
    ParcelLayer Class
    In This Topic
    Represents a parcel fabric composite layer.
    Object Model
    ParcelLayer ClassLayer ClassCIMDataConnection ClassCIMBaseLayer ClassSpatialReference ClassMap ClassILayerContainer InterfaceEnvelope Class
    Syntax
    Remarks
    The parcel layer is a composite layer that is a representation of the parcel fabric controller dataset. The parcel layer contains the records. See ArcGIS.Core.CIM.CIMParcelLayer.
    Example
    Get the active record
    string errorMessage = await QueuedTask.Run(() =>
    {
      try
      {
        var myParcelFabricLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<ParcelLayer>().FirstOrDefault();
        //if there is no fabric in the map then bail
        if (myParcelFabricLayer == null)
          return "There is no fabric in the map.";
        var theActiveRecord = myParcelFabricLayer.GetActiveRecord();
        if (theActiveRecord == null)
          return "There is no Active Record. Please set the active record and try again.";
      }
      catch (Exception ex)
      {
        return ex.Message;
      }
      return "";
    });
    if (!string.IsNullOrEmpty(errorMessage))
      MessageBox.Show(errorMessage, "Get Active Record.");
    Set the active record
    string errorMessage = await QueuedTask.Run(async () =>
    {
      try
      {
        string sExistingRecord = "MyRecordName";
        var myParcelFabricLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<ParcelLayer>().FirstOrDefault();
        //if there is no fabric in the map then bail
        if (myParcelFabricLayer == null)
          return "There is no fabric in the map.";
    
        bool bSuccess = await myParcelFabricLayer.SetActiveRecordAsync(sExistingRecord);
        if (!bSuccess)
          return "No record called " + sExistingRecord + " was found.";
      }
      catch (Exception ex)
      {
        return ex.Message;
      }
      return "";
    });
    if (!string.IsNullOrEmpty(errorMessage))
      MessageBox.Show(errorMessage, "Set Active Record.");
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.Framework.Contracts.PropertyChangedBase
          ArcGIS.Desktop.Mapping.MapMember
             ArcGIS.Desktop.Mapping.Layer
                ArcGIS.Desktop.Mapping.CompositeLayer
                   ArcGIS.Desktop.Mapping.ParcelLayer

    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also