ITerrainSurfaceSampleElevations Method |
Gets the sampled points along a curve entity.
Namespace: Autodesk.Civil.DatabaseServicesAssembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.8.0.292
SyntaxPoint3dCollection SampleElevations(
ObjectId curveId
)
Function SampleElevations (
curveId As ObjectId
) As Point3dCollection
Point3dCollection^ SampleElevations(
ObjectId curveId
)
Parameters
- curveId ObjectId
- An ObjectId of Autodesk.AutoCAD.DatabaseServices.Curve. The curve can be a line, arc and so on.
Return Value
Point3dCollection
ExceptionsException | Condition |
---|
ArgumentException |
Thrown when curveId is not a valid ObjectId of a Curve object.
|
SurfaceException |
Thrown when the method can't find the intersection point with the surface.
|
Example 1
2
3ObjectId surfaceId = TinSurface.Create(_acaddoc.Database, "Example Surface");
4TinSurface surface = surfaceId.GetObject(OpenMode.ForWrite) as TinSurface;
5Point3dGenerator p3dgen = new Point3dGenerator();
6Point3dCollection locations = p3dgen.AsPoint3dCollection();
7surface.AddVertices(locations);
8
9
10
11
12
13Database acadDb = _acaddoc.Database;
14BlockTable blockTable = tr.GetObject(acadDb.BlockTableId, OpenMode.ForRead) as BlockTable;
15BlockTableRecord blockTableRec = tr.GetObject(blockTable[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord;
16
17Polyline polyline = new Polyline();
18polyline.SetDatabaseDefaults();
19polyline.AddVertexAt(0, new Point2d(10, 10), 0, 0, 0);
20polyline.AddVertexAt(1, new Point2d(20, 10), 0, 0, 0);
21polyline.AddVertexAt(2, new Point2d(40, 35), 0, 0, 0);
22polyline.AddVertexAt(3, new Point2d(60, 40), 0, 0, 0);
23polyline.Closed = false;
24blockTableRec.AppendEntity(polyline);
25tr.AddNewlyCreatedDBObject(polyline, true);
26
27
28
29
30Point3dCollection samples = surface.SampleElevations(polyline.ObjectId);
31foreach (Point3d point in samples)
32{
33 write(String.Format("Elevation at {0},{1}:{2}\n",
34 point.X, point.Y, point.Z));
35}
No code example is currently available or this language may not be supported.
See Also