Main Content

Object Groups

Group objects are invisible containers for graphics objects. Use group objects to form a collection of objects that can behave as one object in certain respects. When you set properties of the group object, the result applies to the objects contained in the group.

For example, you can make the entire group visible or invisible, select all objects when only one is clicked, or apply a transform matrix to reposition the objects.

Group objects can contain any of the objects that axes can contain, such as lines, surfaces, text, and so on. Group objects can also contain other group objects. Group objects are always parented to an axes object or another group object.

There are two kinds of group objects:

  • Group — Use when you want to create a group of objects and control the visibility or selectability of the group based on what happens to any individual object in the group. Create group objects with the hggroup function.

  • Transform — Use when you want to transform a group of objects. Transforms include rotation, translation, and scaling. For an example, see Nest Transforms for Complex Movements. Create transform objects with the hgtransform function.

The difference between the group and transform objects is that the transform object can apply a transform matrix (via its Matrix property) to all objects for which it is the parent.