# Sandbox.Model.GetMaterials

## Overload 1

```csharp
IEnumerable<Material> GetMaterials(int groupIndex)
```

Retrieves an enumerable collection of Materials belonging to a specified group.

### Parameters

- `groupIndex` (`int`): The index of the material group. Default value is 0.

### Returns

`IEnumerable<Material>`: An IEnumerable of Materials in the specified group.

## Overload 2

```csharp
IEnumerable<Material> GetMaterials(string groupName)
```

Retrieves an enumerable collection of Materials belonging to a specified group.

### Parameters

- `groupName` (`string`): The name of the material group.

### Returns

`IEnumerable<Material>`: An IEnumerable of Materials in the specified group.

### Exceptions

- `System.ArgumentException`: Thrown when the provided group name does not exist.

Declared in [Sandbox.Model](/api/Sandbox.Model).
Assembly: `Sandbox.Engine`.
