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

BIM manipulation class. The SBIM creation can be done by calling the static function New() to copy an existing SBIM. More...

#include <SBim.h>

Inheritance diagram for SBIM:
SComp SObject

Public Types

enum  BIMRepresentationTypeEnum { BIM_FLAT , BIM_COLOR }
 The different representation types for BIM object.
Use SBIM.BIM_COLOR. More...
 
- Public Types inherited from SComp
enum  RepresentationTypeEnum {
  SMOOTH , FLAT , WIRE , SMOOTH_WIRE ,
  FLAT_WIRE , SMOOTH_ROTWIRE , FLAT_ROTWIRE , TEXTURE ,
  INSPECTION
}
 The different representation types for inherited classes.
Use (inherited class).SMOOTH. Example: for a cloud, use SCloud.SMOOTH. More...
 

Public Slots

static Array All (Number VisCrit)
 To get all the SBIM in the document. More...
 
Array ApplyFilter (String iFilter="", QStringList iStoreyNames={})
 Edit content of the BIM with given filters. More...
 
Array ConvertPolys ()
 Convert all filtered geometries into a table of mesh. More...
 
static Array FromClick ()
 Launches a click interaction to select a SBIM in the scene. More...
 
static Array FromFile (String iFilename, String iFilter="", QStringList iStoreyNames={})
 Import a BIM file (.rvt, .ifc) and apply filters. More...
 
static Array FromName (String Name)
 Search all the SBIM with the given name. More...
 
static Array FromSel ()
 To get all the selected SBIM. More...
 
static Array GetMetadata (SPoly iMesh)
 Get all metadata associated to the given mesh as list of key and value for each metadata. More...
 
static SBIM New (SBIM Other)
 Constructs an SBIM by copying the SBIM Other. More...
 
 SetBIMRepresentation (BIMRepresentationTypeEnum iRepresentation)
 The representation of the component is modified. More...
 
String toString ()
 Get the type of the variable. More...
 
static String toString ()
 Get the type of the variable. More...
 
- Public Slots inherited from SComp
 AddToDoc ()
 To add the object to the document. More...
 
static Array All (Number VisCrit)
 To get all the SComp in the document. More...
 
 ApplyTransformation (SMatrix iMatrix)
 To apply a geometric transformation to the current object by making a product with the given matrix. More...
 
 Clear ()
 To deallocate object memory. More...
 
static Array FromClick ()
 Launches a click interaction to select a SComp in the scene. More...
 
static Array FromName (String Name)
 Search all the component with the given name. More...
 
static Array FromSel ()
 To get all the selected SComp. More...
 
Array GetBoundingBox ()
 Calculates the bounding box of the component. More...
 
Array GetColors ()
 To get the colors of the component. More...
 
String GetFolderName ()
 The component containing folder's name. More...
 
String GetName ()
 The component's name. More...
 
String GetPath ()
 To get the full path of a comp in the tree. More...
 
 Invert ()
 Normal of the component is inverted. More...
 
Boolean IsInDoc ()
 Return if the component is in the document or not. More...
 
Boolean IsVisible ()
 
 MoveToGroup (String GroupPath, Boolean MoveInsideTopParent)
 Move the object to the document group represent by the given path. If some groups, in the path, don't exist, they will be created. More...
 
 RemoveFromDoc ()
 To remove the object from the document. More...
 
 SetClippable (Boolean clipping)
 Set clippable or not. More...
 
 SetColors (Number Red, Number Green, Number Blue)
 Sets the colors of the component. More...
 
 SetName (String ComponentName)
 To set the component's name. More...
 
 SetRepresentationType (RepresentationTypeEnum Representation)
 The shading type of the component is modified. More...
 
 SetTransparency (Number Alpha)
 Sets the transparency of the component. More...
 
 SetVisibility (Boolean Visible)
 Sets the component to be visible, or not visible. More...
 
String toString ()
 Get the type of the variable. More...
 
String toString ()
 Get the type of the variable. More...
 
 Translate (SVector Vector)
 To make a translation of the current object with an SVector. More...
 
- Public Slots inherited from SObject
 Clear ()
 To deallocate memory of the object. More...
 
String toString ()
 Get the type of the variable. More...
 

Detailed Description

BIM manipulation class. The SBIM creation can be done by calling the static function New() to copy an existing SBIM.

Member Enumeration Documentation

◆ BIMRepresentationTypeEnum

The different representation types for BIM object.
Use SBIM.BIM_COLOR.

Enumerator
BIM_FLAT 
BIM_COLOR 

Member Function Documentation

◆ All

static Array SBIM::All ( Number  VisCrit)
inlinestaticslot

