CogoPointCollectionSetElevationBySurface(IEnumerableObjectId, ObjectId) Method |
Sets the elevation for multiple CogoPoints with elevation values obtained from a specified surface.
Namespace: Autodesk.Civil.DatabaseServicesAssembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.8.0.292
Syntaxpublic ObjectIdCollection SetElevationBySurface(
IEnumerable<ObjectId> pointIds,
ObjectId surfaceId
)
Public Function SetElevationBySurface (
pointIds As IEnumerable(Of ObjectId),
surfaceId As ObjectId
) As ObjectIdCollection
public:
ObjectIdCollection^ SetElevationBySurface(
IEnumerable<ObjectId>^ pointIds,
ObjectId surfaceId
)
Parameters
- pointIds IEnumerableObjectId
- A list of ObjectIds of the points you want to set the elevation for.
- surfaceId ObjectId
- The ObjectId of the Surface object you want to get the elevation from.
Return Value
ObjectIdCollection
An ObjectIdCollection containing the CogoPoints for which the elevation has been set successfully.
Example 1
2CogoPointCollection cogoPoints = _civildoc.CogoPoints;
3ObjectId pointId = cogoPoints.Add(new Point3d(100, 100, 0), false);
4
5
6if (ObjectId.Null == cogoPoints.SetElevationBySurface(pointId, tinSurfaceId))
7{ write("SetElevationBySurface failed, perhaps the point is outside the surface?\n"); }
8else
9{
10 CogoPoint point = pointId.GetObject(OpenMode.ForRead) as CogoPoint;
11 write("Point's new elevation from surface: " + point.Elevation);
12}
13
14
15Point3dCollection pointCollection = new Point3dCollection();
16pointCollection.Add(new Point3d(100, 110, 0));
17pointCollection.Add(new Point3d(110, 100, 0));
18ObjectIdCollection pointIdCollection = cogoPoints.Add(pointCollection, "Example Points", false);
19List<ObjectId> pointIdList = new List<ObjectId>();
20foreach (ObjectId id in pointIdCollection) { pointIdList.Add(id); }
21
22
23ObjectIdCollection successfullySetPoints = cogoPoints.SetElevationBySurface(pointIdList, tinSurfaceId);
24write(String.Format("Successfully set elevation for {0} of {1} points.\n",
25 pointIdCollection.Count, successfullySetPoints.Count));
1
2Dim cogoPoints As CogoPointCollection = _civildoc.CogoPoints
3Dim pointId As ObjectId = cogoPoints.Add(New Point3d(100, 100, 0), False)
4
5
6If ObjectId.Null = cogoPoints.SetElevationBySurface(pointId, tinSurfaceId) Then
7 write("SetElevationBySurface failed, perhaps the point is outside the surface?" & vbLf)
8Else
9 Dim point As CogoPoint = TryCast(pointId.GetObject(OpenMode.ForRead), CogoPoint)
10 write("Point's new elevation from surface: " + point.Elevation)
11End If
12
13
14Dim pointCollection As New Point3dCollection()
15pointCollection.Add(New Point3d(100, 110, 0))
16pointCollection.Add(New Point3d(110, 100, 0))
17Dim pointIdCollection As ObjectIdCollection = cogoPoints.Add(pointCollection, "Example Points")
18Dim pointIdList As New List(Of ObjectId)()
19For Each id As ObjectId In pointIdCollection
20 pointIdList.Add(id)
21Next
22
23
24Dim successfullySetPoints As ObjectIdCollection = cogoPoints.SetElevationBySurface(pointIdList, tinSurfaceId)
No code example is currently available or this language may not be supported.
See Also