The Catchment class represents a drainage catchment area in Civil3D, used for hydrology and drainage analysis.
Autodesk.Civil.DatabaseServices
System.Object
└─ RXObject
└─ DBObject
└─ Entity
└─ Catchment
| Property | Type | Description |
|---|---|---|
Name |
string |
Gets/sets the catchment name |
Area |
double |
Gets the catchment area |
DischargePoint |
Point3d |
Gets/sets the discharge point location |
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();
}- Surface - Used to define catchment boundaries
- CivilDocument - Container for catchments