Share

CogoPointCollection.ImportPoints(String, PointFileFormat, Boolean, Boolean, Boolean, ObjectId) Method

Imports points from a point file to an existing PointGroup with advanced options.



Namespace: Autodesk.Civil.DatabaseServices
Assembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.8.0.280

Syntax

C#

public static uint ImportPoints(
	string pointFileFullName,
	PointFileFormat fileFormat,
	bool useAdjustedElevation,
	bool shouldTransformCoordinate,
	bool shouldExpandCoordinateData,
	ObjectId pointGroupId
)

VB

Public Shared Function ImportPoints ( 
	pointFileFullName As String,
	fileFormat As PointFileFormat,
	useAdjustedElevation As Boolean,
	shouldTransformCoordinate As Boolean,
	shouldExpandCoordinateData As Boolean,
	pointGroupId As ObjectId
) As UInteger

C++

public:
static unsigned int ImportPoints(
	String^ pointFileFullName, 
	PointFileFormat^ fileFormat, 
	bool useAdjustedElevation, 
	bool shouldTransformCoordinate, 
	bool shouldExpandCoordinateData, 
	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.
useAdjustedElevation  Boolean
Specifies whether to adjust the point elevation values.
shouldTransformCoordinate  Boolean
Specifies whether to transform the points in the file.
shouldExpandCoordinateData  Boolean
Specifies whether to calculate the coordinate data properties of the points, such as degrees, minutes, seconds, and hemisphere for latitude and longitude.
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

  1. useAdjustedElevation and shouldExpandCoordinateData are disregarded if they are not supported by the specified point file format.
  2. Set the pointGroupId to ObjectId::Null to specify that the imported points are not added to a PointGroup.

Example

C#

 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");
 7bool useAdjustedElevation = true;
 8bool shouldTransformCoordinate = true;
 9bool shouldExpandCoordinateData = true;
10
11uint result = CogoPointCollection.ImportPoints(pointFileName, pointFileFormat,
12    useAdjustedElevation, shouldTransformCoordinate, shouldExpandCoordinateData, pointGroupId);
13write("Successfully imported " + result + " points\n");

VB

 1' This point file is included as a sample for Civil 3D tutorials:
 2Dim pointFilePath As String = "C:\Program Files\Autodesk\AutoCAD Civil 3D 2013\Help\Civil Tutorials\"
 3Dim pointFileName As String = pointFilePath & "Existing Ground Points - PENZD.txt"
 4Dim pointFileFormatName As String = "PENZD (space delimited)"
 5Dim pointFileFormat As PointFileFormat = PointFileFormatCollection.GetPointFileFormats(_acaddoc.Database)(pointFileFormatName)
 6Dim pointGroupId As ObjectId = _civildoc.PointGroups.Add("Example Point Group")
 7Dim useAdjustedElevation As Boolean = True
 8Dim shouldTransformCoordinate As Boolean = True
 9Dim shouldExpandCoordinateData As Boolean = True
10
11Dim result As UInteger = CogoPointCollection.ImportPoints(pointFileName, pointFileFormat, useAdjustedElevation, shouldTransformCoordinate, shouldExpandCoordinateData, pointGroupId)
12write("Successfully imported " & result & " points" & vbLf)

See Also

Reference

Was this information helpful?