Version: 9.12.0
Home

Functions

def GetExistingSubObjects (self, theShape, theGroupsOnly=False)
 Get all sub-shapes and groups of theShape, that were created already by any other methods. More...
 
def GetGroups (self, theShape)
 Get all groups of theShape, that were created already by any other methods. More...
 
def SubShapeAll (self, aShape, aType, theName=None)
 Explode a shape on sub-shapes of a given type. More...
 
def SubShapeAllIDs (self, aShape, aType)
 Explode a shape on sub-shapes of a given type. More...
 
def SubShape (self, aShape, aType, ListOfInd, theName=None)
 Obtain a compound of sub-shapes of aShape, selected by their indices in list of all sub-shapes of type aType. More...
 
def SubShapeAllSortedCentres (self, aShape, aType, theName=None)
 Explode a shape on sub-shapes of a given type. More...
 
def SubShapeAllSortedCentresIDs (self, aShape, aType)
 Explode a shape on sub-shapes of a given type. More...
 
def SubShapeSortedCentres (self, aShape, aType, ListOfInd, theName=None)
 Obtain a compound of sub-shapes of aShape, selected by they indices in sorted list of all sub-shapes of type aType. More...
 
def ExtractShapes (self, aShape, aType, isSorted=False, theName=None)
 Extract shapes (excluding the main shape) of given type. More...
 
def SubShapes (self, aShape, anIDs, theName=None)
 Get a set of sub-shapes defined by their unique IDs inside aShape More...
 
def GetSubShapeEdgeSorted (self, theShape, theStartPoint, theName=None)
 Explode a shape into edges sorted in a row from a starting point. More...
 
def GetSubShapesWithTolerance (self, theShape, theShapeType, theCondition, theTolerance, theName=None)
 Return the list of subshapes that satisfies a certain tolerance criterion. More...
 
def IsSubShapeBelongsTo (self, aSubObject, anObject, aSubObjectIndex=0, anObjectIndex=0)
 Check if the object is a sub-object of another GEOM object. More...
 
def MakeExtraction (self, theShape, theListOfID, theName=None)
 Perform extraction of sub-shapes from the main shape. More...
 

Detailed Description

Function Documentation

◆ GetExistingSubObjects()

def GetExistingSubObjects (   self,
  theShape,
  theGroupsOnly = False 
)

Get all sub-shapes and groups of theShape, that were created already by any other methods.

Parameters
theShapeAny shape.
theGroupsOnlyIf this parameter is TRUE, only groups will be returned, else all found sub-shapes and groups.
Returns
List of existing sub-objects of theShape.

Example

References geomBuilder.RaiseIfFailed(), and geomBuilder.ShapesOp.

◆ GetGroups()

def GetGroups (   self,
  theShape 
)

Get all groups of theShape, that were created already by any other methods.

Parameters
theShapeAny shape.
Returns
List of existing groups of theShape.

Example

References geomBuilder.GetExistingSubObjects(), geomBuilder.RaiseIfFailed(), and geomBuilder.ShapesOp.

◆ SubShapeAll()

def SubShapeAll (   self,
  aShape,
  aType,
  theName = None 
)

Explode a shape on sub-shapes of a given type.

If the shape itself matches the type, it is also returned.

Parameters
aShapeShape to be exploded.
aTypeType of sub-shapes to be retrieved (see ShapeType())
theNameObject name; when specified, this parameter is used for result publication in the study. Otherwise, if automatic publication is switched on, default value is used for result name.
Returns
List of sub-shapes of type theShapeType, contained in theShape.

Example

References geomBuilder._autoPublish(), geomBuilder.EnumToLong(), geomBuilder.RaiseIfFailed(), and geomBuilder.ShapesOp.

◆ SubShapeAllIDs()

def SubShapeAllIDs (   self,
  aShape,
  aType 
)

Explode a shape on sub-shapes of a given type.

