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

Abstract class storing methods available on most 3D objects. More...

Inheritance diagram for SComp:
SBIM SClipping SCloud SCwCloud SFeature SImage SLabel SMultiline SPoint SPoly SReport SReportData SSetMultiline SShape STrajectory SViewSet

Public Types

enum  VisibilityEnum { HIDDEN_ONLY = 0 , VISIBLE_ONLY = 1 , ANY_VISIBILITY = 2 }
 Visible criteria. More...
 

Public Member Functions

 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< 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

Abstract class storing methods available on most 3D objects.

Member Enumeration Documentation

◆ VisibilityEnum

Visible criteria.

Enumerator
HIDDEN_ONLY 

Keep if not visible.

VISIBLE_ONLY 

Keep if visible.

ANY_VISIBILITY 

Indifferent.

Member Function Documentation

◆ AddToDoc()

SComp::AddToDoc ( )

Add the object to the document.

See also
SLabel::AddSComp() the label obtains SComp ownership

◆ All()

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

Get all the SComp in the document.

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

◆ ApplyTransformation()

SComp::ApplyTransformation ( SMatrix  matrix)

Apply a geometric transformation to the current object by making a product with the given matrix.

See also
Translate
Parameters
matrix(SMatrix) The transformation matrix

◆ FromClick()

static Object SComp::FromClick ( )
static

Launch an interaction to select a SComp 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 SComp is selected.
  • 1: Nothing is selected.
  • 2: The ESCape key has been pressed
ret.Comp(SComp) The selected SComp

◆ FromName()

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

Search all the SComp with the given name.

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

◆ FromSel()

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

Get all the selected SComp.

Returns
(Array<SComp>) All the selected SComp

◆ GetBoundingBox()

Object SComp::GetBoundingBox ( SMatrix  ucs = null)

Calculate the bounding box of the object.

Parameters
ucs(SMatrix) By default, the bounding box is aligned with the WCS, otherwise give a matrix defining a UCS.
Return values
ret.ErrorCode(number) The error code:
  • 0: OK, the bounding box could be calculated
  • 1: if the bounding box could NOT be calculated
  • 2: if the UCS matrix is not orthonormal
ret.LowPoint(SPoint) The lower SPoint of the bounding box
ret.UpPoint(SPoint) The upper SPoint of the bounding box

◆ GetColors()

Object SComp::GetColors ( )

Get the colors of the object.

Return values
ret.Red(number) The red color (0 to 1)
ret.Green(number) The green color (0 to 1)
ret.Blue(number) The blue color (0 to 1)

◆ GetFolderName()

string SComp::GetFolderName ( )

Get the name of the folder containing the object.

Returns
(string) The folder name

◆ GetName()

string SComp::GetName ( )

Return the object's name.

Returns
(string) Object's name

◆ GetPath()

string SComp::GetPath ( )

Return the full path of a SComp in the tree.

Returns
(string) The path

◆ Invert()

SComp::Invert ( )

Invert the normal of the object.

◆ IsInDoc()

boolean SComp::IsInDoc ( )

Return if the object is in the document or not.

Returns
(boolean) Return true if the object is in the document.

◆ IsVisible()

boolean SComp::IsVisible ( )

Get the visibility of the object.

See also
SetVisibility()
Returns
Visibility of the object
Return values
trueThe object is visible
falseThe object is invisible

◆ MoveToGroup()

SComp::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.

Warning
The object must be inside the document. Else this function won't do anything.
// After the execution of the code below, the plane will be in the group "Geometric Group" (the top parent),
// inside the sub group "Building" and sub sub group "Wall".
myPlane.MoveToGroup("Building/Wall");
// After the execution of the code below, this other plane will be in the top group "Building Group" and
// inside the sub group "Wall".
myOtherPlane.MoveToGroup("/Building Group/Wall", false);
See also
AddToDoc
Parameters
groupPath(string) The path where the object will be moved. Each group must be separated by character '/'.
moveInsideTopParent(boolean) If true the object will be moved inside the top parent group there it is ("Geometric Group", "Cloud Group", "Mesh Group", etc.). Else, if false, the first group in the path will be the new top parent.

◆ RemoveFromDoc()

SComp::RemoveFromDoc ( )

Remove the object from the document.

◆ SetClippable()

SComp::SetClippable ( boolean  clipping)

Set clippable or not.

Parameters
clipping(boolean) true if the object is clippable, false if not

◆ SetColors()

SComp::SetColors ( number  red,
number  green,
number  blue 
)

Set the colors of the object.

Parameters
red(number) The red color (0 to 1)
green(number) The green color (0 to 1)
blue(number) The blue color (0 to 1)

◆ SetName()

SComp::SetName ( string  objectName)

Set the object's name.

Parameters
objectName(string) The new object name

◆ SetTransparency()

SComp::SetTransparency ( number  alpha)

Set the transparency of the object.

Parameters
alpha(number) Transparency 0 to 255

◆ SetVisibility()

SComp::SetVisibility ( boolean  visible)

Set the object to be visible, or not visible.

See also
IsVisible()
Parameters
visible(boolean) True to set the object visible, else not visible

◆ toString()

string SComp::toString ( )

Get the type of the variable.

Returns
(string) The type name

◆ Translate()

SComp::Translate ( SVector  vector)

Make a translation of the current object with an SVector.

See also
ApplyTransformation
Parameters
vector(SVector) The translation vector to apply