Gets the ObjectId of a CogoPoint by a given pointNumber.
Namespace: Autodesk.Civil.DatabaseServicesAssembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.4.2516.0
Syntax
C# |
---|
public ObjectId GetPointByPointNumber(
uint pointNumber
) |
Visual Basic |
---|
Public Function GetPointByPointNumber ( _
pointNumber As UInteger _
) As ObjectId |
Visual C++ |
---|
public:
ObjectId GetPointByPointNumber(
unsigned int pointNumber
) |
Parameters
- pointNumber
- Type: System..::..UInt32
The point number to get.
Return Value
The ObjectId of the CogoPoint with the given pointNumber, if it exists.
Remarks
Examples
CopyC#
1
2CogoPointCollection cogoPoints = _civildoc.CogoPoints;
3uint pointNumber = 1;
4try
5{
6 ObjectId pointId = cogoPoints.GetPointByPointNumber(pointNumber);
7 CogoPoint cogoPoint = pointId.GetObject(OpenMode.ForRead) as CogoPoint;
8 write("Point number: " + cogoPoint.PointNumber + ", point name: " + cogoPoint.PointName);
9}
10catch (System.ArgumentException e)
11{
12 write("Document does not contain a point with PointNumber == " + pointNumber);
13}
CopyVB.NET
1
2Dim cogoPoints As CogoPointCollection = _civildoc.CogoPoints
3Dim pointNumber As UInteger = 1
4Try
5 Dim pointId As ObjectId = cogoPoints.GetPointByPointNumber(pointNumber)
6 Dim cogoPoint As CogoPoint = TryCast(pointId.GetObject(OpenMode.ForRead), CogoPoint)
7 write(("Point number: " + cogoPoint.PointNumber & ", point name: ") + cogoPoint.PointName)
8Catch e As System.ArgumentException
9 write("Document does not contain a point with PointNumber == " & pointNumber)
Exceptions
Exception | Condition |
---|
System..::..ArgumentException |
Thrown when the collection doesn't contain a CogoPoint with the given pointNumber.
|
See Also