ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Editing.COGO Namespace / COGOLine Class / Direction Property
Example

In This Topic
    Direction Property (COGOLine)
    In This Topic
    Gets the direction value. If IsStraightLine, then this is the direction of the line. If IsCircularArc, then this is the direction of the chord line, tangent or the radial.
    Syntax
    Public ReadOnly Property Direction As Nullable(Of Double)
    public Nullable<double> Direction {get;}
    Remarks
    The direction is in North Azimuth decimal degrees.
    Example
    Get COGOLine parameter information
    if (cogoLine.IsStraightLine)
    {
      var dist = cogoLine.Distance;
      var dir = cogoLine.Direction;
    }
    else if (cogoLine.IsCircularArc)
    {
      var circArcDefinition = cogoLine.ToCircularArcDefinition();
      string s = "";
    
      //show Arc length, either entered or calculated
      if (circArcDefinition.IsDefinedByArcLength) 
      {
        if (circArcDefinition.ArcLength.HasValue)
        {
          s += "<entered> Arc Length: " + circArcDefinition.ArcLength.Value.ToString("F3")
            + Environment.NewLine;
        }
      }
      else
      {
        if (circArcDefinition.CanCalculateArcLength())
        {
          s += "<calc> Arc Length: " + circArcDefinition.CalculateArcLength().ToString("F3")
               + Environment.NewLine;
        }
        else
          s += "<calc> not able to calc arc length." + Environment.NewLine;
      }
    
      // chordLength
      if (circArcDefinition.IsDefinedByChordLength)
      {
        if (circArcDefinition.ChordLength.HasValue)
        {
          s += "<entered> Chord Length: " + circArcDefinition.ChordLength.Value.ToString("F3")
            + Environment.NewLine;
        }
      }
      else
      {
        if (circArcDefinition.CanCalculateChordLength())
        {
          s += "<calc> Chord Length: " + circArcDefinition.CalculateChordLength().ToString("F3")
               + Environment.NewLine;
        }
        else
          s += "<calc> not able to calc chord length." + Environment.NewLine;
      }
    
      // central Angle
      if (circArcDefinition.IsDefinedByCentralAngle)
      {
        if (circArcDefinition.CentralAngle.HasValue)
        {
          s += "<entered> Central Angle: " + circArcDefinition.CentralAngle.Value.ToString("F3")
            + Environment.NewLine;
        }
      }
      else
      {
        if (circArcDefinition.CanCalculateCentralAngle())
        {
          s += "<calc> Central Angle: " + circArcDefinition.CalculateCentralAngle().ToString("F3")
               + Environment.NewLine;
        }
        else
          s += "<calc> not able to calc Central Angle." + Environment.NewLine;
      }
    }
    Requirements

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

    ArcGIS Pro version: 3.7 or higher.
    See Also