# Sandbox.VertexBuffer.AddIndex

```csharp
void AddIndex(int i)
```

Add an index. This is relative to the top of the vertex buffer. So 0 is Vertex.Count., 1 is Vertex.Count -1

### Parameters

- `i` (`int`)

### Exceptions

- `System.InvalidOperationException`: Thrown when [Sandbox.VertexBuffer.Indexed](/api/Sandbox.VertexBuffer/Indexed) is false.

Declared in [Sandbox.VertexBuffer](/api/Sandbox.VertexBuffer).
Assembly: `Sandbox.Engine`.
