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.
public ObjectIdCollection CreateWaterdrop( Point2d location, WaterdropObjectType objectType )
Public Function CreateWaterdrop ( location As Point2d, objectType As WaterdropObjectType ) As ObjectIdCollection
public: ObjectIdCollection^ CreateWaterdrop( Point2d location, WaterdropObjectType objectType )
| Exception | Condition |
|---|---|
| ArgumentException | Thrown when the location is outside of the surface. |
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}