The FeatureLine class represents a 3D polyline used for grading and corridor design in Civil3D.
Autodesk.Civil.DatabaseServices
System.Object
└─ RXObject
└─ DBObject
└─ Entity
└─ Feature
└─ FeatureLine
| 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 |
| Method | Return Type | Description |
|---|---|---|
GetPoints(FeatureLinePointType) |
Point3dCollection |
Gets points along the feature line |
ElevationAtPoint(Point3d) |
double |
Gets elevation at a point |
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();
}- Grading - Uses feature lines
- Corridor - Can extract feature lines
- CivilDocument - Container for feature lines