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

Functions

static Array ExportCloud (SCloud iCloud, String iFileName, SMatrix iCoordinateSystemMatrix=SMatrix())
 Export clouds. Here if the full list of compatible format: More...
 
static Array ExportProject (String iFileName, Number iWhatToSave, Number iTextHeight, SMatrix iCoordinateSystemMatrix=SMatrix())
 To save all component of the current document. More...
 
static Array ExportProject (String iFileName,, Array< SComp > iTblElm, Number iTextHeight, SMatrix iCoordinateSystemMatrix=SMatrix())
 Save a table of SComp in a DXF file. More...
 
static Array GetNbTexture (String iFileName, 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 iFileName, Number iNbPtToKeep, Boolean iImportScanDir)
 Import clouds from supported files. Here if the full list of compatible format: More...
 
static Array ImportProject (String iFileName, Number iNbPtToKeep, Boolean iImportScanDir, Boolean iConvertCubicImagesToSpherical)
 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

Warning
How to use function from namespace SSurveyingFormat ?
Use name of the namespace before to call function.
SSurveyingFormat.OpenProject( 'C:\MyDxfFile.dxf' );
Definition: RshPluginSurveyingFormatScript.h:31

Function Documentation

◆ ExportCloud()

static Array SSurveyingFormat::ExportCloud ( SCloud  iCloud,
String  iFileName,
SMatrix  iCoordinateSystemMatrix = 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]iFileNameThe filename of the point cloud
iCoordinateSystemMatrixthe matrix to define a UCS used for the export (or identity to use the WCS)

◆ ExportProject() [1/2]

static Array SSurveyingFormat::ExportProject ( String  iFileName,
Number  iWhatToSave,
Number  iTextHeight,
SMatrix  iCoordinateSystemMatrix = 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
iFileNamefile name path
iWhatToSaveSave criteria = 0 all elements = 1 selected elements = 2 Only visible elements
iTextHeightStatic text height to use in DXF file (TextHeight > 0)
iCoordinateSystemMatrixthe matrix to define a UCS used for the export (or identity to use the WCS)

◆ ExportProject() [2/2]

static Array SSurveyingFormat::ExportProject ( String  iFileName,
Array< SComp iTblElm,
Number  iTextHeight,
SMatrix  iCoordinateSystemMatrix = 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
iTblElmTable of element to save
iTextHeightStatic text height to use in DXF file (Only if some text is exported) (TextHeight > 0)
iCoordinateSystemMatrixthe matrix to define a UCS used for the export (or identity to use the WCS)

◆ GetNbTexture()

static Array SSurveyingFormat::GetNbTexture ( String  iFileName,
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]iFileNamelandXml 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  iFileName,
Number  iNbPtToKeep,
Boolean  iImportScanDir 
)
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]iFileNameThe filename of the point cloud
[in]iNbPtToKeepThe maximum number of points to load (in case of memory save), or 0 if unlimited
[in]iImportScanDirShould we import scanning direction if exists?

◆ ImportProject()

static Array SSurveyingFormat::ImportProject ( String  iFileName,
Number  iNbPtToKeep,
Boolean  iImportScanDir,
Boolean  iConvertCubicImagesToSpherical 
)
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 occurred 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]iFileNameThe filename of the point cloud
[in]iNbPtToKeepThe maximum number of points to load (in case of memory save), or 0 if unlimited
[in]iImportScanDirShould we import scanning direction if exists?
[in]iConvertCubicImagesToSphericalShould convert cubic images sets (cubefaces) into spherical images, if any

◆ toString()

String SSurveyingFormat::toString ( )

Get the type of the variable.