Share

ITerrainSurface.ExtractWatershed Method

Extracts the surface watershed information from the terrain surface.



Namespace: Autodesk.Civil.DatabaseServices
Assembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.8.0.280

Syntax

C#

ObjectIdCollection ExtractWatershed(
	SurfaceExtractionSettingsType settingsType
)

VB

Function ExtractWatershed ( 
	settingsType As SurfaceExtractionSettingsType
) As ObjectIdCollection

C++

ObjectIdCollection^ ExtractWatershed(
	SurfaceExtractionSettingsType settingsType
)

Parameters

settingsType  SurfaceExtractionSettingsType
Specify SurfaceExtractionSettingsType.Plan to extract the watershed information using the plan visual style settings, or SurfaceExtractionSettingsType.Model to use the model settings.

Return Value

ObjectIdCollection
An ObjectIdCollection of the extracted entities. The extracted entities can be Polyline3d or Hatch. If the surface has no watershed information, this method returns an empty ObjectIdCollection.

Example

C#

 1// This example requires an existing surface in the document                   
 2// that displays watershed data.  
 3// 
 4ObjectId surfaceId = _civildoc.GetSurfaceIds()[0];
 5TinSurface surface = surfaceId.GetObject(OpenMode.ForRead) as TinSurface;
 6
 7// Extract watershed data and print information about it:
 8// 
 9ObjectIdCollection watershedData;
10watershedData = surface.ExtractWatershed(SurfaceExtractionSettingsType.Plan);
11write("# of extracted data components: " + watershedData.Count + "\n");
12
13foreach (ObjectId dataId in watershedData)
14{
15    // Watershed components are either Polyline3d or Hatch objects:
16    // 
17    Polyline3d watershedLine = dataId.GetObject(OpenMode.ForRead) as Polyline3d;
18    if (watershedLine != null)
19    {
20        write(String.Format("Watershed line start:{0} end:{1}\n",
21            watershedLine.StartPoint.ToString(), watershedLine.EndPoint.ToString()));
22    }
23
24    Hatch watersheHatch = dataId.GetObject(OpenMode.ForRead) as Hatch;
25    if (watersheHatch != null)
26    {
27        write(String.Format("Watershed hatch area:{0} origin:{1}\n",
28            watersheHatch.Area, watersheHatch.Origin.ToString()));
29    }                        
30}

VB

1!ERROR: See log file!

See Also

Reference

Was this information helpful?