Cyclone 3DR Script
from Technodigit, part of Hexagon. Copyright 1997-2021.
SSurveyingFormat Namespace Reference

This function are only available if you have Surveying Format plugin.
. More...

Functions

static Array ExportCloud (SCloud iCloud, String FileName, SMatrix CoordinateSystemMatrix=SMatrix())
 Export clouds. Here if the full list of compatible format: More...
 
static Array ExportProject (String FileName, Number WhatToSave, Number TextHeight, SMatrix CoordinateSystemMatrix=SMatrix())
 To save all component of the current document. More...
 
static Array ExportProject (String FileName,, Array< SComp > TblElm, Number TextHeight, SMatrix CoordinateSystemMatrix=SMatrix())
 Save a table of SComp in a DXF file. More...
 
static Array GetNbTexture (String FileName, Boolean iConvertCube2Spherical)
 To get number of texture only for *.Xml(landXml)|*.e57 files. More...
 
static String GetType ()
 To return the type of the object. More...
 
static Array ImportCloud (String FileName, Number NbPtToKeep, Boolean importScanDir)
 Import clouds from supported files. Here if the full list of compatible format: More...
 
static Array ImportProject (String FileName, Number NbPtToKeep, Boolean importScanDir, Boolean convertCubicImagesToSpherical)
 Import data from a (LandXml, Dwg, Dxf, e57) file. Example of how to use this function: More...
 
String toString ()
 Get the type of the variable. More...
 

Detailed Description

This function are only available if you have Surveying Format plugin.
.

Warning
How to use function from namespace SSurveyingFormat ?
Use name of the namespace before to call function.
SSurveyingFormat.OpenProject( 'C:\MyDxfFile.dxf' );
This function are only available if you have Surveying Format plugin. .
Definition: RshPluginSurveyingFormatScript.h:33

Function Documentation

◆ ExportCloud()

static Array SSurveyingFormat::ExportCloud ( SCloud  iCloud,
String  FileName,
SMatrix  CoordinateSystemMatrix = SMatrix() 
)
static

Export clouds. Here if the full list of compatible format:

  • LAS File (*.las)
  • LAZ File (*.laz)
  • ASTM E57 3D Image File (*.e57)
    Warning
    In Javascript, when you write strings the '\' character is an escape character, you need to use '\\' or '/' instead. Pay especially attention to this when writing file paths in your scripts. For example :
    var res = SSurveyingFormat.ExportCloud( 'C:/CloudFile.e57', ... ); // Valid syntax\n
    Return values
    ErrorCodeThe error code:

0 No error occurred.

  • 1 An error occurred during the export.
Parameters
[in]iCloudThe cloud to export
[in]FileNameThe filename of the point cloud
CoordinateSystemMatrixthe matrix to define a UCS used for the export (or identity to use the WCS)

◆ ExportProject() [1/2]

static Array SSurveyingFormat::ExportProject ( String  FileName,
Number  WhatToSave,
Number  TextHeight,
SMatrix  CoordinateSystemMatrix = SMatrix() 
)
static

To save all component of the current document.

Return values
0OK
1The output file could not be opened.
2Demo version => partial save.
3No save. Current license do not authorize saving.
4An exception occurred.
5All elements are not saved (all elements not supported)
Parameters
FileNamefile name path
WhatToSaveSave criteria = 0 all elements = 1 selected elements = 2 Only visible elements
TextHeightStatic text height to use in DXF file (TextHeight > 0)
CoordinateSystemMatrixthe matrix to define a UCS used for the export (or identity to use the WCS)

◆ ExportProject() [2/2]

static Array SSurveyingFormat::ExportProject ( String  FileName,
Array< SComp TblElm,
Number  TextHeight,
SMatrix  CoordinateSystemMatrix = SMatrix() 
)
static

Save a table of SComp in a DXF file.

Return values
Array.ErrorCodeThe error code:
  • 0: OK
  • 1: The output file could not be opened.
  • 2: Demo version => partial save.
  • 3: No save. Current license do not authorize saving.
  • 4: An exception occurred.
  • 5: All elements are not saved (all elements not supported)
Parameters
TblElmTable of element to save
TextHeightStatic text height to use in DXF file (Only if some text is exported) (TextHeight > 0)
CoordinateSystemMatrixthe matrix to define a UCS used for the export (or identity to use the WCS)

◆ GetNbTexture()

static Array SSurveyingFormat::GetNbTexture ( String  FileName,
Boolean  iConvertCube2Spherical 
)
static

To get number of texture only for *.Xml(landXml)|*.e57 files.

Warning
option iConvertCube2Spherical must have the same value in GetNbTexture and ApplyTexture
Return values
Array.ErrorCodeThe error code:
  • 0: Success.
  • 1: An error occurred during the import.
  • 2: An error occurred during the import: invalid path
  • 3: An error occurred during the import: not the right xml format (not valid according to xsd)
  • 4: No error but At least one image file contained in the land Xml file was not found.
Array.ValueThe number of texture contained inside the file.
Parameters
[in]FileNamelandXml or e57 filename
[in]iConvertCube2Sphericalif true and e57 file contains CubeFace images, Cubeface images will be converted to spherical images

◆ GetType()

static String SSurveyingFormat::GetType ( )
static

To return the type of the object.

◆ ImportCloud()

static Array SSurveyingFormat::ImportCloud ( String  FileName,
Number  NbPtToKeep,
Boolean  importScanDir 
)
static

