ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / ParcelFabricExtensions Class / GetParcelFabric Method
The parcel layer.
Example

In This Topic
    GetParcelFabric Method
    In This Topic
    Gets the parcel fabric for the input parcel layer.
    Syntax
    public static ParcelFabric GetParcelFabric( 
       ParcelLayer parcelLayer
    )
    Public Shared Function GetParcelFabric( _
       ByVal parcelLayer As ParcelLayer _
    ) As ParcelFabric

    Parameters

    parcelLayer
    The parcel layer.

    Return Value

    Exceptions
    ExceptionDescription
    Insufficient license. This method requires a standard license.
    Example
    Get parcel fabric dataset controller from parcel layer
    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 myParcelFabricDataset = myParcelFabricLayer.GetParcelFabric();
      }
      catch (Exception ex)
      {
        return ex.Message;
      }
      return "";
    });
    if (!string.IsNullOrEmpty(errorMessage))
      MessageBox.Show(errorMessage, "Get Parcel Fabric Dataset from layer.");
    Get parcel topology of parcel fabric dataset
    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 myParcelFabricDataset = myParcelFabricLayer.GetParcelFabric();
        var myTopology = myParcelFabricDataset.GetParcelTopology();
      }
      catch (Exception ex)
      {
        return ex.Message;
      }
      return "";
    });
    if (!string.IsNullOrEmpty(errorMessage))
      MessageBox.Show(errorMessage, "Get Parcel Fabric Topology.");
    Get point, connection, and record feature classes from the parcel fabric dataset
    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 myParcelFabricDataset = myParcelFabricLayer.GetParcelFabric();
        FeatureClass myPointsFC = myParcelFabricDataset.GetSystemTable(SystemTableType.Points) as FeatureClass;
        FeatureClass myCoonectionsFC = myParcelFabricDataset.GetSystemTable(SystemTableType.Connections) as FeatureClass;
        FeatureClass myRecordsFC = myParcelFabricDataset.GetSystemTable(SystemTableType.Records) as FeatureClass;
      }
      catch (Exception ex)
      {
        return ex.Message;
      }
      return "";
    });
    if (!string.IsNullOrEmpty(errorMessage))
      MessageBox.Show(errorMessage, "Get point, connection, and record feature classes.");
    Get parcel type feature classes from the parcel fabric dataset
    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.";
        string myParcelTypeName = "Tax";
        var myParcelFabricDataset = myParcelFabricLayer.GetParcelFabric();
        var typeInfo = myParcelFabricDataset.GetParcelTypeInfo();
        FeatureClass lineFCType = null;
        FeatureClass polyFCType = null;
        foreach (var info in typeInfo)
        {
          if (info.Name.ToLower() == myParcelTypeName.ToLower())
          {
            lineFCType = info.LineFeatureTable as FeatureClass;
            polyFCType = info.PolygonFeatureTable as FeatureClass;
            break;
          }
        }
      }
      catch (Exception ex)
      {
        return ex.Message;
      }
      return "";
    });
    if (!string.IsNullOrEmpty(errorMessage))
      MessageBox.Show(errorMessage, "Get Parcel Type feature classes.");
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also