A professional, production-quality Autodesk Civil 3D plugin that automates the generation of detailed engineering reports and PDF plotting for alignment, profile, surface, and pipe network analysis. This open-source plugin demonstrates advanced expertise with the Autodesk Civil 3D .NET API and C# enterprise development patterns.
- Alignment Reports - Detailed horizontal geometry analysis including tangent elements, horizontal curves, POC/POT/PRC stations, radii, arc lengths, delta angles
- Profile Reports - Vertical geometry analysis with Profile View Intersections (PVIs), vertical curves, grades, K-values, and sag/crest identification
- Surface Reports - TIN surface analysis with elevation statistics, slope categorization, triangle/vertex counts, and breakline analysis
- Pipe Network Reports - Complete network analysis including structures, pipes, rim/invert elevations, cover depths, slopes, and flow direction
- Volume Comparison - Cut/fill volume calculations between existing and design surfaces
- CSV Export - Properly formatted comma-separated values with special character escaping
- HTML Reports - Professionally styled, responsive HTML with:
- Embedded CSS with custom color scheme
- Auto-generated table of contents
- Alternating row colors for readability
- Summary statistics with visual stat cards
- Print-friendly layout
- Batch Report Generation - Generate all reports for a drawing in a single operation
- Individual Layout Plots - Plot any layout to PDF with configurable settings
- Batch Plotting - Automatically plot all layouts to individual PDF files
- Plan Set Generation - Combine all layouts into a single multi-page PDF
- Stamp Support - Automatic date/revision stamps with customizable position
- Configuration Options:
- Paper size (Letter, A4, A3, Tabloid, etc.)
- Orientation (Portrait/Landscape)
- Plot scale and fit-to-page options
- Plot style table selection
- Custom margins and offsets
- Center plot on page option
- Autodesk AutoCAD 2025 (or compatible version)
- Autodesk Civil 3D 2025
- .NET Framework 4.8
- Visual Studio 2019 or later (for compilation)
-
Clone or download the repository:
git clone https://github.com/yourusername/C3DReportEngine.git cd C3DReportEngine -
Open
C3DReportEngine.csprojin Visual Studio -
Verify assembly references point to your Civil 3D installation:
- AcDbMgd.dll
- AcMgd.dll
- AcCoreMgd.dll
- AeccDbMgd.dll
-
Build the solution:
Build > Build Solution -
Copy the compiled DLL to your AutoCAD plugins folder:
C:\Program Files\Autodesk\AutoCAD 2025\UserDataCache\roamed\en-US\SupportOr use the NETLOAD command in AutoCAD to load the DLL on demand.
In AutoCAD/Civil 3D, use the NETLOAD command:
- Type
NETLOADin the command line - Navigate to and select
C3DReportEngine.dll - The plugin commands become available
Command: C3DRE_AlignmentReport
Generates a detailed alignment geometry report including:
- Tangent elements with bearing and length
- Horizontal curves with radius, arc length, and delta angle
- Station values in XX+XX.XX format
- Exports to CSV and HTML formats
Output Files:
{AlignmentName}_Alignment.csv{AlignmentName}_Alignment.html
Example Output:
ALIGNMENT REPORT
Name: Main Road Alignment
Start Station: 0.00
End Station: 2500.00
Total Length: 2500.00
Generated: 2025-02-26 10:30:45
TANGENT ELEMENTS
Station,Bearing (deg),Length,Northing,Easting
0+00.00,45.0000,500.25,1000.00,2000.00
...
HORIZONTAL CURVES
POC Station,POT Station,Radius,Arc Length,Delta (deg),Direction
5+00.00,7+45.32,1000.00,245.32,14.0245,Right
...
Command: C3DRE_ProfileReport
Generates a vertical profile analysis including:
- Profile View Intersections (PVIs) with elevations and grades
- Vertical curves with K-values and curve types
- Station and elevation data for design analysis
Output Files:
{ProfileName}_Profile.csv{ProfileName}_Profile.html
Example Output:
PROFILE REPORT
Name: Main Road Profile
Station Range: 0.00 to 2500.00
PROFILE VIEW INTERSECTIONS (PVI)
Station,Elevation,Incoming Grade (%),Outgoing Grade (%)
0+00.00,100.00,0.000,2.500
10+50.00,121.25,2.500,-1.800
...
VERTICAL CURVES
SVC Station,LP/HP Station,EVC Station,K-Value,Type
10+00.00,10+25.00,10+50.00,50.00,Crest
...
Command: C3DRE_SurfaceReport
Generates TIN surface analysis including:
- Elevation statistics (minimum, maximum, range)
- Triangle and vertex counts
- Slope analysis by category
- Breakline information
Output Files:
{SurfaceName}_Surface.csv{SurfaceName}_Surface.html
Example Output:
SURFACE ANALYSIS REPORT
Name: Existing Ground Surface
Min Elevation: 95.50
Max Elevation: 145.75
Elevation Range: 50.25
Triangles: 15,432
Vertices: 8,120
SLOPE ANALYSIS
Category,Min Slope,Max Slope,Area in Range,% of Total,Triangle Count
0%,0.00,10.00,12500.50,55.25,8,456
10%,10.00,20.00,8750.25,38.60,5,892
...
Command: C3DRE_PipeNetworkReport
Generates complete pipe network analysis:
- Structure list with rim/invert elevations and cover depths
- Pipe inventory with materials, sizes, and slopes
- Flow direction analysis
- Network connectivity summary
Output Files:
{NetworkName}_PipeNetwork.csv{NetworkName}_PipeNetwork.html
Example Output:
PIPE NETWORK REPORT
Name: Storm Drainage Network
Structures: 24
Pipes: 23
Total Pipe Length: 2,450.50
STRUCTURES
Name,Type,Rim Elevation,Invert Elevation,Cover Depth,Northing,Easting
MH-1,Manhole,102.50,98.75,3.75,5000.00,10000.00
CB-2,Catch Basin,105.25,98.50,6.75,5100.00,10050.00
...
PIPES
Name,Shape,Size,Material,Length,Slope (%)
P-1,Circular,15.00",RCP,125.50,0.480
P-2,Circular,18.00",PVC,156.25,0.350
...
Command: C3DRE_BatchReport
Generates all available reports for the drawing in one operation:
- Processes all alignments
- Processes all surfaces
- Processes all pipe networks
- Creates CSV and HTML exports for each object
Output: Reports directory created in the same folder as the DWG with all generated reports
Command: C3DRE_PlotToPDF
Plots the active layout to PDF with the following defaults:
- Paper size: Letter
- Orientation: Landscape
- Scale: 1.0 (to fit page)
- Style: Monochrome
- Stamp: Yes (with date/time)
Output: {DrawingName}_{LayoutName}.pdf in Plots directory
Command: C3DRE_BatchPlotToPDF
Automatically plots all paper space layouts to individual PDF files:
- One PDF per layout
- Consistent plot settings across all layouts
- Progress reporting in command line
Output: Multiple files in Plots directory
{DrawingName}_Layout1.pdf{DrawingName}_Layout2.pdf- etc.
Command: C3DRE_PlotPlanSet
Combines all layouts into a single multi-page PDF:
- One page per layout
- Consistent scale and style
- Useful for distribution as single plan set
Output: {DrawingName}_PlanSet.pdf in Plots directory
Command: C3DRE_PlotWithStamp
Plots layout with automatic revision control stamp:
- Includes timestamp
- Includes revision number
- Includes username
- Configurable position (bottom-right by default)
Output: {DrawingName}_{LayoutName}_Stamped.pdf
Stamp Format:
REVISION: 1.0 | Date: 2025-02-26 10:30:45 | Plotted by: username
Plots can be configured via the PlotConfiguration class:
var config = new PlotConfiguration
{
PaperSize = "Letter", // Letter, A4, A3, Tabloid, etc.
Orientation = PlotOrientation.Landscape,
PlotScale = 1.0, // 1.0 = 100%, 0.5 = 50%, 2.0 = 200%
PlotArea = "Layout", // Layout, Display, Extents, Window
PlotStyleTable = "monochrome.ctb",
MarginLeft = 0.5, // inches
MarginRight = 0.5,
MarginTop = 0.5,
MarginBottom = 0.5,
EnableStamp = true,
StampText = "Custom Text Here",
StampPosition = StampPosition.BottomRight,
OutputPath = "C:\\Plots\\output.pdf",
FitToPage = true,
CenterPlot = true
};Reports use configurable export formats:
- CSV: Fixed format for data import to spreadsheets
- HTML: Responsive design with embedded CSS, suitable for email and web viewing
- Both formats can be extended with custom formatting
Core report generation engine:
var reportBuilder = new ReportBuilder(document);
// Build alignment report
var alignmentReport = reportBuilder.BuildAlignmentReport(alignmentId);
// Build profile report
var profileReport = reportBuilder.BuildProfileReport(profileId, alignmentName);
// Build surface report
var surfaceReport = reportBuilder.BuildSurfaceReport(surfaceId);
// Build pipe network report
var pipeNetworkReport = reportBuilder.BuildPipeNetworkReport(networkId);
// Compare two surfaces
var comparison = reportBuilder.CompareSurfaces(baseSurfaceId, designSurfaceId);Export report data to CSV:
CsvExporter.ExportAlignmentReport(reportData, "path/to/file.csv");
CsvExporter.ExportProfileReport(reportData, "path/to/file.csv");
CsvExporter.ExportSurfaceReport(reportData, "path/to/file.csv");
CsvExporter.ExportPipeNetworkReport(reportData, "path/to/file.csv");Generate styled HTML reports:
HtmlExporter.ExportAlignmentReport(reportData, "path/to/file.html");
HtmlExporter.ExportProfileReport(reportData, "path/to/file.html");
HtmlExporter.ExportSurfaceReport(reportData, "path/to/file.html");
HtmlExporter.ExportPipeNetworkReport(reportData, "path/to/file.html");Handle plot operations:
var plotHelper = new PlotHelper(document);
// Plot single layout
plotHelper.PlotLayoutToPdf(layoutName, config);
// Plot all layouts
plotHelper.BatchPlotAllLayoutsToPdf(outputDirectory, config);
// Plot multiple layouts to single PDF
var layoutList = new List<string> { "Layout1", "Layout2", "Layout3" };
plotHelper.PlotMultipleLayoutsToPdf(layoutList, config);
// Get layout names
var layouts = plotHelper.GetAllLayoutNames();Utility functions for Civil 3D object manipulation:
// Format station (1000.00 becomes "10+00.00")
string stationStr = CivilObjectHelper.FormatStation(1000.00);
// Format grade percentage
string gradeStr = CivilObjectHelper.FormatGrade(0.05); // Returns "5.000%"
// Convert degrees to bearing notation
string bearing = CivilObjectHelper.ConvertDegreesToBearing(45.5);
// Get all alignments
var alignments = CivilObjectHelper.GetAllAlignments();
// Get all surfaces
var surfaces = CivilObjectHelper.GetAllSurfaces();
// Get all pipe networks
var networks = CivilObjectHelper.GetAllPipeNetworks();
// Safe property access
double value = CivilObjectHelper.GetPropertySafe<double>(obj, "PropertyName", 0.0);AlignmentReportData- Alignment geometry with tangents and curvesProfileReportData- Profile with PVIs and vertical curvesSurfaceReportData- Surface analysis with slope and volume dataPipeNetworkReportData- Network with structures and pipes
PlotOrientation- Portrait, LandscapeStampPosition- TopLeft, TopRight, BottomLeft, BottomRightPdfQuality- Standard, High
All commands include comprehensive error handling:
- Transaction management with proper rollback
- Null reference checking
- File I/O exception handling
- User-friendly error messages to command line
- Debug output for troubleshooting
Example error output:
Error generating alignment report: Object reference not set to an instance of an object.
Command line:
C3DRE_BatchReport
Result:
- Creates Reports directory
- Generates reports for all alignments, surfaces, and pipe networks
- Exports to both CSV and HTML formats
- Displays summary in command line
Command line:
C3DRE_PlotPlanSet
Result:
- Creates Plots directory
- Combines all layouts into single multi-page PDF
- Perfect for distributing design documents
Command line:
C3DRE_AlignmentReport
Result:
- Analyzes first alignment in drawing
- Exports tangent and curve data
- Generates formatted CSV and styled HTML
- Displays summary statistics
- Alignment report: < 1 second for typical alignments
- Profile report: < 1 second
- Surface report: 5-30 seconds depending on triangle count
- Pipe network report: 2-5 seconds for typical networks
- Individual layout plot: 5-15 seconds
- Batch plotting (10 layouts): 30-60 seconds
- Verify DLL is in correct location
- Check that .NET Framework 4.8 is installed
- Run AutoCAD as administrator
- Use NETLOAD and check for error messages
- Verify Civil 3D 2025 is installed
- Check that assembly paths in .csproj are correct
- Rebuild solution with correct reference paths
- Verify layout exists in drawing
- Check that output directory is writable
- Ensure plot style table exists (monochrome.ctb is standard)
- Try plotting to a different location
- Verify drawing contains the relevant objects (alignments, surfaces, etc.)
- Check that Civil 3D objects are properly created
- Look for error messages in command line output
- Commands/ - Command implementations for user interface
- Reporting/ - Report generation and export logic
- Plotting/ - PDF plotting utilities
- Helpers/ - Civil 3D API wrapper utilities
- Models/ - Data structures for reports
- Create a new model class in Models/
- Implement build method in ReportBuilder
- Create CSV export in CsvExporter
- Create HTML export in HtmlExporter
- Add command method in ReportCommands
- Always use transactions for database access
- Check for null objects before accessing properties
- Use CivilObjectHelper for safe property access
- Provide user feedback via Editor.WriteMessage()
- Include comprehensive XML documentation comments
Copyright (c) 2026 Samuel Safahi. All Rights Reserved.
This software is proprietary. It is provided for viewing and reference purposes only. No license is granted for use, modification, or distribution. See LICENSE for details.
For licensing inquiries, contact dev@soapboxsuperapp.com
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch
- Add comprehensive comments to code
- Test thoroughly with Civil 3D 2025
- Submit a pull request with detailed description
For bug reports and feature requests, please use the GitHub Issues section.
This plugin is provided as-is. While tested with Civil 3D 2025, always backup your drawings before using automated tools. Test with non-critical projects first.
Civil 3D Report Engine Contributors
- Initial release
- Complete alignment, profile, surface, and pipe network reporting
- CSV and HTML export formats
- Individual and batch PDF plotting
- Revision stamp support
- Batch report generation
- Comprehensive error handling
- Autodesk Civil 3D .NET API Documentation
- AutoCAD .NET Developer's Guide
- PlottingServices API Reference
Keywords: Civil 3D, Report Generator, PDF Plotter, .NET Plugin, Autodesk, Engineering Reports, Alignment Analysis, Profile Analysis, Surface Analysis, Pipe Networks