Import clouds from supported files. Here if the full list of compatible format:

  • Leica PTX ASCII Gridded Interchange Format (*.ptx)
  • ASTM E57 3D Image File (*.e57)
  • LeicaGeosystems SDB Reader (*.sdb)
  • Zoller and Frï¿œhlich ZFS Uncompressed Scan Data (*.zfs)
  • DotProduct File(*.dp)
  • LAS/LAZ File (*.las or *.laz)
  • Riegl File (*.rdbx)
    Note
    For PTS file, use directly SCloud:FromFile() function
    Warning
    In Javascript, when you write strings the '\' character is an escape character, you need to use '\\' or '/' instead. Pay especially attention to this when writing file paths in your scripts. For example :
    var res = SSurveyingFormat.ImportCloud( 'C:/CloudFile.e57' ); // Valid syntax\n
    Return values
    Array.ErrorCodeThe error code:

0 No error occurred.

  • 1 An error occurred during the import.
    Return values
    Array.CloudTbltable of each SCloud inside the file
Parameters
[in]FileNameThe filename of the point cloud
[in]NbPtToKeepThe maximum number of points to load (in case of memory save), or 0 if unlimited
[in]importScanDirShould we import scanning direction if exists?

◆ ImportProject()

static Array SSurveyingFormat::ImportProject ( String  FileName,
Number  NbPtToKeep,
Boolean  importScanDir,
Boolean  convertCubicImagesToSpherical 
)
static

Import data from a (LandXml, Dwg, Dxf, e57) file. Example of how to use this function:

var Theoric = SSurveyingFormat.ImportProject('D:/theoric.dxf', 0, true);
if(Theoric.ErrorCode) print("An error occured during the import");
//point clouds
for(i = 0; i < Theoric.CloudTbl.length; i++) Theoric.CloudTbl[i].AddToDoc();
//meshes
for(i = 0; i < Theoric.PolyTbl.length; i++) Theoric.PolyTbl[i].AddToDoc();
//3d polylines
for(i = 0; i < Theoric.MultiTbl.length; i++) Theoric.MultiTbl[i].AddToDoc();
//points
for(i = 0; i < Theoric.PointTbl.length; i++) Theoric.PointTbl[i].AddToDoc();
//set of 3d polylines
for(i = 0; i < Theoric.SetMultiTbl.length; i++) Theoric.SetMultiTbl[i].AddToDoc();
//circles
for(i = 0; i < Theoric.CircleTbl.length; i++) Theoric.CircleTbl[i].AddToDoc();
//planes
for(i = 0; i < Theoric.PlaneTbl.length; i++) Theoric.PlaneTbl[i].AddToDoc();
//cylinders
for(i = 0; i < Theoric.CylinderTbl.length; i++) Theoric.CylinderTbl[i].AddToDoc();
//cones
for(i = 0; i < Theoric.ConeTbl.length; i++) Theoric.ConeTbl[i].AddToDoc();
//lines
for(i = 0; i < Theoric.LineTbl.length; i++) Theoric.LineTbl[i].AddToDoc();
//spheres
for(i = 0; i < Theoric.SphereTbl.length; i++) Theoric.SphereTbl[i].AddToDoc();
//round slots
for(i = 0; i < Theoric.RoundSlotTbl.length; i++) Theoric.RoundSlotTbl[i].AddToDoc();
//square slots
for(i = 0; i < Theoric.SquareSlotTbl.length; i++) Theoric.SquareSlotTbl[i].AddToDoc();
//images
for(i = 0; i < Theoric.ImageTbl.length; i++) Theoric.ImageTbl[i].AddToDoc();
//shapes
for(i = 0; i < Theoric.ShapeTbl.length; i++) Theoric.ShapeTbl[i].AddToDoc();
Warning
In Javascript, when you write strings the '\' character is an escape character, you need to use '\\' or '/' instead. Pay especially attention to this when writing file paths in your scripts. For example :
var res = SSurveyingFormat.ImportProject( 'C:/ProjectFile.dxf' ); // Valid syntax\n
var res2 = SSurveyingFormat.ImportProject( 'C:\\ProjectFile.dxf' ); // Valid syntax\n
var res3 = SSurveyingFormat.ImportProject( 'C:\ProjectFile.dxf' ); // Invalid syntax
Return values
Array.ErrorCodeThe error code:
  • 0 No error occurred.
  • 1 An error occurred during the import.
Array.CloudTbltable of each SCloud inside the project
Array.PolyTbltable of each SPoly inside the project
Array.MultiTbltable of SMultiline
Array.PointTbltable of SPoint
Array.SetMultiTbltable of SSetMultiline
Array.ImageTbltable of SImage
Array.CircleTbltable of SCircle
Array.PlaneTbltable of SPlane
Array.CylinderTbltable of SCylinder
Array.ConeTbltable of SCone
Array.LineTbltable of SLine
Array.SphereTbltable of SSphere
Array.RoundSlotTbltable of SRoundSlot
Array.SquareSlotTbltable of SSquareSlot
Array.ShapeTbltable of SShape
Parameters
[in]FileNameThe filename of the point cloud
[in]NbPtToKeepThe maximum number of points to load (in case of memory save), or 0 if unlimited
[in]importScanDirShould we import scanning direction if exists?
[in]convertCubicImagesToSphericalShould convert cubic images sets (cubefaces) into spherical images, if any

◆ toString()

String SSurveyingFormat::toString ( )

Get the type of the variable.