Cyclone 3DR Script
from Technodigit, part of Hexagon. Copyright 1997-2023.
Loading...
Searching...
No Matches
SSurveyingFormat Namespace Reference

Provide various export and import methods. More...

Enumerations

enum  E57DataType { TLS = 0 , MMS = 1 , Mixed = 2 }
 Type describing how the data has been scanned. More...
 

Functions

Object ExportCloud (SCloud cloud, string fileName, SMatrix coordinateSystemMatrix=SMatrix(), boolean exportLASZClassifColor=false)
 Export a SCloud to LAS File (*.las), LAZ File (*.laz) or ASTM E57 3D Image File (*.e57) More...
 
Object ExportE57 (Array< SCloud > clouds, Array< SImage > images, string filePath)
 Export clouds and/or images in e57. More...
 
Object ExportProject (string fileName, Array< SComp > elementsToExport, number textHeight=1, SMatrix coordinateSystemMatrix=SMatrix())
 Save a table of SComp in a DXF file. More...
 
Object ExportProject (string fileName, number whatToSave=0, number textHeight=1, SMatrix coordinateSystemMatrix=SMatrix())
 Save all components of the current document in a DXF file. More...
 
Object GetNbTexture (string fileName, boolean convertCubicImagesToSpherical=false)
 Get the number of textures in a *.xml (LandXML) or *.e57 file. More...
 
Object ImportCloud (string fileName, number nbPtToKeep=6000000, boolean importScanDir=true)
 Import clouds from supported files. More...
 
Object ImportE57 (string filePath, boolean importClouds=true, boolean importedImages=true, E57DataType cloudDataType=SSurveyingFormat.TLS, number nbPtToKeep=6000000, boolean convertCubicImagesToSpherical=true)
 Import clouds and/or images from e57 files. More...
 
Object ImportProject (string fileName, number nbPtToKeep=6000000, boolean importScanDir=true, boolean convertCubicImagesToSpherical=true)
 Import data from a (LandXML, Dwg, Dxf, e57) file. More...
 

Detailed Description

Provide various export and import methods.

Enumeration Type Documentation

◆ E57DataType

Type describing how the data has been scanned.

Enumerator
TLS 

Cloud scanned with a TLS.

MMS 

Cloud scanned with a MMS.

Mixed 

No information on the type of cloud.

Function Documentation

◆ ExportCloud()

Object SSurveyingFormat::ExportCloud ( SCloud  cloud,
string  fileName,
SMatrix  coordinateSystemMatrix = SMatrix(),
boolean  exportLASZClassifColor = false 
)

Export a SCloud to LAS File (*.las), LAZ File (*.laz) or ASTM E57 3D Image File (*.e57)

Warning
When you write a '\' in string you need to double it '\\' or use '/' instead. Pay especially attention to this when writing file paths in your scripts.
var path = 'C:/Point.asc'; // valid syntax
var path = 'C:\\Point.asc'; // valid syntax
var path = 'C:\Point.asc'; // invalid syntax
Parameters
cloud(SCloud) The SCloud to export
fileName(string) The path and name of the file to save
coordinateSystemMatrix(SMatrix) The matrix to define a UCS used for the export (or identity to use the WCS)
exportLASZClassifColor(boolean) If set to true, uses the classification colors (possibly instead of the real colors) when exporting to LAS/LAZ file formats
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred

◆ ExportE57()

Object SSurveyingFormat::ExportE57 ( Array< SCloud clouds,
Array< SImage images,
string  filePath 
)

Export clouds and/or images in e57.

Warning
When you write a '\' in string you need to double it '\\' or use '/' instead. Pay especially attention to this when writing file paths in your scripts.
var path = 'C:/Point.asc'; // valid syntax
var path = 'C:\\Point.asc'; // valid syntax
var path = 'C:\Point.asc'; // invalid syntax
Parameters
clouds(Array<SCloud>) Table of clouds to export
images(Array<SImage>) Table of images to export
filePath(string) The path of the e57 file to export
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: Save not authorized
  • 2: File permission denied
  • 3: An error occurred

◆ ExportProject() [1/2]

