PondContourCollection Class

A collection of PondContour objects representing all contours in a pond.
Inheritance Hierarchy
SystemObject
  SystemMarshalByRefObject
    DisposableWrapper
      Autodesk.Civil.DatabaseServicesPondContourCollection

Namespace: Autodesk.Civil.DatabaseServices
Assembly: AeccDrainageDesignMgd (in AeccDrainageDesignMgd.dll) Version: 13.9.960.0
Syntax
public sealed class PondContourCollection : DisposableWrapper, 
	IEnumerable<PondContour>

The PondContourCollection type exposes the following members.

Constructors
 NameDescription
Public methodPondContourCollection Initializes a new instance of the PondContourCollection class.
Public methodPondContourCollection(PondContour) Initializes a new instance of the PondContourCollection class from an array of PondContours.
Top
Properties
 NameDescription
Public propertyCount Gets the number of contours in the collection.
Public propertyItemInt32 
Public propertyItemString 
Top
Methods
 NameDescription
Public methodAdd(PondContour) Adds a contour to the collection.
Public methodAdd(PondContour) Adds multiple contours to the collection from an array of PondContours.
Public methodClear Removes all contours from the collection.
Public methodContains Determines whether the collection contains a contour with the specified ID.
Public methodGetEnumerator Implements the method declared in the IEnumerable interface. This method returns an enumerator for this collection.
Public methodGetObjectEnumerator Implements the method declared in the IEnumerable interface. This method returns an enumerator for this collection.
Public methodIndexOf Gets the index of the contour with the specified ID in the collection.
Public methodRemove Removes the contour with the specified ID from the collection.
Public methodRemoveAt Removes the contour at the specified index from the collection.
Public methodSet(PondContour) Sets (replaces) an existing contour in the collection, or adds it if not present.
Public methodSet(PondContour) Sets (replaces) multiple contours in the collection.
Top
Remarks

Collection Organization:

The contours are sorted by area in descending order (outermost to innermost). The pond's outer boundary will always be the first contour in the collection. Each PondContour represents a contour at a specific elevation.

Snapshot Pattern:

This collection implements a snapshot pattern for data access and modification:

  • Independent copies: All retrieval operations (indexers, enumeration) return independent copies of PondContour objects, not references to the originals.
  • Modification workflow: To modify a contour's geometry while preserving its ID, you must: (1) retrieve the contour, (2) create a new contour with modified geometry and the same ID, (3) use Set() to replace the original.
  • Immutable objects: Retrieved PondContour objects are immutable; modifying them does not affect the collection.
  • Multiple retrievals: Each call to indexers or enumeration returns a new independent copy.

Example Usage:

C#
1// Retrieve contour (gets independent copy)
2var contour = collection[contourId];
3
4// Create modified version with same ID
5var offsetContour = contour.GetOffsetContour(5.0, 2.0);
6var modifiedContour = new PondContour(offsetContour.ToPolyline(), contour.Id);
7
8// Update collection (required for changes to take effect)
9collection.Set(modifiedContour);
See Also