SurfaceAnalysisCreateWaterdrop Method |
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.8.0.292
Syntaxpublic ObjectIdCollection CreateWaterdrop(
Point2d location,
WaterdropObjectType objectType
)
Public Function CreateWaterdrop (
location As Point2d,
objectType As WaterdropObjectType
) As ObjectIdCollection
public:
ObjectIdCollection^ CreateWaterdrop(
Point2d location,
WaterdropObjectType objectType
)
Parameters
- location Point2d
- The location at which to create waterdrop object(s).
- objectType 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
ObjectIdCollection
An ObjectIdCollection containing the ObjectId for all polylines created by the method.
ExceptionsException | Condition |
---|
ArgumentException |
Thrown when the location is outside of the surface.
|
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.
Example 1
2foreach (TinSurfaceTriangle t in oTinSurface.Triangles)
3{
4
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
11
12 ObjectIdCollection oid = oTinSurface.Analysis.CreateWaterdrop(centLoc, Autodesk.Civil.WaterdropObjectType.Polyline3D);
13
14
15 foreach (ObjectId id in oid)
16 {
17 drops.Add(id);
18 }
19}
See Also