# `GSShapeGroup initWithId:`

*Initializer*

Creates a new shapes group with a given ID.

## Declaration

```swift
init(id groupId: GSShapeGroup.ID)
```

```objc
- (instancetype) initWithId:(GSShapeGroupID) groupId;
```

```python
initWithId_(groupId: GSShapeGroupID) -> GSShapeGroup
```

## Parameters

- `groupId` — Use a per-layer unique value, for example, `[[NSUUID new] UUIDString]`. A group ID of the empty string is reserved for root groups ([`GSShapeGroupID.GSShapeGroupIDRoot`](/Core/GlyphsCore/GSShapeGroup/GSShapeGroupID/GSShapeGroupIDRoot), use [`GSShapeGroup rootGroupWithParent:`](/Core/GlyphsCore/GSShapeGroup/rootGroupWithParent:) instead).

## Discussion

The [`GSShapeGroup.shapes`](/Core/GlyphsCore/GSShapeGroup/shapes) array is set by the [`GSLayer`](/Core/GlyphsCore/GSLayer) depending on the [`GSShapeKey.GSShapeKeyParentGroupId`](/Core/GlyphsCore/GSShapeKey/GSShapeKeyParentGroupId) attribute value of other shapes.

## See Also

### Creating a Shape Group

- [`GSShapeGroup rootGroupWithParent:`](/Core/GlyphsCore/GSShapeGroup/rootGroupWithParent:) — Creates the root group for a layer.