To get all the SBIM in the document.

Return values
Arrayall the SBIM contained in the document
Parameters
[in]VisCritVisible selection criteria
  • 0 Keep if not visible
  • 1 Keep if visible
  • 2 (Default) Indifferent

◆ ApplyFilter

Array SBIM::ApplyFilter ( String  iFilter = "",
QStringList  iStoreyNames = {} 
)
slot

Edit content of the BIM with given filters.

Return values
Array.ErrorCodeThe error code.
  • 0 OK, No error.
  • 1 Files is not reachable
  • 2 An error occurred
var bimTbl = SBIM.FromSel();
var myBim = bimTbl[0];
myBim.ApplyFilter("WALL", ["level name1", "level name2"]);
BIM manipulation class. The SBIM creation can be done by calling the static function New() to copy an...
Definition: SBim.h:22
static Array FromSel()
To get all the selected SBIM.
Parameters
[in]iFilterLoad elements that contain this filter in the metadata (not case sensitive)
[in]iStoreyNamesLoad only elements that are in the given storeys (not case sensitive)

◆ ConvertPolys

Array SBIM::ConvertPolys ( )
slot

Convert all filtered geometries into a table of mesh.

Return values
Array.ErrorCodeThe error code.
  • 0 OK, No error.
  • 1 An error occurred
Array.PolyTblThe resulting converted meshes

◆ FromClick

static Array SBIM::FromClick ( )
inlinestaticslot

Launches a click interaction to select a SBIM in the scene.

Warning
This function will break the script, and wait for user interaction
Return values
Array.ErrorCodeThe error code
  • 0: Success, the SBIM is selected.
  • 1: Nothing is selected.
  • 2: The ESCape key has been pressed
Array.BIMObjectthe SBIM selected

◆ FromFile

static Array SBIM::FromFile ( String  iFilename,
String  iFilter = "",
QStringList  iStoreyNames = {} 
)
staticslot

Import a BIM file (.rvt, .ifc) and apply filters.

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 = SBIM.FromFile( 'C:/BimFile.ifc' ); // Valid syntax\n
var res2 = SBIM.FromFile( 'C:\\BimFile.ifc' ); // Valid syntax\n
var res3 = SBIM.FromFile( 'C:\BimFile.ifc' ); // Invalid syntax
static Array FromFile(String iFilename, String iFilter="", QStringList iStoreyNames={})
Import a BIM file (.rvt, .ifc) and apply filters.
Return values
Array.ErrorCodeThe error code.
  • 0 OK, No error.
  • 1 An error occurred during initialization from filename
  • 2 An error occurred
  • 3 Filename is not valid
Array.BIMObjectThe imported BIM
Parameters
[in]iFilenameBIM file to load
[in]iFilterLoad elements that contain this filter in the metadata (not case sensitive)
[in]iStoreyNamesLoad elements that are in the given storeys (not case sensitive)

◆ FromName

static Array SBIM::FromName ( String  Name)
inlinestaticslot

Search all the SBIM with the given name.

Return values
Arrayall the SBIM with the given name

◆ FromSel

static Array SBIM::FromSel ( )
staticslot

To get all the selected SBIM.

Return values
Arrayall the SBIM selected

◆ GetMetadata

static Array SBIM::GetMetadata ( SPoly  iMesh)
staticslot

Get all metadata associated to the given mesh as list of key and value for each metadata.

var bimTbl = SBIM.FromSel();
var bim = bimTbl[0];
var ret = bim.ConvertPolys();
if( ret.ErrorCode == 0)
{
var firstPoly = ret.PolyTbl[0]
var metadatas = SBIM.GetMetadata(firstPoly);
// read key and value one by one
metadatas.forEach(function(curData)
{
print("Key " + curData[0]);
print("Value " + curData[1]);
});
// directly get IFC type value from key
var ifcType = metadatas["Specific/IFC TYPE"];
print(ifcType);
};
static Array GetMetadata(SPoly iMesh)
Get all metadata associated to the given mesh as list of key and value for each metadata.
Parameters
[in]iMeshThe mesh to read metadata.

◆ New

static SBIM SBIM::New ( SBIM  Other)
staticslot

Constructs an SBIM by copying the SBIM Other.

◆ SetBIMRepresentation

SBIM::SetBIMRepresentation ( BIMRepresentationTypeEnum  iRepresentation)
slot

The representation of the component is modified.

Parameters
[in]iRepresentationThe BIM representation type

◆ toString [1/2]

String SBIM::toString ( )
slot

Get the type of the variable.

◆ toString [2/2]

static String SBIM::toString ( )
staticslot

Get the type of the variable.