Cyclone 3DR Script
from Technodigit, part of Hexagon. Copyright 1997-2021.
SRoundSlot Class Reference

RoundSlot manipulation class. The SRoundSlot creation can be done by calling the static functions:
. More...

Inheritance diagram for SRoundSlot:
SFeature SComp SObject

Public Slots

static Array All (Number VisCrit)
 To get all the SComp in the document. More...
 
Array Discretize (Number deflection, Number meanPointDistance)
 To convert the continuous feature into a discretized SMultiline. To use the deflection, put a positive value and set -1 to meanPointDistance To use the mean distance between points, put a positive value and set 0 to deflection To use default value, set 0 in deflection or meanPointDistance. More...
 
Number Distance (SPoint Point, Boolean CalcIn3D)
 Returns the distance between a point and the feature <0 if below/inside the feature >0 if above/outside the feature. More...
 
static Array FromClick ()
 Displays a dialog box to select an 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...
 
SPoint GetCenterA ()
 Returns the center on the -X side. More...
 
SPoint GetCenterB ()
 Returns the center on the +X side. More...
 
SCircle GetCircleA ()
 Returns the circle centered on the -X side. More...
 
SCircle GetCircleB ()
 Returns the circle centered on the +X side. More...
 
Number GetLength ()
 Returns the length. More...
 
Number GetPerimeter ()
 Returns the perimeter of the feature. More...
 
Number GetWidth ()
 Returns the width. More...
 
SVector GetXDir ()
 
SVector GetYDir ()
 
static SRoundSlot New ()
 Default constructor to create an empty new SRoundSlot. More...
 
static SRoundSlot New (SPoint Center, SVector Normal, SVector XDir, Number Length, Number Width)
 Constructs a new SRoundSlot by defining its data. More...
 
static SRoundSlot New (SPoint FirstPt, SPoint SecondPt, SPoint ThirdPt)
 Constructs a new SRoundSlot by 3 points. More...
 
static SRoundSlot New (SRoundSlot Other)
 Constructs an SRoundSlot by copying Other. More...
 
 SetLength (Number Length)
 Setter for the length. More...
 
 SetWidth (Number Width)
 Setter for the width. More...
 
String toString ()
 Get the type of the variable. More...
 
static String toString ()
 Get the type of the variable. More...
 
- Public Slots inherited from SFeature
static Array All (Number VisCrit)
 To get all the SComp in the document. More...
 
Array Compare (SCloud iMeasCloud, Number DistMax, Number MappingObject, Number maxCosAngle=-2)
 Calculates the distances between 2 components for further inspection purpose (color mapping) More...
 
static Array FromBfcFile (String iFilePath)
 To load a .bfc file. More...
 
static Array FromClick ()
 Displays a dialog box to select an 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...
 
SPoint GetCenter ()
 
SVector GetNormal ()
 
 SetCenter (SPoint iCenter)
 To set a new center to the SFeature. More...
 
 SetNormal (SVector Normal)
 To set a new normal to the SFeature. 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 ()
 Displays a dialog box to select an 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 ()
 
String GetName ()
 
 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...
 

Additional Inherited Members

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

Detailed Description

RoundSlot manipulation class. The SRoundSlot creation can be done by calling the static functions:
.

  • New() to create your own empty SRoundSlot.
  • New() to copy an existing SRoundSlot.
  • New() to create a new SRoundSlot by defining its center, normal, X axis, length and width.
    var center = SPoint.New(1, 1, 2);
    var normal = SVector.New(0, 1, 0);
    var dirX = SVector.New(0, 0, 1);
    var length = 25;
    var width = 12;
    var emptySRoundSlot = SRoundSlot.New();
    var mySRoundSlot = SRoundSlot.New(center, normal, dirX, length, width);
    var mySRoundSlotCopy = SRoundSlot.New(mySRoundSlot);

Member Function Documentation

◆ All

static Array SRoundSlot::All ( Number  VisCrit)
inlinestaticslot

To get all the SComp in the document.

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

◆ Discretize

Array SRoundSlot::Discretize ( Number  deflection,
Number  meanPointDistance 
)
slot

