ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Desktop.Editing Namespace / ParallelOffset.Builder Class / AlignConnected Property
Example

In This Topic
    AlignConnected Property (ParallelOffset.Builder)
    In This Topic
    Gets and sets If two or more connected lines should have their direction temporarily aligned for the purposes of the copy. (Default value = false)
    Syntax
    public bool AlignConnected {get; set;}
    Public Property AlignConnected As Boolean
    Remarks
    Use this setting to temporarily align the direction of connected lines in the selection to ensure the output features are created on a consistent side. The direction is random. This setting has no effect on disconnected lines.
    Example
    Edit Operation ParallelOffset
    // Creates parallel offset features from the selected features.
    var parallelOffsetMapView = MapView.Active;
    if (parallelOffsetMapView == null)
      return;
    
    await QueuedTask.Run(() =>
      {
        //Create parallel features from the selected features
    
        //find the roads layer
        var roadsLayer = parallelOffsetMapView.Map.FindLayers("Roads")?[0];
    
        //instantiate parallelOffset builder and set parameters
        var parOffsetBuilder = new ParallelOffset.Builder()
        {
          Selection = parallelOffsetMapView.Map.GetSelection(),
          Template = roadsLayer.GetTemplate("Freeway"),
          Distance = 200,
          Side = ParallelOffset.SideType.Both,
          Corner = ParallelOffset.CornerType.Mitered,
          Iterations = 1,
          AlignConnected = false,
          CopyToSeparateFeatures = false,
          RemoveSelfIntersectingLoops = true
        };
    
        //create EditOperation and execute
        var parallelOp = new EditOperation();
        parallelOp.Create(parOffsetBuilder);
        if (!parallelOp.IsEmpty)
        {
          var result = parallelOp.Execute(); //Execute and ExecuteAsync will return true if the operation was successful and false if not
        }
      });
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also