Object SSurveyingFormat::ExportProject ( string  fileName,
Array< SComp elementsToExport,
number  textHeight = 1,
SMatrix  coordinateSystemMatrix = SMatrix() 
)

Save a table of SComp in a DXF file.

Parameters
fileName(string) The path and name of the file to save
elementsToExport(Array<SComp>) The table of elements to save
textHeight(number) The static text height to use in the DXF file (TextHeight > 0)
coordinateSystemMatrix(SMatrix) The matrix to define a UCS used for the export (or identity to use the WCS)
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: The output file could not be opened
  • 4: An error occurred
  • 5: Some elements have not been saved (they are not supported)

◆ ExportProject() [2/2]

Object SSurveyingFormat::ExportProject ( string  fileName,
number  whatToSave = 0,
number  textHeight = 1,
SMatrix  coordinateSystemMatrix = SMatrix() 
)

Save all components of the current document in a DXF file.

Parameters
fileName(string) The path and name of the file to save
whatToSave(number) Save criteria
  • 0: All the elements
  • 1: The selected elements
  • 2: Only the visible elements
textHeight(number) The static text height to use in the DXF file (TextHeight > 0)
coordinateSystemMatrix(SMatrix) The matrix to define a UCS used for the export (or identity to use the WCS)
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: The output file could not be opened
  • 4: An error occurred
  • 5: Some elements have not been saved (they are not supported)

◆ GetNbTexture()

Object SSurveyingFormat::GetNbTexture ( string  fileName,
boolean  convertCubicImagesToSpherical = false 
)

Get the number of textures in a *.xml (LandXML) or *.e57 file.

Parameters
fileName(string) The LandXML or e57 filename
convertCubicImagesToSpherical(boolean) If true, cubic images sets in e57 (cubefaces), if any, are converted into spherical images
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
  • 2: The file path is invalid
  • 3: The xml file has not the right format (not valid according to the xsd)
  • 4: No error, but at least one image contained in the LandXML file was not found
ret.Value(number) The number of textures contained inside the file

◆ ImportCloud()

Object SSurveyingFormat::ImportCloud ( string  fileName,
number  nbPtToKeep = 6000000,
boolean  importScanDir = true 
)

Import clouds from supported files.

Note
Here is the full list of compatible formats:
* Leica PTX ASCII Gridded Interchange Format (*.ptx)
* ASTM E57 3D Image File (*.e57)
* LeicaGeosystems SDB Reader (*.sdb)
* Zoller and Frohlich ZFS Uncompressed Scan Data (*.zfs)
* DotProduct File(*.dp)
* LAS/LAZ File (*.las or *.laz)
* Riegl File (*.rdbx)
For PTS file, use directly SCloud.FromFile() function
Warning
When you write a '\' in string you need to double it '\\' or use '/' instead. Pay especially attention to this when writing file paths in your scripts.
var path = 'C:/Point.asc'; // valid syntax
var path = 'C:\\Point.asc'; // valid syntax
var path = 'C:\Point.asc'; // invalid syntax
Parameters
fileName(string) The path and name of the file to import
nbPtToKeep(number) The maximum number of points to import (in case of memory save), or 0 if unlimited
importScanDir(boolean) If true, import scan directions (if they exist); else, ignore scan directions
For .e57 files, this parameter is interpreted as "isTLSData"
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.CloudTbl(Array<SCloud>) The table of SCloud inside the file

◆ ImportE57()

Object SSurveyingFormat::ImportE57 ( string  filePath,
boolean  importClouds = true,
boolean  importedImages = true,
E57DataType  cloudDataType = SSurveyingFormat.TLS,
number  nbPtToKeep = 6000000,
boolean  convertCubicImagesToSpherical = true 
)

Import clouds and/or images from e57 files.