To convert the continuous feature into a discretized SMultiline. To use the deflection, put a positive value and set -1 to meanPointDistance To use the mean distance between points, put a positive value and set 0 to deflection To use default value, set 0 in deflection or meanPointDistance.

Return values
Array.ErrorCodeThe error code:
  • 0: No error
  • 1: An error occurred
Array.MultiThe discretized SMultiline
Parameters
[in]deflectionmax deviation between the ideal shape and the discretized element
[in]meanPointDistanceMean distance between points/vertices

◆ Distance

Number SRoundSlot::Distance ( SPoint  Point,
Boolean  CalcIn3D 
)
slot

Returns the distance between a point and the feature <0 if below/inside the feature >0 if above/outside the feature.

Parameters
[in]Pointthe point from which the distance to the feature has to be calculated
[in]CalcIn3Dshould we calculate the deviation in 3D

◆ FromClick

static Array SRoundSlot::FromClick ( )
inlinestaticslot

Displays a dialog box to select an SComp in the scene.

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

◆ FromName

static Array SRoundSlot::FromName ( String  Name)
inlinestaticslot

Search all the component with the given name.

Return values
Arrayall the SRoundSlot with the given name

◆ FromSel

static Array SRoundSlot::FromSel ( )
inlinestaticslot

To get all the selected SComp.

Return values
Arrayall the SRoundSlot selected

◆ GetCenterA

SPoint SRoundSlot::GetCenterA ( )
slot

Returns the center on the -X side.

◆ GetCenterB

SPoint SRoundSlot::GetCenterB ( )
slot

Returns the center on the +X side.

◆ GetCircleA

SCircle SRoundSlot::GetCircleA ( )
slot

Returns the circle centered on the -X side.

◆ GetCircleB

SCircle SRoundSlot::GetCircleB ( )
slot

Returns the circle centered on the +X side.

◆ GetLength

Number SRoundSlot::GetLength ( )
slot

Returns the length.

◆ GetPerimeter

Number SRoundSlot::GetPerimeter ( )
slot

Returns the perimeter of the feature.

◆ GetWidth

Number SRoundSlot::GetWidth ( )
slot

Returns the width.

◆ GetXDir

SVector SRoundSlot::GetXDir ( )
slot
Returns
The SRoundSlot X direction
Warning
This vector can be null. Check it with SVector.IsNull()

◆ GetYDir

SVector SRoundSlot::GetYDir ( )
slot
Returns
The SRoundSlot Y direction
Warning
This vector can be null. Check it with SVector.IsNull()

◆ New [1/4]

static SRoundSlot SRoundSlot::New ( )
staticslot

Default constructor to create an empty new SRoundSlot.

◆ New [2/4]

static SRoundSlot SRoundSlot::New ( SPoint  Center,
SVector  Normal,
SVector  XDir,
Number  Length,
Number  Width 
)
staticslot

Constructs a new SRoundSlot by defining its data.

Parameters
[in]CenterThe circle's center
[in]NormalThe circle's normal
XDirPlane's X axis
LengthPlane's length
WidthPlane's width

◆ New [3/4]

static SRoundSlot SRoundSlot::New ( SPoint  FirstPt,
SPoint  SecondPt,
SPoint  ThirdPt 
)
staticslot

Constructs a new SRoundSlot by 3 points.

Note
The 3 points must be not identical.
If you want to construct a round slot with more than 3 points, use SCloud.BestRdSlot().
The two first points define the length and the Number axis. The third defines the width.
Parameters
[in]FirstPtFirst point on the round slot
[in]SecondPtSecond point on the round slot
[in]ThirdPtThird point on the round slot to define the width

◆ New [4/4]

static SRoundSlot SRoundSlot::New ( SRoundSlot  Other)
staticslot

Constructs an SRoundSlot by copying Other.

◆ SetLength

SRoundSlot::SetLength ( Number  Length)
slot

Setter for the length.

◆ SetWidth

SRoundSlot::SetWidth ( Number  Width)
slot

Setter for the width.

◆ toString [1/2]

String SRoundSlot::toString ( )
slot

Get the type of the variable.

◆ toString [2/2]

static String SRoundSlot::toString ( )
staticslot

Get the type of the variable.