Public Member Functions | List of all members
Part Class Reference

Part class is used to specify a part.
The class can be called from Model or PartGroup class. More...

Public Member Functions

double Area ()
 Returns area for a part in a 2D model. More...
 
PointCentroidPosition ()
 Returns the postiion of the centroid of a part. More...
 
String GetColor ()
 Returns part color. More...
 
Variant GetEdgeIDs ()
 Returns the edge ID for a part. More...
 
Variant GetFaceIDs ()
 Returns the face ID for a part. More...
 
String GetName ()
 Returns part name. More...
 
double GetTransparency ()
 Returns the transparency of a part. More...
 
Variant GetVertexIDs ()
 Returns the the vertex ID for a part. More...
 
int ID ()
 Returns the ID of the part.
 
bool IsValid ()
 Returns True if an object is valid. More...
 
bool IsVisible ()
 Returns the visibility of a part. More...
 
int NumEdges ()
 Returns the number of edges on a part. More...
 
int NumFaces ()
 Returns the number of faces on a part. More...
 
int NumVertices ()
 Returns the number of vertices on a part. More...
 
PointPointInPart ()
 Returns the position in a part in a 2D model. More...
 
void SetColor (String &color)
 Specifies part color. More...
 
void SetName (String &name)
 Specifies part name. More...
 
void SetTransparency (double transparency)
 Specifies the degree of transparency of the part. More...
 
void SetVisibility (bool visibility)
 Specifies the visibility of the part. More...
 
double Volume ()
 Returns the volume of a part in a 3D model. More...
 

Detailed Description

Part class is used to specify a part.
The class can be called from Model or PartGroup class.

Example of obtaining the class object:

app.GetModel(0).GetPart(0)

Member Function Documentation

double Part::Area ( )

Returns area for a part in a 2D model.

Returns
Area

Returns 0 for 3D model.

Point * Part::CentroidPosition ( )

Returns the postiion of the centroid of a part.

Returns
Parts of the centroid position
String Part::GetColor ( )

Returns part color.

Returns
Part color
Variant Part::GetEdgeIDs ( )

Returns the edge ID for a part.

Returns
Edge ID of part
Variant Part::GetFaceIDs ( )

Returns the face ID for a part.

Returns
Face ID of part
String Part::GetName ( )

Returns part name.

Returns
Part name
double Part::GetTransparency ( )

Returns the transparency of a part.

Returns
Transparency of the part
Variant Part::GetVertexIDs ( )

Returns the the vertex ID for a part.

Returns
Vertex ID of part
bool Part::IsValid ( )

Returns True if an object is valid.

Returns
Whether or not the Part objects in the list are valid
bool Part::IsVisible ( )

Returns the visibility of a part.

Returns
Visibility of the part
int Part::NumEdges ( )

Returns the number of edges on a part.

Returns
Number of edges of part
int Part::NumFaces ( )

Returns the number of faces on a part.

Returns
Number of faces of part
int Part::NumVertices ( )

Returns the number of vertices on a part.

Returns
Number of vertices of part
Point * Part::PointInPart ( )

Returns the position in a part in a 2D model.

Returns
Position in a part
void Part::SetColor ( String &  color)

Specifies part color.

Parameters
colorPart color

The colors can be specified with the following methods

  • #RGB
    Hexadecimal digit for R, G, and B respectively
  • #RRGGBB
    2 hexadecimal digits for R, G, and B
  • Black, Red, etc.
    Predefined color names
void Part::SetName ( String &  name)

Specifies part name.

Parameters
namePart name
void Part::SetTransparency ( double  trans)

Specifies the degree of transparency of the part.

Parameters
transTransparency (0 to 1)
void Part::SetVisibility ( bool  visibility)

Specifies the visibility of the part.

Parameters
visibilityVisibility (true or false)
double Part::Volume ( )

Returns the volume of a part in a 3D model.

Returns
Part volume
  • Returns 0 for a 2D model.
  • The unit of volume that can be obtained with this command is the unit of length applied to the model.
    For example, the unit of volume obtained from the "Volume" script command is 'mm^3.' This occurs when the unit of length is defined as 'mm' and the unit of volume is defined as 'm^3'.