Skip to content

Latest commit

 

History

History
54 lines (41 loc) · 1.56 KB

File metadata and controls

54 lines (41 loc) · 1.56 KB

Catchment Class

Overview

The Catchment class represents a drainage catchment area in Civil3D, used for hydrology and drainage analysis.

Namespace

Autodesk.Civil.DatabaseServices

Inheritance Hierarchy

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

Key Properties

Property Type Description
Name string Gets/sets the catchment name
Area double Gets the catchment area
DischargePoint Point3d Gets/sets the discharge point location

Code Examples

Example 1: Listing Catchments

using (Transaction tr = civilDoc.Database.TransactionManager.StartTransaction())
{
    ObjectIdCollection catchmentIds = civilDoc.GetCatchmentIds();
    
    ed.WriteMessage($"\nFound {catchmentIds.Count} catchments:");
    
    foreach (ObjectId catchmentId in catchmentIds)
    {
        Catchment catchment = tr.GetObject(catchmentId, OpenMode.ForRead) as Catchment;
        
        ed.WriteMessage($"\n  {catchment.Name}");
        ed.WriteMessage($"\n    Area: {catchment.Area:F2} sq units");
        ed.WriteMessage($"\n    Discharge Point: ({catchment.DischargePoint.X:F2}, {catchment.DischargePoint.Y:F2})");
    }
    
    tr.Commit();
}

Related Objects

References