CogoPointCollectionGetPointByPointNumber Method |
Gets the ObjectId of a CogoPoint by a given pointNumber.
Namespace: Autodesk.Civil.DatabaseServicesAssembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.8.0.292
Syntaxpublic ObjectId GetPointByPointNumber(
uint pointNumber
)
Public Function GetPointByPointNumber (
pointNumber As UInteger
) As ObjectId
public:
ObjectId GetPointByPointNumber(
unsigned int pointNumber
)
Parameters
- pointNumber UInt32
- The point number to get.
Return Value
ObjectIdThe ObjectId of the CogoPoint with the given pointNumber, if it exists.
ExceptionsException | Condition |
---|
ArgumentException |
Thrown when the collection doesn't contain a CogoPoint with the given pointNumber.
|
RemarksUse the
Contains(UInt32) method to determine whether the collection contains a point with the given point number.
Example 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}
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)
No code example is currently available or this language may not be supported.
See Also