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

Provide CAD objects edition and utility methods. More...

Functions

Object Convert (SFeature feature)
 Convert a feature into a CAD object. More...
 
Object Discretize (SShape shape)
 Convert the SShape into a discretized SPoly and a discretized SMultiline. More...
 
Object Export (string filename, Array< SShape > compTable, SMatrix coordinateSystemMatrix=SMatrix())
 Export a table of CAD objects in a IGES or STEP file. More...
 
Object GetCOECoordinateSystems (string filename)
 Get the coordinate systems embedded in the given COE file. More...
 
Object Import (string filename)
 Import a IGES or STEP file into a CAD object. More...
 
Object ImportCOE (string filename, boolean groupByType=true, string UCSName="")
 Import a COE file. More...
 

Detailed Description

Provide CAD objects edition and utility methods.

Function Documentation

◆ Convert()

Object SCADUtil::Convert ( SFeature  feature)

Convert a feature into a CAD object.

License
This function requires the license AEC.
Parameters
feature(SFeature) The feature to convert
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.Shape(SShape) The converted CAD object.

◆ Discretize()

Object SCADUtil::Discretize ( SShape  shape)

Convert the SShape into a discretized SPoly and a discretized SMultiline.

Parameters
shape(SShape) The SShape to be discretized
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.Poly(SPoly) The discretized SPoly
ret.MultiTbl(Array<SMultiline>) The array of discretized SMultiline

◆ Export()

Object SCADUtil::Export ( string  filename,
Array< SShape compTable,
SMatrix  coordinateSystemMatrix = SMatrix() 
)

Export a table of CAD objects in a IGES or STEP file.

Parameters
filename(string) The IGES or STEP filename
compTable(Array<SShape>) The table of CAD objects to export
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: Not a IGES or STEP file name
  • 2: Not all the CAD objects can be saved
  • 3: An error occurred while saving the file

◆ GetCOECoordinateSystems()

Object SCADUtil::GetCOECoordinateSystems ( string  filename)

Get the coordinate systems embedded in the given COE file.

License
This function requires the license AEC or Plant.
See also
ImportCOE
Parameters
filename(string) The COE filename
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
  • 2: File was impossible to open
  • 3: An error occurred when reading the file
ret.StringTbl(Array<string>) The table of the coordinate system names

◆ Import()

Object SCADUtil::Import ( string  filename)

Import a IGES or STEP file into a CAD object.

Parameters
filename(string) The IGES or STEP filename
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: Not a IGES or STEP file name
  • 2: Failed to retrieve the file
  • 3: An error occurred while loading the file
  • 4: A general error occurred
ret.Shape(SShape) The imported CAD object.

◆ ImportCOE()

Object SCADUtil::ImportCOE ( string  filename,
boolean  groupByType = true,
string  UCSName = "" 
)

Import a COE file.

License
This function requires the license AEC or Plant.
var importRet = SCADUtil.ImportCOE("mycoefile.coe");
if(importRet.ErrorCode != 0)
throw new Error("An error occurred during the import");
for(var layerName in importRet.Layers)
{
var layerData = importRet.Layers[layerName];
Print(layerName + ":");
for(var tblName in layerData)
{
var compTbl = layerData[tblName];
Print("\t" + tblName + ": " + compTbl.length);
for(var comp of compTbl.values())
{
comp.AddToDoc();
comp.MoveToGroup("/" + layerName, false);
}
}
}
Provide CAD objects edition and utility methods.
Definition: Reshaper.h:12081
ZoomAll()
Do a zoom on all the visible SComp.
See also
GetCOECoordinateSystems
Parameters
filename(string) The COE filename
groupByType(boolean) Should we group all objects of the same COE type?
UCSName(string) The UCS name used for the import (or empty to use the WCS)
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
  • 2: File was impossible to open
  • 3: An error occurred when reading the file
  • 4: Import is not implemented for at least one object
ret.Layers(Array<Object>) Associative array containing all layers. Layer data can be accessed with its name like so: var layerData = Layers[layerName];
  • BSplineCurve3dTbl (Array<SShape>): The table of objects of COE type: "BSplineCurve3d"
  • CircularArc3dTbl (Array<SShape>): The table of objects of COE type: "CircularArc3d"
  • ConeTbl (Array<SShape>): The table of objects of COE type: "Cone"
  • CylinderTbl (Array<SShape>): The table of objects of COE type: "Cylinder"
  • ElbowTbl (Array<SShape>): The table of objects of COE type: "Elbow"
  • EllipticArc3dTbl (Array<SShape>): The table of objects of COE type: "EllipticArc3d"
  • FlangeTbl (Array<SShape>): The table of objects of COE type: "Flange"
  • Line3dTbl (Array<SShape>): The table of objects of COE type: "Line3d"
  • PlanarPatchTbl (Array<SShape>): The table of objects of COE type: "PlanarPatch"
  • PlanarPolyline3dTbl (Array<SShape>): The table of objects of COE type: "PlanarPolyline3d"
  • PlanarPolylineExtrusionTbl (Array<SShape>): The table of objects of COE type: "PlanarPolylineExtrusion"
  • Polyline3dTbl (Array<SMultiline>): The table of objects of COE type: "Polyline3d"
  • RectangularBoxTbl (Array<SShape>): The table of objects of COE type: "RectangularBox"
  • ReducerTbl (Array<SShape>): The table of objects of COE type: "Reducer"
  • ReducingElbowTbl (Array<SShape>): The table of objects of COE type: "ReducingElbow"
  • SphereTbl (Array<SShape>): The table of objects of COE type: "Sphere"
  • StdShapeTbl (Array<SShape>): The table of objects of COE type: "StdShape"
  • StdShapeExtrusionTbl (Array<SShape>): The table of objects of COE type: "StdShapeExtrusion"
  • SteelAngleTbl (Array<SShape>): The table of objects of COE type: "SteelAngle"
  • SteelBarTbl (Array<SShape>): The table of objects of COE type: "SteelBar"
  • SteelChannelTbl (Array<SShape>): The table of objects of COE type: "SteelChannel"
  • SteelRectangularTubeTbl (Array<SShape>): The table of objects of COE type: "SteelRectangularTube"
  • SteelTeeTbl (Array<SShape>): The table of objects of COE type: "SteelTee"
  • SteelWideFlangeTbl (Array<SShape>): The table of objects of COE type: "SteelWideFlange"
  • TeeTbl (Array<SShape>): The table of objects of COE type: "Tee"
  • TorusTbl (Array<SShape>): The table of objects of COE type: "Torus"
  • TriMeshTbl (Array<SPoly>): The table of objects of COE type: "TriMesh"
  • ValveTbl (Array<SShape>): The table of objects of COE type: "Valve"
  • Vertex3dTbl (Array<SPoint>): The table of objects of COE type: "Vertex3d"