a:grpSp (Group Shape)

Represents a container for grouping multiple shapes together, allowing them to be manipulated as a single unit.

Description

a:grpSp is the DrawingML group shape element that acts as a container for multiple shapes. It is defined in ECMA-376 Part 1 §20.1.2.4.1.

Group shapes allow multiple objects to be:

  • Grouped together as a single visual unit
  • Moved, resized, and formatted together
  • Nested to create complex hierarchies
  • Managed with collective properties while maintaining individual formatting

Group shapes are essential for:

  • Creating complex diagrams with related elements
  • Organizing shapes in hierarchical structures
  • Building reusable components and layouts
  • Managing large sets of objects efficiently
  • Creating flowcharts and structured diagrams

Attributes

Attribute Type Possible Values Description
(none) - - All properties defined through child elements.

Examples

Simple Group with Two Shapes

<p:grpSp xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
  <p:nvGrpSpPr>
    <p:cNvPr id="1" name="Group 1"/>
    <p:cNvGrpSpPr/>
    <p:nvPr/>
  </p:nvGrpSpPr>
  <p:grpSpPr>
    <a:xfrm>
      <a:off x="1000000" y="1000000"/>
      <a:ext cx="5000000" cy="3000000"/>
      <a:chOff x="0" y="0"/>
      <a:chExt cx="5000000" cy="3000000"/>
    </a:xfrm>
  </p:grpSpPr>
  <p:sp>
    <p:nvSpPr>
      <p:cNvPr id="2" name="Rectangle"/>
      <p:cNvSpPr/>
      <p:nvPr/>
    </p:nvSpPr>
    <p:spPr>
      <a:xfrm>
        <a:off x="1000000" y="1000000"/>
        <a:ext cx="2000000" cy="1000000"/>
      </a:xfrm>
      <a:prstGeom prst="rect">
        <a:avLst/>
      </a:prstGeom>
      <a:solidFill>
        <a:srgbClr val="0070C0"/>
      </a:solidFill>
    </p:spPr>
    <p:txBody>
      <a:bodyPr/>
      <a:lstStyle/>
      <a:p/>
    </p:txBody>
  </p:sp>
</p:grpSp>

Nested Groups (Hierarchical Structure)

<p:grpSp xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
  <p:nvGrpSpPr>
    <p:cNvPr id="1" name="Parent Group"/>
    <p:cNvGrpSpPr/>
    <p:nvPr/>
  </p:nvGrpSpPr>
  <p:grpSpPr>
    <a:xfrm>
      <a:off x="0" y="0"/>
      <a:ext cx="10000000" cy="6000000"/>
      <a:chOff x="0" y="0"/>
      <a:chExt cx="10000000" cy="6000000"/>
    </a:xfrm>
  </p:grpSpPr>
  <!-- Can contain nested groups and shapes -->
  <p:grpSp>
    <p:nvGrpSpPr>
      <p:cNvPr id="2" name="Child Group"/>
      <p:cNvGrpSpPr/>
      <p:nvPr/>
    </p:nvGrpSpPr>
    <p:grpSpPr>
      <a:xfrm>
        <a:off x="1000000" y="1000000"/>
        <a:ext cx="4000000" cy="4000000"/>
        <a:chOff x="0" y="0"/>
        <a:chExt cx="4000000" cy="4000000"/>
      </a:xfrm>
    </p:grpSpPr>
  </p:grpSp>
</p:grpSp>

Notes

  • Group shapes have child offset and child extent for coordinate space transformation
  • Groups can be nested to any depth for complex hierarchies
  • Moving or resizing a group affects all contained shapes proportionally
  • Group shapes can contain shapes, pictures, text shapes, and other groups
  • Each child shape maintains its own positioning within the group’s coordinate space
  • Non-visual properties essential for naming and identifying groups
  • Child extents define the coordinate space for contained shapes
  • Groups improve document organization and maintainability