CogoPointCollectionImportPoints(String, PointFileFormat, ObjectId) Method

Imports points from a point file to an existing PointGroup.

Namespace: Autodesk.Civil.DatabaseServices
Assembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.8.0.292
Syntax
public static uint ImportPoints(
	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 into which the CogoPoints are imported.

Return Value

UInt32
The count of CogoPoints that were imported.
Exceptions
ExceptionCondition
ArgumentException Thrown when:
  1. The pointFileFullName does not exist.
  2. The point file content doesn't match the specified point file format.
  3. The PointGroupId is invalid.
Remarks
Set the pointGroupId to ObjectId::Null to specify that the imported points are not added to a PointGroup.
Example
1// This point file is included as a sample for Civil 3D tutorials:
2string pointFilePath = @"C:\Program Files\Autodesk\AutoCAD Civil 3D 2013\Help\Civil Tutorials\";
3string pointFileName = pointFilePath + "Existing Ground Points - PENZD.txt";
4string pointFileFormatName = "PENZD (space delimited)";
5PointFileFormat pointFileFormat = PointFileFormatCollection.GetPointFileFormats(_acaddoc.Database)[pointFileFormatName];
6ObjectId pointGroupId = _civildoc.PointGroups.Add("Example Point Group");
7
8uint result = CogoPointCollection.ImportPoints(pointFileName, pointFileFormat, pointGroupId);
9write("Successfully imported " + result + " points\n");
See Also