Parameters
aShapeShape to be exploded.
aTypeType of sub-shapes to be retrieved (see ShapeType())
Returns
List of IDs of sub-shapes.

Example

References geomBuilder.EnumToLong(), geomBuilder.RaiseIfFailed(), and geomBuilder.ShapesOp.

◆ SubShape()

def SubShape (   self,
  aShape,
  aType,
  ListOfInd,
  theName = None 
)

Obtain a compound of sub-shapes of aShape, selected by their indices in list of all sub-shapes of type aType.

Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]

Parameters
aShapeShape to get sub-shape of.
ListOfIndList of sub-shapes indices.
aTypeType of sub-shapes to be retrieved (see ShapeType())
theNameObject name; when specified, this parameter is used for result publication in the study. Otherwise, if automatic publication is switched on, default value is used for result name.
Returns
A compound of sub-shapes of aShape.

Example

References geomBuilder.EnumToLong(), GEOM_IShapesOperations.GetSubShape(), geomBuilder.GetSubShape(), GEOM_IShapesOperations.SubShapeAllIDs(), and geomBuilder.SubShapeAllIDs().

◆ SubShapeAllSortedCentres()

def SubShapeAllSortedCentres (   self,
  aShape,
  aType,
  theName = None 
)

Explode a shape on sub-shapes of a given type.

Sub-shapes will be sorted taking into account their gravity centers, to provide stable order of sub-shapes. Please see Description of Sorting Shapes Algorithm. If the shape itself matches the type, it is also returned.

Parameters
aShapeShape to be exploded.
aTypeType of sub-shapes to be retrieved (see ShapeType())
theNameObject name; when specified, this parameter is used for result publication in the study. Otherwise, if automatic publication is switched on, default value is used for result name.
Returns
List of sub-shapes of type theShapeType, contained in theShape.

Example

References geomBuilder._autoPublish(), geomBuilder.EnumToLong(), geomBuilder.RaiseIfFailed(), and geomBuilder.ShapesOp.

◆ SubShapeAllSortedCentresIDs()

def SubShapeAllSortedCentresIDs (   self,
  aShape,
  aType 
)

Explode a shape on sub-shapes of a given type.

Sub-shapes will be sorted taking into account their gravity centers, to provide stable order of sub-shapes. Please see Description of Sorting Shapes Algorithm.

Parameters
aShapeShape to be exploded.
aTypeType of sub-shapes to be retrieved (see ShapeType())
Returns
List of IDs of sub-shapes.

Example

References geomBuilder.EnumToLong(), geomBuilder.RaiseIfFailed(), and geomBuilder.ShapesOp.

◆ SubShapeSortedCentres()

def SubShapeSortedCentres (   self,
  aShape,
  aType,
  ListOfInd,
  theName = None 
)

Obtain a compound of sub-shapes of aShape, selected by they indices in sorted list of all sub-shapes of type aType.

Please see Description of Sorting Shapes Algorithm. Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]

Parameters
aShapeShape to get sub-shape of.
ListOfIndList of sub-shapes indices.
aTypeType of sub-shapes to be retrieved (see ShapeType())
theNameObject name; when specified, this parameter is used for result publication in the study. Otherwise, if automatic publication is switched on, default value is used for result name.
Returns
A compound of sub-shapes of aShape.

Example

References geomBuilder.EnumToLong(), GEOM_IShapesOperations.GetSubShape(), geomBuilder.GetSubShape(), and geomBuilder.SubShapeAllSortedCentresIDs().

◆ ExtractShapes()

def ExtractShapes (   self,
  aShape,
  aType,
  isSorted = False,
  theName = None 
)

Extract shapes (excluding the main shape) of given type.

Parameters
aShapeThe shape.
aTypeThe shape type (see ShapeType())
isSortedBoolean flag to switch sorting on/off. Please see Description of Sorting Shapes Algorithm.
theNameObject name; when specified, this parameter is used for result publication in the study. Otherwise, if automatic publication is switched on, default value is used for result name.
Returns
List of sub-shapes of type aType, contained in aShape.

