Creates one or more polylines that represent a flow of water, and marks the start point of the path. This method exposes the Water Drop command from the Civil 3D GUI.
Namespace: Autodesk.Civil.DatabaseServicesAssembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.4.208.0
Syntax
C#
public ObjectIdCollection CreateWaterdrop( Point2d location, WaterdropObjectType objectType )
Visual Basic
Public Function CreateWaterdrop ( _ location As Point2d, _ objectType As WaterdropObjectType _ ) As ObjectIdCollection
Visual C++
public: ObjectIdCollection^ CreateWaterdrop( Point2d location, WaterdropObjectType objectType )
Parameters
- location
- Type: Point2d
The location at which to create waterdrop object(s).
- objectType
- Type: Autodesk.Civil.WaterdropObjectType
An enum value that indicates what type of entity to create:- WaterdropObjectType::Polyline2D creates polylines of type Autodesk.AutoCAD.Database.Polyline.
- WaterdropObjectType::Polyline3D creates polylines of type Autodesk.AutoCAD.Database.Polyline3d.
Return Value
An ObjectIdCollection containing the ObjectId for all polylines created by the method.Remarks
If the location is on a peak, multiple Polyline2d or Polyline3d entities are created.
If the location is on a flat area, no entity is created and the method returns an empty ObjectIdCollection object.
Otherwise, only one Polyline2d or Polyline3d entity is created.
The water drop polyline is created on the surface layer.
Examples

1// iterate through all centeroids 2foreach (TinSurfaceTriangle t in oTinSurface.Triangles) 3{ 4 // calculate centroid, which is (v1x + v2x + v3x) / 3, (v1y + v2y + v3y) / 3 5 double cx = (t.Vertex1.Location.X + t.Vertex2.Location.X + t.Vertex3.Location.X) / 3; 6 double cy = (t.Vertex1.Location.Y + t.Vertex2.Location.Y + t.Vertex3.Location.Y) / 3; 7 8 Point2d centLoc = new Point2d(cx, cy); 9 10 // calculate waterdrop for the centroid 11 // editor.WriteMessage("Creating waterdrop at ({0}. {1})\n", cx, cy); 12 ObjectIdCollection oid = oTinSurface.Analysis.CreateWaterdrop(centLoc, Autodesk.Civil.WaterdropObjectType.Polyline3D); 13 14 // Save all the waterdrops 15 foreach (ObjectId id in oid) 16 { 17 drops.Add(id); 18 } 19}
Exceptions
Exception | Condition |
---|---|
System.ArgumentException | Thrown when the location is outside of the surface. |