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

Provide BIM objects edition methods. More...

Inheritance diagram for SBIM:
SComp

Public Types

enum  BIMRepresentationTypeEnum { BIM_FLAT = 0 , BIM_COLOR = 1 }
 The different representation types for SBIM. More...
 
- Public Types inherited from SComp
enum  VisibilityEnum { HIDDEN_ONLY = 0 , VISIBLE_ONLY = 1 , ANY_VISIBILITY = 2 }
 Visible criteria. More...
 

Public Member Functions

Object ApplyFilter (string filter="", Array< string > storeyNames=[])
 Edit content of the SBIM with given filters. More...
 
Object ConvertPolys ()
 Convert all filtered geometries into a table of meshes. More...
 
 SBIM (SBIM other)
 Construct a SBIM by copying the SBIM Other. More...
 
 SetBIMRepresentation (BIMRepresentationTypeEnum representation)
 The representation of the component is modified. More...
 
string toString ()
 Get the type of the variable. More...
 
string ValuesToString ()
 Get a debug string representation of the SBIM. More...
 
- Public Member Functions inherited from SComp
 AddToDoc ()
 Add the object to the document. More...
 
 ApplyTransformation (SMatrix matrix)
 Apply a geometric transformation to the current object by making a product with the given matrix. More...
 
Object GetBoundingBox (SMatrix ucs=null)
 Calculate the bounding box of the object. More...
 
Object GetColors ()
 Get the colors of the object. More...
 
string GetFolderName ()
 Get the name of the folder containing the object. More...
 
string GetName ()
 Return the object's name. More...
 
string GetPath ()
 Return the full path of a SComp in the tree. More...
 
 Invert ()
 Invert the normal of the object. More...
 
boolean IsInDoc ()
 Return if the object is in the document or not. More...
 
boolean IsVisible ()
 Get the visibility of the object. More...
 
 MoveToGroup (string groupPath, boolean moveInsideTopParent=true)
 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 ()
 Remove the object from the document. More...
 
 SetClippable (boolean clipping)
 Set clippable or not. More...
 
 SetColors (number red, number green, number blue)
 Set the colors of the object. More...
 
 SetName (string objectName)
 Set the object's name. More...
 
 SetTransparency (number alpha)
 Set the transparency of the object. More...
 
 SetVisibility (boolean visible)
 Set the object to be visible, or not visible. More...
 
string toString ()
 Get the type of the variable. More...
 
 Translate (SVector vector)
 Make a translation of the current object with an SVector. More...
 

Static Public Member Functions

static Array< SBIMAll (VisibilityEnum visCrit=SComp.ANY_VISIBILITY)
 Get all the SBIM in the document. More...
 
static Object FromClick ()
 Launch an interaction to select a SBIM in the scene. More...
 
static Object FromFile (string filename, string filter="", Array< string > storeyNames=[])
 Import a BIM file (.rvt, .ifc) and apply filters. More...
 
static Array< SBIMFromName (string name)
 Search all the SBIM with the given name. More...
 
static Array< SBIMFromSel ()
 Get all the selected SBIM. More...
 
static Object GetMetadata (SPoly mesh)
 Get all metadata associated to the given mesh as map of key and value for each metadata. More...
 
static SBIM New (SBIM other)
 Construct a SBIM by copying the SBIM Other. More...
 
- Static Public Member Functions inherited from SComp
static Array< SCompAll (VisibilityEnum visCrit=SComp.ANY_VISIBILITY)
 Get all the SComp in the document. More...
 
static Object FromClick ()
 Launch an interaction to select a SComp in the scene. More...
 
static Array< SCompFromName (string name)
 Search all the SComp with the given name. More...
 
static Array< SCompFromSel ()
 Get all the selected SComp. More...
 

Detailed Description

Provide BIM objects edition methods.

Require the AEC license

Member Enumeration Documentation

◆ BIMRepresentationTypeEnum

The different representation types for SBIM.

Enumerator
BIM_FLAT 

Flat color for the whole SBIM.

BIM_COLOR 

A color per instance.

Constructor & Destructor Documentation

◆ SBIM()

SBIM::SBIM ( SBIM  other)

Construct a SBIM by copying the SBIM Other.

Parameters
other(SBIM) The other SBIM to copy.

Member Function Documentation

◆ All()

static Array< SBIM > SBIM::All ( VisibilityEnum  visCrit = SComp.ANY_VISIBILITY)
static

