# Sandbox.Model.GetMaterialGroupIndex

```csharp
int GetMaterialGroupIndex(string groupIndex)
```

Retrieves the index of a material group given its name.

### Parameters

- `groupIndex` (`string`): The name of the material group.

### Returns

`int`: The index of the material group, or a negative value if the group does not exist.

Declared in [Sandbox.Model](/api/Sandbox.Model).
Assembly: `Sandbox.Engine`.
