SurfaceAnalysisGetWatershedData Method

Gets the watershed analysis data for a Surface.

Namespace: Autodesk.Civil.DatabaseServices
Assembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.8.0.292
Syntax
public SurfaceAnalysisWatershedDataCollection GetWatershedData()

Return Value

SurfaceAnalysisWatershedDataCollection
An SurfaceAnalysisWatershedDataCollection object that contains watershed analysis data.
Remarks
This method returns watershed analysis data for a Surface. Data only exists if it has been generated in the Surface Analysis tab. Watersheds will appear in the GUI if the watershed component of the surface style are set to visible, but the analysis data will be empty. Data is generated from the Analysis tab on the Surface Properties dialog.

Use SetWatershedData() to apply changes made to data returned by this method.
Example
C#
 1/// <summary>
 2/// Illustrates accessing a watershed analysis
 3/// </summary>
 4[CommandMethod("SurfaceWatershedAnalysis")]
 5public void SurfaceWatershedAnalysis()
 6{
 7    using (Transaction ts = Application.DocumentManager.MdiActiveDocument.Database.TransactionManager.StartTransaction())
 8    {
 9        // Select first TIN Surface              
10        ObjectId surfaceId = doc.GetSurfaceIds()[0];
11        CivSurface oSurface = surfaceId.GetObject(OpenMode.ForRead) as CivSurface;
12
13        SurfaceAnalysisWatershedDataCollection analysisData = oSurface.Analysis.GetWatershedData();
14        editor.WriteMessage("Number of watershed regions: {0}\n", analysisData.Count);
15        foreach (SurfaceAnalysisWatershedData watershedData in analysisData)
16        {
17            editor.WriteMessage("Data item AreaId: {0} \n"
18                + "Description: {1}\n"
19                + "Type: {2}\n"
20                + "Drains into areas: {3}\n"
21                + "Visible? {4}\n",
22                watershedData.AreaID, watershedData.Description, watershedData.Type,
23                String.Join(", ", watershedData.DrainsInto), watershedData.Visible);
24        }
25    }
26}
See Also