Get all the SBIM in the document.

Parameters
visCrit(VisibilityEnum) Visible selection criteria
Returns
(Array<SBIM>) Array of all the SBIM contained in the document, that fulfill the visibility criteria

◆ ApplyFilter()

Object SBIM::ApplyFilter ( string  filter = "",
Array< string >  storeyNames = [] 
)

Edit content of the SBIM with given filters.

License
This function requires the license AEC or Plant or Tank.
var bimTbl = SBIM.FromSel();
var myBim = bimTbl[0];
myBim.ApplyFilter("WALL", ["level name1", "level name2"]);
Provide BIM objects edition methods.
Definition: Reshaper.h:3023
static Array< SBIM > FromSel()
Get all the selected SBIM.
Parameters
filter(string) Load elements that contain this filter in the metadata (not case sensitive)
storeyNames(Array<string>) Load only elements that are in the given storeys (not case sensitive)
Return values
ret.ErrorCode(number) The error code.
  • 0: No error.
  • 1: An error occurred during initialization from filename
  • 2: An error occurred

◆ ConvertPolys()

Object SBIM::ConvertPolys ( )

Convert all filtered geometries into a table of meshes.

License
This function requires the license AEC or Plant or Tank.
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.PolyTbl(Array<SPoly>) The resulting converted meshes

◆ FromClick()

static Object SBIM::FromClick ( )
static

Launch an interaction to select a SBIM in the scene.

Warning
This function will pause the script, and wait for user interaction
Return values
ret.ErrorCode(number) The error code
  • 0: No error, the SBIM is selected.
  • 1: Nothing is selected.
  • 2: The ESCape key has been pressed
ret.BIMObject(SBIM) The selected SBIM

◆ FromFile()

static Object SBIM::FromFile ( string  filename,
string  filter = "",
Array< string >  storeyNames = [] 
)
static

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

License
This function requires the license AEC or Plant or Tank.
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) BIM file to load
filter(string) Load elements that contain this filter in the metadata (not case sensitive)
storeyNames(Array<string>) Load elements that are in the given storeys (not case sensitive)
Return values
ret.ErrorCode(number) The error code.
  • 0: OK, No error.
  • 1: An error occurred during initialization from filename
  • 2: An error occurred
  • 3: Filename is not valid
ret.BIMObject(SBIM) The imported BIM

◆ FromName()

static Array< SBIM > SBIM::FromName ( string  name)
static

Search all the SBIM with the given name.

Parameters
name(string) The name to find
Returns
(Array<SBIM>) All the SBIM with the given name

◆ FromSel()

static Array< SBIM > SBIM::FromSel ( )
static

Get all the selected SBIM.

Returns
(Array<SBIM>) All the selected SBIM

◆ GetMetadata()

static Object SBIM::GetMetadata ( SPoly  mesh)
static

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

License
This function requires the license AEC or Plant or Tank.
var bimTbl = SBIM.FromSel();
var bim = bimTbl[0];
var ret = bim.ConvertPolys();
if(ret.ErrorCode == 0)
{
var firstPoly = ret.PolyTbl[0];
var metadata = SBIM.GetMetadata(firstPoly);
// read key and value one by one
Object.keys(metadata).forEach(function(curKey)
{
print("Key " + curKey);
print("Value " + metadata[curKey]);
});
// directly get IFC type value from key
var ifcType = metadata["Specific/IFC TYPE"];
print(ifcType);
}
static Object GetMetadata(SPoly mesh)
Get all metadata associated to the given mesh as map of key and value for each metadata.
Parameters
mesh(SPoly) The mesh to read metadata.
Returns
(Object) The map of key and value for each metadata.

◆ New()

static SBIM SBIM::New ( SBIM  other)
static

Construct a SBIM by copying the SBIM Other.

Parameters
other(SBIM) The other SBIM to copy.
Returns
(SBIM) The new SBIM.

◆ SetBIMRepresentation()

SBIM::SetBIMRepresentation ( BIMRepresentationTypeEnum  representation)

The representation of the component is modified.

Parameters
representation(BIMRepresentationTypeEnum) The BIM representation type

◆ toString()

string SBIM::toString ( )

Get the type of the variable.

Returns
(string) The type name

◆ ValuesToString()

string SBIM::ValuesToString ( )

Get a debug string representation of the SBIM.

Returns
(string) a debug string representing the SBIM