The Grading class represents a grading object in Civil3D, used for site grading and earthwork design.
Autodesk.Civil.DatabaseServices
System.Object
└─ RXObject
└─ DBObject
└─ Entity
└─ Grading
| Property | Type | Description |
|---|---|---|
Name |
string |
Gets the grading name |
SurfaceId |
ObjectId |
Gets/sets the target surface |
StyleId |
ObjectId |
Gets/sets the grading style |
using (Transaction tr = civilDoc.Database.TransactionManager.StartTransaction())
{
ObjectIdCollection gradingIds = civilDoc.GetGradingIds();
ed.WriteMessage($"\nFound {gradingIds.Count} grading objects:");
foreach (ObjectId gradingId in gradingIds)
{
Grading grading = tr.GetObject(gradingId, OpenMode.ForRead) as Grading;
ed.WriteMessage($"\n {grading.Name}");
}
tr.Commit();
}- Surface - Target surface for grading
- FeatureLine - Often used with grading
- CivilDocument - Container for gradings