- Python 3.10 or later
- pip package manager
- AutoCAD Civil 3D 2026
- .NET Framework 4.8
- Visual Studio 2022 (Community edition is fine)
- .NET Framework 4.8 targeting pack
Open a command prompt and navigate to the Python folder:
cd CatchmentTool\Python
# Install dependencies
pip install -r requirements.txtThis installs:
- WhiteboxTools - hydrological analysis
- rasterio - raster I/O
- geopandas - vector data handling
- shapely - geometry operations
- numpy - numerical operations
python -c "import whitebox; wbt = whitebox.WhiteboxTools(); print(wbt.version())"You should see the WhiteboxTools version printed.
- Open
CatchmentTool\CSharp\CatchmentTool.csprojin Visual Studio 2022 - Update the Civil 3D reference paths if needed (in the .csproj file)
- Build the solution (Ctrl+Shift+B)
- The output DLL will be in
CatchmentTool\CSharp\bin\
cd CatchmentTool\CSharp
# Restore and build
dotnet build -c Release- Open Civil 3D 2026
- Type
NETLOADat the command prompt - Browse to
CatchmentTool\CSharp\bin\CatchmentTool.dll - Click Open
Create a file named CatchmentTool.bundle in your Civil 3D plugin folder:
Location: C:\Users\<username>\AppData\Roaming\Autodesk\ApplicationPlugins\
<?xml version="1.0" encoding="utf-8"?>
<ApplicationPackage
SchemaVersion="1.0"
Name="Catchment Delineation Tool"
Description="Automated catchment delineation using WhiteboxTools"
Author="Your Name"
Version="1.0.0">
<CompanyDetails Name="Your Company" />
<Components>
<RuntimeRequirements OS="Win64" Platform="AutoCAD Civil 3D" SeriesMin="C3D2026" />
<ComponentEntry AppName="CatchmentTool"
ModuleName="./Contents/CatchmentTool.dll"
LoadOnAutoCADStartup="True" />
</Components>
</ApplicationPackage>Then copy CatchmentTool.dll and Newtonsoft.Json.dll to a Contents subfolder.
- Open Civil 3D 2026
- Open a drawing with a surface and pipe network
- Type
LISTPIPESTRUCTURESto verify the plugin loaded - You should see a list of structures in the command window
| Command | Description |
|---|---|
EXPORTCATCHMENTDATA |
Export surface DEM and inlet structures |
IMPORTCATCHMENTS |
Import catchment polygons from WhiteboxTools |
DELINEATECATCHMENTS |
Full workflow (export, process, import) |
LISTPIPESTRUCTURES |
List all structures in a pipe network |
-
In Civil 3D:
Command: EXPORTCATCHMENTDATA- Select surface
- Select pipe network
- Choose working directory (or accept default)
-
In Command Prompt:
cd "C:\path\to\CatchmentData" python "C:\...\CatchmentTool\Python\run_delineation.py" .
-
In Civil 3D:
Command: IMPORTCATCHMENTS- Select the generated
catchments.jsonfile - Select pipe network
- Select surface
- Select the generated
The tool looks for structures with names containing: inlet, catch basin, area drain, curb inlet, grate, etc. If your structures use different naming, you may need to modify the filter in StructureExtractor.cs.
Make sure Python can find the whitebox module:
python -c "import whitebox; print(whitebox.__file__)"If the BIL to GeoTIFF conversion fails, check that rasterio is properly installed:
python -c "import rasterio; print(rasterio.__version__)"For very large surfaces, the DEM export may take several minutes. Consider:
- Using a coarser cell size (add
--cell-sizeparameter in future version) - Exporting a smaller area of the surface
Create a config.json file in your working directory to customize delineation:
{
"depression_method": "breach",
"snap_distance": 10.0,
"min_catchment_area": 100.0
}depression_method: "breach" (recommended) or "fill"snap_distance: Distance to snap pour points to flow network (map units)min_catchment_area: Minimum catchment size to include (sq map units)