SurfaceDefinitionPointFilesAddPointFile(String, PointFileFormat) Method

Adds points from a point file to the surface.

Namespace: Autodesk.Civil.DatabaseServices
Assembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.8.0.292
Syntax
public SurfaceOperationAddPointFile AddPointFile(
	string pointFilename,
	PointFileFormat pointFileFormat
)

Parameters

pointFilename  String
The full path and name of the point file.
pointFileFormat  PointFileFormat
The file format for the point file. You can get a collection of supported point file formats by using PointFileFormatCollection.GetPointFileFormats().

Return Value

SurfaceOperationAddPointFile
Exceptions
ExceptionCondition
ArgumentException Thrown when:
  1. The point file content doesn't match the specified point file format.
Example
 1// Setup: create an empty TIN surface:
 2// 
 3ObjectId surfaceId = TinSurface.Create(_acaddoc.Database, "Example Surface");
 4TinSurface surface = surfaceId.GetObject(OpenMode.ForWrite) as TinSurface;
 5
 6// These point files are included as examples for Civil 3D tutorials:
 7string pointFilePath = @"C:\Program Files\Autodesk\AutoCAD Civil 3D 2013\Help\Civil Tutorials\";
 8string pointFileName = pointFilePath + "Existing Ground Points - PENZD.txt";
 9string pointFileFormatName = "PENZD (space delimited)";
10PointFileFormat pointFileFormat = PointFileFormatCollection.GetPointFileFormats(_acaddoc.Database)[pointFileFormatName];
11
12surface.PointFilesDefinition.AddPointFile(pointFileName, pointFileFormat);
13
14// You can also specify various options for adjusting elevation and transforming
15// coordinates:
16// 
17surfaceId = TinSurface.Create(_acaddoc.Database, "Example Surface 2");
18surface = surfaceId.GetObject(OpenMode.ForWrite) as TinSurface;
19pointFileName = pointFilePath + "LIDAR_ENZ (comma delimited).csv";
20pointFileFormatName = "ENZ (comma delimited)";
21pointFileFormat = PointFileFormatCollection.GetPointFileFormats(_acaddoc.Database)[pointFileFormatName];
22bool useAdjustedElevation = true;
23bool shouldTransformPointCoordinate = false;
24bool shouldExpandCoordinateData = false;
25surface.PointFilesDefinition.AddPointFile(pointFileName, pointFileFormat, 
26    useAdjustedElevation, shouldTransformPointCoordinate, shouldExpandCoordinateData);
See Also