ITerrainSurfaceExtractContoursAt(Double, ContourSmoothingType, Int32) Method |
Extracts the surface contour information from the terrain surface at a specified elevation with smoothing.
Namespace: Autodesk.Civil.DatabaseServicesAssembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.8.0.292
SyntaxObjectIdCollection ExtractContoursAt(
double elevation,
ContourSmoothingType smoothType,
int smoothFactor
)
Function ExtractContoursAt (
elevation As Double,
smoothType As ContourSmoothingType,
smoothFactor As Integer
) As ObjectIdCollection
ObjectIdCollection^ ExtractContoursAt(
double elevation,
ContourSmoothingType smoothType,
int smoothFactor
)
Parameters
- elevation Double
-
The specified elevation.
- smoothType ContourSmoothingType
-
Currently, the smoothType can be AddVertices only.
- smoothFactor Int32
-
smoothFactor should be in the range [0, 10]. A value of 10 generates the smoothest contours.
Return Value
ObjectIdCollection
An ObjectIdCollection of the extracted entities. The extracted entities are Polyline objects.
If the surface has no contour information, this method returns an empty ObjectIdCollection.
ExceptionsException | Condition |
---|
ArgumentException |
Thrown when smoothFactor is not in the range [0, 10].
|
Example 1
2
3TinSurface surface = CreateRandomSurface("Example Surface");
4
5
6
7
8ObjectIdCollection contours;
9double contourElevation = 50.0;
10contours = surface.ExtractContoursAt(contourElevation);
11write("# of extracted contours: " + contours.Count + "\n");
12int totalVertices = 0;
13for (int i = 0; i < contours.Count; i++)
14{
15 ObjectId contourId = contours[i];
16
17
18 Polyline contour = contourId.GetObject(OpenMode.ForRead) as Polyline;
19 write(String.Format("Contour #{0} length:{1}, # of vertices:{2}\n",
20 i, contour.Length, contour.NumberOfVertices));
21 totalVertices += contour.NumberOfVertices;
22}
23
24
25contours = surface.ExtractContoursAt(contourElevation, ContourSmoothingType.AddVertices, 10);
26int totalVerticesSmoothed = 0;
27foreach (ObjectId contourId in contours)
28{
29 Polyline contour = contourId.GetObject(OpenMode.ForRead) as Polyline;
30 totalVerticesSmoothed += contour.NumberOfVertices;
31}
32
33
34write(String.Format("Effects of smoothing:\n total vertices no smoothing: {0}\n total vertices with smoothing: {1}\n",
35 totalVertices, totalVerticesSmoothed));
No code example is currently available or this language may not be supported.
See Also