ArcGIS Pro 3.1 API Reference Guide
ArcGIS.Desktop.Editing Namespace / EditOperation Class / CopyParcelLinesToParcelType Method / CopyParcelLinesToParcelType(ParcelLayer,SelectionSet,Layer,Layer,Boolean,Boolean,Boolean) Method
The parcel layer to add lines to.
The source layers and feature OIDs of parcel features.
Line layer that the editor listens to for database changes. This allows edit operations like SelectNewFeatures, SelectModifiedFeatures to act on feature changes.
The destination parcel layer type.
If parcels are within the same parceltype, then parent features have their historic attributes updated.
Use source line attributes when creating new parcel lines.
Use source polygon attributes when creating new parcel seeds.
Example

In This Topic
    CopyParcelLinesToParcelType(ParcelLayer,SelectionSet,Layer,Layer,Boolean,Boolean,Boolean) Method
    In This Topic
    Copy line feature to parcel type.
    Syntax

    Parameters

    parcelLayer
    The parcel layer to add lines to.
    sourceFeatures
    The source layers and feature OIDs of parcel features.
    destinationLineLayer
    Line layer that the editor listens to for database changes. This allows edit operations like SelectNewFeatures, SelectModifiedFeatures to act on feature changes.
    destinationPolygonLayer
    The destination parcel layer type.
    markParentsAsHistoric
    If parcels are within the same parceltype, then parent features have their historic attributes updated.
    useSourceLineAttributes
    Use source line attributes when creating new parcel lines.
    useSourcePolygonAttributes
    Use source polygon attributes when creating new parcel seeds.
    Exceptions
    ExceptionDescription
    ParcelLayer, sourceFeatures, destinationLayer and destinationLines cannot be null.
    Insufficient license. This method requires a standard license.
    Example
    Copy parcel lines to a parcel type
     string errorMessage = await QueuedTask.Run(async () =>
    {
       // check for selected layer
       if (MapView.Active.GetSelectedLayers().Count == 0)
        return "Please select a source parcel polygon feature layer in the table of contents.";
      try
      {
        var myParcelFabricLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<ParcelLayer>().FirstOrDefault();
        if (myParcelFabricLayer == null)
          return "No parcel layer found in the map.";
    
         //get the feature layer that's selected in the table of contents
         var srcParcelFeatLyr = MapView.Active.GetSelectedLayers().OfType<FeatureLayer>().FirstOrDefault();
        string sTargetParcelType = "Tax";
        var destLineLEnum = await myParcelFabricLayer.GetParcelLineLayerByTypeNameAsync(sTargetParcelType);
        if (destLineLEnum.Count() == 0)
          return "";
        var destLineL = destLineLEnum.FirstOrDefault();
        var destPolygonLEnum = await myParcelFabricLayer.GetParcelPolygonLayerByTypeNameAsync(sTargetParcelType);
        if (destPolygonLEnum.Count() == 0)
          return "";
        var destPolygonL = destPolygonLEnum.FirstOrDefault();
        if (destLineL == null || destPolygonL == null)
          return "";
        var theActiveRecord = myParcelFabricLayer.GetActiveRecord();
        if (theActiveRecord == null)
          return "There is no Active Record. Please set the active record and try again.";
        var editOper = new EditOperation()
        {
          Name = "Copy Lines To Parcel Type",
          ProgressMessage = "Copy Lines To Parcel Type ...",
          ShowModalMessageAfterFailure = true,
          SelectNewFeatures = true,
          SelectModifiedFeatures = false
        };
        var ids = new List<long>(srcParcelFeatLyr.GetSelection().GetObjectIDs());
        if (ids.Count == 0)
          return "No selected parcels found. Please select parcels and try again.";
         //add the standard feature line layers source, and their feature ids to a new Dictionary
         var sourceParcelFeatures = new Dictionary<MapMember, List<long>>();
        sourceParcelFeatures.Add(srcParcelFeatLyr, ids);
        editOper.CopyParcelLinesToParcelType(myParcelFabricLayer, SelectionSet.FromDictionary(sourceParcelFeatures), destLineL, destPolygonL, true, false, true);
        if (!editOper.Execute())
          return editOper.ErrorMessage;
      }
      catch (Exception ex)
      {
        return ex.Message;
      }
      return "";
    });
     if (!string.IsNullOrEmpty(errorMessage))
       MessageBox.Show(errorMessage, "Copy Parcel Lines To Parcel Type.");
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.0 or higher.
    See Also