a:grpSpPr (Group Shape Properties)
Specifies properties for a group of shapes (position, size, fill, line, and effects).
Parent elements
Description
a:grpSpPr defines properties for a group shape (container holding multiple shapes). It is defined in ECMA-376 Part 1 §20.1.2.12.
A group shape allows multiple shapes to be treated as a single unit with:
- Shared transformation (position, size, rotation)
- Shared styling (fill, line properties, effects)
- Hierarchical structure – shapes within the group inherit or override properties
Children of a group shape (a:spPr elements) can override or inherit from group properties.
Attributes
| Attribute | Type | Possible Values | Description |
|---|---|---|---|
| (none) | — | — | a:grpSpPr has no attributes; all configuration is via child elements. |
Examples
Group Shape with Transformation and Fill
<a:grpSpPr>
<a:xfrm>
<a:off x="914400" y="914400"/>
<a:ext cx="3657600" cy="2743200"/>
</a:xfrm>
<a:solidFill>
<a:srgbClr val="FFFFFF"/>
</a:solidFill>
<a:ln w="19050">
<a:solidFill><a:srgbClr val="000000"/></a:solidFill>
</a:ln>
</a:grpSpPr>
using DocumentFormat.OpenXml.Drawing;
var grpSpPr = new GroupShapeProperties();
// Transform (position and size)
var xfrm = new Transform2D();
xfrm.Append(new Offset { X = 914400, Y = 914400 });
xfrm.Append(new Extents { Cx = 3657600, Cy = 2743200 });
grpSpPr.Append(xfrm);
// Fill
grpSpPr.Append(new SolidFill(new RgbColorModelHex { Val = "FFFFFF" }));
// Line
var line = new LineProperties { Width = 19050 };
line.Append(new SolidFill(new RgbColorModelHex { Val = "000000" }));
grpSpPr.Append(line);
Group Shape with No Fill and Gradient Line
<a:grpSpPr>
<a:xfrm>
<a:off x="1828800" y="0"/>
<a:ext cx="2286000" cy="1828800"/>
</a:xfrm>
<a:noFill/>
<a:ln w="25400">
<a:gradFill>
<a:gsLst>
<a:gs pos="0"><a:srgbClr val="FF0000"/></a:gs>
<a:gs pos="100000"><a:srgbClr val="0000FF"/></a:gs>
</a:gsLst>
<a:lin ang="2700000" scaled="1"/>
</a:gradFill>
</a:ln>
</a:grpSpPr>
var grpSpPr = new GroupShapeProperties();
var xfrm = new Transform2D();
xfrm.Append(new Offset { X = 1828800, Y = 0 });
xfrm.Append(new Extents { Cx = 2286000, Cy = 1828800 });
grpSpPr.Append(xfrm);
// No fill
grpSpPr.Append(new NoFill());
// Gradient line
var line = new LineProperties { Width = 25400 };
var gradFill = new GradientFill();
// ... add gradient stops ...
line.Append(gradFill);
grpSpPr.Append(line);
Notes
- Group shape properties apply to the entire group and create a coordinate space for contained shapes.
- Child shapes (
a:sp,a:grpSp,a:pic) inherit properties but can override them. - Transforms in
a:grpSpPrdefine the group’s overall bounding box; child transforms are relative to the group’s coordinate system. - Fills and lines in group properties serve as defaults; individual shapes can have different styles.
- Group shapes support nesting – a group can contain other groups for hierarchical organization.