CogoPointCollectionExportPoints(String, PointFileFormat, ObjectId) Method

Exports points in the specified PointGroup to a point file.

Namespace: Autodesk.Civil.DatabaseServices
Assembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.8.0.292
Syntax
public static uint ExportPoints(
	string pointFileFullName,
	PointFileFormat fileFormat,
	ObjectId pointGroupId
)

Parameters

pointFileFullName  String
The full path and name of the point file.
fileFormat  PointFileFormat
The file format for the point file. You can get a collection of supported point file formats by using GetPointFileFormats.
pointGroupId  ObjectId
The ObjectId of the PointGroup from which the CogoPoints are exported.

Return Value

UInt32
The count of CogoPoints that were exported.
Exceptions
ExceptionCondition
ArgumentException Thrown when:
  1. The directory for pointFileFullName does not exist.
  2. The pointGroupId is invalid.
InvalidOperationException Thrown when there is an internal error.
Remarks
  1. If the file specified by pointFileFullName already exists, it is overwritten.
  2. If the file specified by pointFileFullName does not exist, it is created automatically.
  3. Set the pointGroupId to ObjectId::Null to export all points.
Example
 1// Get a supported PointFileFormat to use:
 2//                                       
 3string pointFileName = "c:\\tmp\\Example ExportPointsFile - PENZD.txt";
 4string pointFileFormatName = "PENZD (space delimited)";
 5PointFileFormat pointFileFormat = PointFileFormatCollection.GetPointFileFormats(_acaddoc.Database)[pointFileFormatName];
 6
 7// Export all points in the document:
 8uint result = CogoPointCollection.ExportPoints(pointFileName, pointFileFormat);
 9write("# of exported points: " + result + "\n");
10
11// Same operation, but specify options:
12bool useAdjustedElevation = true;
13bool shouldTransformCoordinate = false;
14bool shouldExpandCoordinateData = true;
15result = CogoPointCollection.ExportPoints(pointFileName, pointFileFormat, useAdjustedElevation,
16    shouldTransformCoordinate, shouldExpandCoordinateData);
17write("# of exported points: " + result + "\n");
18
19// Specify a single point group 
20ObjectId pointGroupId = _civildoc.PointGroups[0];
21pointFileFormatName = "ENZ (comma delimited)";
22pointFileName = "c:\\tmp\\Example ExportPointsFile - ENZ.csv";
23
24result = CogoPointCollection.ExportPoints(pointFileName, pointFileFormat, pointGroupId);
25write("# of exported points: " + result + "\n");
26
27// Same operation, but specify options:
28result = CogoPointCollection.ExportPoints(pointFileName, pointFileFormat, useAdjustedElevation,
29    shouldTransformCoordinate, shouldExpandCoordinateData, pointGroupId);
30write("# of exported points: " + result + "\n");
See Also