Skip to content

Latest commit

 

History

History
53 lines (40 loc) · 1.38 KB

File metadata and controls

53 lines (40 loc) · 1.38 KB

Grading Class

Overview

The Grading class represents a grading object in Civil3D, used for site grading and earthwork design.

Namespace

Autodesk.Civil.DatabaseServices

Inheritance Hierarchy

System.Object
  └─ RXObject
      └─ DBObject
          └─ Entity
              └─ Grading

Key Properties

Property Type Description
Name string Gets the grading name
SurfaceId ObjectId Gets/sets the target surface
StyleId ObjectId Gets/sets the grading style

Code Examples

Example 1: Listing Gradings

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();
}

Related Objects

References