# GetEnumerator()

> Retrieves an iterator that allows you to iterate over all elements within the Tilemap.PositionArray.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.Tilemaps](/engine/6000.7/script-reference/unityengine/tilemaps.md)
* **Assembly:** UnityEngine.TilemapModule

```csharp
public readonly IEnumerator<Vector3Int> GetEnumerator()
```

### Returns

| Type                                                                                                        | Description                                                                                                                                                                 |
| ----------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [IEnumerator\<Vector3Int>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerator-1) | An iterator that allows you to iterate over all elements within the [Tilemap.PositionArray](/engine/6000.7/script-reference/unityengine/tilemaps/tilemap/positionarray.md). |
