ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.Geometry Namespace / LineBuilderEx Class / SetCoords Method
The start point.
The end point.
Example

In This Topic
    SetCoords Method (LineBuilderEx)
    In This Topic
    Sets this builders start and end points to be startPoint and endPoint.
    Syntax
    public void SetCoords( 
       MapPoint startPoint,
       MapPoint endPoint
    )
    Public Sub SetCoords( _
       ByVal startPoint As MapPoint, _
       ByVal endPoint As MapPoint _
    ) 

    Parameters

    startPoint
    The start point.
    endPoint
    The end point.
    Exceptions
    ExceptionDescription
    startPoint or endPoint is null.
    Remarks
    If the start point and end point are identical, it creates a zero length line with the same start and end point.

    Line Segment

    Example
    Alter LineSegment Coordinates
    // builderEx constructors don't need to run on the MCT
    LineBuilderEx lbuilderEx = new LineBuilderEx(lineSegment);
    // find the existing coordinates
    lbuilderEx.QueryCoords(out startPt, out endPt);
    
    // or use 
    //startPt = lbuilderEx.StartPoint;
    //endPt = lbuilderEx.EndPoint;
    
    // update the coordinates
    lbuilderEx.SetCoords(GeometryEngine.Instance.Move(startPt, 10, 10) as MapPoint, GeometryEngine.Instance.Move(endPt, -10, -10) as MapPoint);
    
    // or use 
    //lbuilderEx.StartPoint = GeometryEngine.Instance.Move(startPt, 10, 10) as MapPoint;
    //lbuilderEx.EndPoint = GeometryEngine.Instance.Move(endPt, -10, -10) as MapPoint;
    
    LineSegment segment2 = lbuilderEx.ToSegment() as LineSegment;
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also