Calculate the volume of an area defined by several points.
Namespace: Autodesk.Civil.DatabaseServicesAssembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.4.208.0
Syntax
C#
public SurfaceVolumeInfo GetBoundedVolumes( Point3dCollection polygon, double datumElevation )
Visual Basic
Public Function GetBoundedVolumes ( _ polygon As Point3dCollection, _ datumElevation As Double _ ) As SurfaceVolumeInfo
Visual C++
public: SurfaceVolumeInfo GetBoundedVolumes( Point3dCollection^ polygon, double datumElevation )
Parameters
- polygon
- Type: Point3dCollection
The polygon specifies the area where the volumes are calculated. Since the polygon should be a closed one, the start point and the end point must be the same. There must be more than 3 points in the Point3dCollection.
- datumElevation
- Type: System.Double
The volumes will be calculated from the specified datum elevation.
Examples

1// Create a region that is a polygon inside the surface. 2// The first and last point must be the same to create a closed polygon. 3// 4Point3dCollection polygon = new Point3dCollection(); 5polygon.Add(new Point3d(20, 20, 20)); 6polygon.Add(new Point3d(20, 80, 15)); 7polygon.Add(new Point3d(80, 40, 25)); 8polygon.Add(new Point3d(20, 20, 20)); 9double elevation = 30.5; 10 11SurfaceVolumeInfo surfaceVolumeInfo = surface.GetBoundedVolumes(polygon, elevation); 12write(String.Format("Surface volume info:\n Cut volume: {0}\n Fill volume: {1}\n Net volume: {2}\n", 13 surfaceVolumeInfo.Cut, surfaceVolumeInfo.Fill, surfaceVolumeInfo.Net)); 14 15// If you do not specify an elevation, 0.0 is used: 16// 17surfaceVolumeInfo = surface.GetBoundedVolumes(polygon); 18write(String.Format("Surface volume info:\n Cut volume: {0}\n Fill volume: {1}\n Net volume: {2}\n", 19 surfaceVolumeInfo.Cut, surfaceVolumeInfo.Fill, surfaceVolumeInfo.Net));

1' Create a region that is a polygon inside the surface. 2' The first and last point must be the same to create a closed polygon. 3' 4Dim polygon As New Point3dCollection() 5polygon.Add(New Point3d(20, 20, 20)) 6polygon.Add(New Point3d(20, 80, 15)) 7polygon.Add(New Point3d(80, 40, 25)) 8polygon.Add(New Point3d(20, 20, 20)) 9Dim elevation As Double = 30.5 10 11Dim surfaceVolumeInfo As SurfaceVolumeInfo = surface.GetBoundedVolumes(polygon, elevation) 12write([String].Format("Surface volume info:" & vbLf & " Cut volume: {0}" & vbLf & " Fill volume: {1}" & vbLf & " Net volume: {2}" & vbLf, surfaceVolumeInfo.Cut, surfaceVolumeInfo.Fill, surfaceVolumeInfo.Net)) 13 14' If you do not specify an elevation, 0.0 is used: 15' 16surfaceVolumeInfo = surface.GetBoundedVolumes(polygon)
Exceptions
Exception | Condition |
---|---|
System.ArgumentException | Thrown when the passed in polygon can't construct a closed polygon. |