Creation and editing groups of sub-shapes of a geometrical object makes handling sub-shapes much easier. This functionality is available in OCC viewer only.
Create a group
To create a group of sub-shapes of a geometrical object in the main menu select New entity > Group > Create
The following menu will appear:
In this Menu:
-
Shape Type radio button defines the type of elements for the group (points, wires, faces, shells or solids).
-
Group Name - allows defining the name of the group, by default, it is Group_n.
-
Then, using the "Select" button, select the Main Shape (a geometrical object on which the group will be created).
-
Main Shape Selection restriction button group allows limiting the range of available group elements,
-
No restriction button enables all sub-shapes of the Main Shape.
-
Geometrical parts of the Second Shape restricts the range of accessible elements to the sub-shapes of the Main Shape that geometrically coincide with the Second Shape.
-
Only Sub-shapes of the Second Shape restricts the range of accessible elements to the sub-shapes of the Main Shape that are sub-shapes of the Second Shape. This is useful because sometimes purely geometrical coincidence is not enough and it is necessary to work with shapes, which actually belong both to the main and the second shape.
-
You can selectively display the selected elements using the following buttons:
-
Show only selected - displays only the sub-shapes selected in the list box.
-
Hide selected - hides the sub-shapes selected in the list box.
-
Show all sub-shapes - displays only the sub-shapes of the Main Shape.
-
You can select the elements of your group in two ways:
-
You can select them manually in the 3D Viewer, and add to the group by clicking the Add button (keep down the Shift button on the keyboard to select several elements and add all them together). The indexes of the selected elements will be displayed in the list. To delete elements from the list, select them and click Remove button.
-
Clicking Select All button you can add all object's elements of a certain type in the list of the elements of the group. If the Second Shape is used, the elements are added according to Main Shape Selection restriction settings. To delete elements from the list, select them and click Remove button.
-
Finally, confirm your selection by clicking Apply and Close (also closes the Menu) or Apply (leaves the Menu open for creation of other groups), or skip it by clicking Close button.
The Result of the operation will be a GEOM_Object.
TUI Command: geompy.CreateGroup(MainShape, ShapeType), where MainShape is a shape for which the group is created, ShapeType is a type of shapes in the created group.
Arguments: 1 Shape + Type of sub-shape.
Example:
Groups on a cylinder
Edit a group
To Edit an existing group in the main menu select New entity > Group > Edit. This menu is designed in the same way as the Create a group menu.
The Result of the operation will be a GEOM_Object.
TUI Command:
-
geompy.AddObject(Group, SubShapeID), where Group is a group to which a sub-shape has to be added, SubShapeID is an ID of the sub-shape to be added to the group.
-
geompy.RemoveObject(Group, SubShapeID), where Group is a group from which a sub-shape has to be removed, SubShapeID is an ID of the sub-shape to be removed from the group.
-
geompy.GetObjectIDs(Group), where Group is a group for which its object's are returned.
Returns: List of IDs.
Arguments: 1 Shape + its sub-shapes.
Dialog Box:
Our TUI Scripts provide you with useful examples of Working with Groups.