Extracts the surface minor contour information from the terrain surface.
Namespace: Autodesk.Civil.DatabaseServicesAssembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.4.2516.0
Syntax
Parameters
- settingsType
- Type: Autodesk.Civil..::..SurfaceExtractionSettingsType
Specify SurfaceExtractionSettingsType.Plan to extract the contour information using the plan visual style settings,
or SurfaceExtractionSettingsType.Model to use the model settings.
Return Value
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.
Examples
CopyC#
1
2
3TinSurface surface = CreateRandomSurface("Example Surface");
4
5
6
7surface.StyleId = _civildoc.Styles.SurfaceStyles["Contours and Triangles"];
8
9
10
11ObjectIdCollection minorContours;
12minorContours = surface.ExtractMinorContours(SurfaceExtractionSettingsType.Plan);
13write("# of extracted contours: " + minorContours.Count + "\n");
14int totalVertices = 0;
15for (int i = 0; i < minorContours.Count; i++)
16{
17 ObjectId contourId = minorContours[i];
18
19
20 Polyline contour = contourId.GetObject(OpenMode.ForRead) as Polyline;
21 write(String.Format("Contour #{0} length:{1}, # of vertices:{2}\n",
22 i, contour.Length, contour.NumberOfVertices));
23 totalVertices += contour.NumberOfVertices;
24}
25
26
27
28minorContours = surface.ExtractMinorContours(SurfaceExtractionSettingsType.Plan,
29 ContourSmoothingType.AddVertices, 10);
30int totalVerticesSmoothed = 0;
31foreach (ObjectId contourId in minorContours)
32{
33 Polyline contour = contourId.GetObject(OpenMode.ForRead) as Polyline;
34 totalVerticesSmoothed += contour.NumberOfVertices;
35}
36
37
38write(String.Format("Effects of smoothing:\n total vertices no smoothing: {0}\n total vertices with smoothing: {1}\n",
39 totalVertices, totalVerticesSmoothed));
CopyVB.NET
See Also