Skip to content

Latest commit

 

History

History
65 lines (51 loc) · 2.08 KB

File metadata and controls

65 lines (51 loc) · 2.08 KB

FeatureLine Class

Overview

The FeatureLine class represents a 3D polyline used for grading and corridor design in Civil3D.

Namespace

Autodesk.Civil.DatabaseServices

Inheritance Hierarchy

System.Object
  └─ RXObject
      └─ DBObject
          └─ Entity
              └─ Feature
                  └─ FeatureLine

Key Properties

Property Type Description
Name string Gets/sets the feature line name
Length2D double Gets the 2D (horizontal) length
Length3D double Gets the 3D (slope) length
MaximumElevation double Gets the maximum elevation
MinimumElevation double Gets the minimum elevation

Key Methods

Method Return Type Description
GetPoints(FeatureLinePointType) Point3dCollection Gets points along the feature line
ElevationAtPoint(Point3d) double Gets elevation at a point

Code Examples

Example 1: Accessing Feature Lines

using (Transaction tr = civilDoc.Database.TransactionManager.StartTransaction())
{
    ObjectIdCollection featureLineIds = civilDoc.GetFeatureLineIds();
    
    foreach (ObjectId featureLineId in featureLineIds)
    {
        FeatureLine featureLine = tr.GetObject(featureLineId, OpenMode.ForRead) as FeatureLine;
        
        ed.WriteMessage($"\nFeature Line: {featureLine.Name}");
        ed.WriteMessage($"\n  2D Length: {featureLine.Length2D:F2}");
        ed.WriteMessage($"\n  3D Length: {featureLine.Length3D:F2}");
        ed.WriteMessage($"\n  Min Elevation: {featureLine.MinimumElevation:F2}");
        ed.WriteMessage($"\n  Max Elevation: {featureLine.MaximumElevation:F2}");
    }
    
    tr.Commit();
}

Related Objects

References