Warning
When you write a '\' in string you need to double it '\\' or use '/' instead. Pay especially attention to this when writing file paths in your scripts.
var path = 'C:/Point.asc'; // valid syntax
var path = 'C:\\Point.asc'; // valid syntax
var path = 'C:\Point.asc'; // invalid syntax
Parameters
filePath(string) The path of the e57 file to import
importClouds(boolean) To import clouds
importedImages(boolean) To import images
cloudDataType(E57DataType) To provide information on the expected cloud data type
nbPtToKeep(number) The maximum number of points per setup to import (in case of memory save), or 0 if unlimited
convertCubicImagesToSpherical(boolean) If true, cubic images sets (cubefaces), if any, are converted into spherical images
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An exception occurred
  • 2: Wrong file path
  • 3: Error while loading clouds
  • 4: Error while loading images
ret.CloudTbl(Array<SCloud>) The table of SCloud inside the file
ret.ImageTbl(Array<SImage>) The table of SImage inside the file
ret.CloudTypeTbl(Array<E57DataType>) The cloud data type

◆ ImportProject()

Object SSurveyingFormat::ImportProject ( string  fileName,
number  nbPtToKeep = 6000000,
boolean  importScanDir = true,
boolean  convertCubicImagesToSpherical = true 
)

Import data from a (LandXML, Dwg, Dxf, e57) file.

License
DWG import: this function requires the license AEC.
Note
Example of how to use this function:
var importResult = SSurveyingFormat.ImportProject('D:/ImportResult.dxf', 0, true, false);
if(importResult.ErrorCode != 0)
print("An error occurred during the import");
// Point clouds
for(i = 0; i < importResult.CloudTbl.length; i++)
importResult.CloudTbl[i].AddToDoc();
// Meshes
for(i = 0; i < importResult.PolyTbl.length; i++)
importResult.PolyTbl[i].AddToDoc();
// 3d polylines
for(i = 0; i < importResult.MultiTbl.length; i++)
importResult.MultiTbl[i].AddToDoc();
// Circles
for(i = 0; i < importResult.CircleTbl.length; i++)
importResult.CircleTbl[i].AddToDoc();
// Images
for(i = 0; i < importResult.ImageTbl.length; i++)
importResult.ImageTbl[i].AddToDoc();
// Shapes
for(i = 0; i < importResult.ShapeTbl.length; i++)
importResult.ShapeTbl[i].AddToDoc();
Provide various export and import methods.
Definition: Reshaper.h:11923
Warning
When you write a '\' in string you need to double it '\\' or use '/' instead. Pay especially attention to this when writing file paths in your scripts.
var path = 'C:/Point.asc'; // valid syntax
var path = 'C:\\Point.asc'; // valid syntax
var path = 'C:\Point.asc'; // invalid syntax
Parameters
fileName(string) The path and name of the project to import
nbPtToKeep(number) The maximum number of points to import (in case of memory save), or 0 if unlimited
importScanDir(boolean) If true, import scan directions (if they exist); else, ignore scan directions
For .e57 files, this parameter is interpreted as "isTLSData"
convertCubicImagesToSpherical(boolean) If true, cubic images sets (cubefaces), if any, are converted into spherical images
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.CloudTbl(Array<SCloud>) The table of SCloud inside the project
ret.PolyTbl(Array<SPoly>) The table of SPoly inside the project
ret.MultiTbl(Array<SMultiline>) The table of SMultiline inside the project
ret.PointTbl(Array<SPoint>) The table of SPoint inside the project
ret.SetMultiTbl(Array<SSetMultiline>) The table of SSetMultiline inside the project
ret.ImageTbl(Array<SImage>) The table of SImage inside the project
ret.CircleTbl(Array<SCircle>) The table of SCircle inside the project
ret.PlaneTbl(Array<SPlane>) The table of SPlane inside the project
ret.CylinderTbl(Array<SCylinder>) The table of SCylinder inside the project
ret.ConeTbl(Array<SCone>) The table of SCone inside the project
ret.LineTbl(Array<SLine>) The table of SLine inside the project
ret.SphereTbl(Array<SSphere>) The table of SSphere inside the project
ret.RoundSlotTbl(Array<SRoundSlot>) The table of SRoundSlot inside the project
ret.SquareSlotTbl(Array<SSquareSlot>) The table of SSquareSlot inside the project
ret.ShapeTbl(Array<SShape>) The table of SShape inside the project