ArcGIS Pro 3.7 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 ClassTimeExtent ClassCIMBaseLayer ClassElevationTypeDefinition ClassSpatialReference ClassTimeParameters ClassSurfaceZsResult 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
    Add a Parcel Layer to the map
    string path = @"C:\MyTestData\MyFileGeodatabase.gdb\MyFeatureDS\MyFabric";
    await QueuedTask.Run(() =>
    {
      var lyrCreateParams = new ParcelLayerCreationParams(new Uri(path));
      try
      {
        var parcelLayer = LayerFactory.Instance.CreateLayer<ParcelLayer>(
          lyrCreateParams, MapView.Active.Map);
      }
      catch (Exception ex)
      {
        MessageBox.Show(ex.Message, "Add Parcel Fabric Layer");
      }
    });
    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 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also