CogoPointCollectionGetPointByPointNumber Method

Gets the ObjectId of a CogoPoint by a given pointNumber.

Namespace: Autodesk.Civil.DatabaseServices
Assembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.8.0.292
Syntax
public ObjectId GetPointByPointNumber(
	uint pointNumber
)

Parameters

pointNumber  UInt32
The point number to get.

Return Value

ObjectId
The ObjectId of the CogoPoint with the given pointNumber, if it exists.
Exceptions
ExceptionCondition
ArgumentException Thrown when the collection doesn't contain a CogoPoint with the given pointNumber.
Remarks
Use the Contains(UInt32) method to determine whether the collection contains a point with the given point number.
Example
 1// _civildoc is the active CivilDocument instance.
 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}
See Also