Example

References geomBuilder._autoPublish(), geomBuilder.EnumToLong(), geomBuilder.RaiseIfFailed(), and geomBuilder.ShapesOp.

◆ SubShapes()

def SubShapes (   self,
  aShape,
  anIDs,
  theName = None 
)

Get a set of sub-shapes defined by their unique IDs inside aShape

Parameters
aShapeMain shape.
anIDsList of unique IDs of sub-shapes inside aShape.
theNameObject name; when specified, this parameter is used for result publication in the study. Otherwise, if automatic publication is switched on, default value is used for result name.
Returns
List of GEOM.GEOM_Object, corresponding to found sub-shapes.

Example

References geomBuilder._autoPublish(), geomBuilder.RaiseIfFailed(), and geomBuilder.ShapesOp.

◆ GetSubShapeEdgeSorted()

def GetSubShapeEdgeSorted (   self,
  theShape,
  theStartPoint,
  theName = None 
)

Explode a shape into edges sorted in a row from a starting point.

Parameters
theShapethe shape to be exploded on edges.
theStartPointthe starting point.
theNameObject name; when specified, this parameter is used for result publication in the study. Otherwise, if automatic publication is switched on, default value is used for result name.
Returns
List of GEOM.GEOM_Object that is actually an ordered list of edges sorted in a row from a starting point.

Example

References geomBuilder._autoPublish(), geomBuilder.RaiseIfFailed(), and geomBuilder.ShapesOp.

◆ GetSubShapesWithTolerance()

def GetSubShapesWithTolerance (   self,
  theShape,
  theShapeType,
  theCondition,
  theTolerance,
  theName = None 
)

Return the list of subshapes that satisfies a certain tolerance criterion.

The user defines the type of shapes to be returned, the condition and the tolerance value. The operation is defined for faces, edges and vertices only. E.g. for theShapeType FACE, theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns all faces of theShape that have tolerances greater then 1.e7.

Parameters
theShapethe shape to be exploded
theShapeTypethe type of sub-shapes to be returned (see ShapeType()). Can have the values FACE, EDGE and VERTEX only.
theConditionthe condition type (see GEOM::comparison_condition).
theTolerancethe tolerance filter.
theNameObject name; when specified, this parameter is used for result publication in the study. Otherwise, if automatic publication is switched on, default value is used for result name.
Returns
the list of shapes that satisfy the conditions.

Example

References geomBuilder._autoPublish(), geomBuilder.EnumToLong(), geomBuilder.RaiseIfFailed(), and geomBuilder.ShapesOp.

◆ IsSubShapeBelongsTo()

def IsSubShapeBelongsTo (   self,
  aSubObject,
  anObject,
  aSubObjectIndex = 0,
  anObjectIndex = 0 
)

Check if the object is a sub-object of another GEOM object.

Parameters
aSubObjectChecked sub-object (or its parent object, in case if theSubObjectIndex is non-zero).
anObjectAn object that is checked for ownership (or its parent object, in case if theObjectIndex is non-zero).
aSubObjectIndexWhen non-zero, specifies a sub-shape index that identifies a sub-object within its parent specified via theSubObject.
anObjectIndexWhen non-zero, specifies a sub-shape index that identifies an object within its parent specified via theObject.
Returns
TRUE, if the given object contains sub-object.

References geomBuilder.RaiseIfFailed(), and geomBuilder.ShapesOp.

◆ MakeExtraction()

def MakeExtraction (   self,
  theShape,
  theListOfID,
  theName = None 
)

Perform extraction of sub-shapes from the main shape.

Parameters
theShapethe main shape
theListOfIDthe list of sub-shape IDs to be extracted from the main shape.
Returns
New GEOM.GEOM_Object, containing the shape without extracted sub-shapes.

Example

References geomBuilder._autoPublish(), geomBuilder.RaiseIfFailed(), and geomBuilder.ShapesOp.