# Buckets2D<T> class

Namespace: [Grasshopper2.Collections](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.collections.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public sealed class Buckets2D<T>
```

Represents a two-dimensional array of rectangular spatial buckets. The buckets are anchored at an origin point (lower left corner of the region).

**Type parameters:**

- `T`

## Properties

- [CellHeight](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.buckets2d-1/cellheight.md): Gets the height of each row.
- [CellWidth](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.buckets2d-1/cellwidth.md): Gets the width of each column.
- [Columns](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.buckets2d-1/columns.md): Gets the number of columns.
- [Count](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.buckets2d-1/count.md): Gets the total number of cells.
- [EnumerateHorizontal](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.buckets2d-1/enumeratehorizontal.md): Enumerate over all items starting at [0,0] and completing row=0 from left to right before switching to the row above. This is the most natural way to iterate over a bucket list.
- [EnumerateVertical](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.buckets2d-1/enumeratevertical.md): Enumerate over all items starting at[0, 0] and completing column=0 from bottom to top before switching to the column to the right.
- [OriginX](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.buckets2d-1/originx.md): Gets the leftmost x-coordinate of the first column.
- [OriginY](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.buckets2d-1/originy.md): Gets the bottommost y-coordinate of the first row.
- [Rows](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.buckets2d-1/rows.md): Gets the number of rows.

## Indexers

- [this[]](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.buckets2d-1/item.md): (2 overloads) Access this two-dimensional array.

## Methods

- [CellCorners](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.buckets2d-1/cellcorners.md): Gets the physical corners of a cell within the bucket space.
- [CellEvaluate](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.buckets2d-1/cellevaluate.md): Evaluate a point in cell coordinates.
- [Create](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.buckets2d-1/create.md): (6 overloads, static) Create a bucket grid inside a boundingbox.
- [EnumerateAroundCell](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.buckets2d-1/enumeratearoundcell.md): (3 overloads) Enumerate over all eight cells surrounding a given cell, but omitting the non-existent ones.
- [EnumerateSubset](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.buckets2d-1/enumeratesubset.md): (2 overloads) Enumerate over all valid, filtered cells in some subdomain.
- [FindCellIndex](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.buckets2d-1/findcellindex.md): Find the (column, row) index pair of the cell which contains the given point. The index pair is always valid.
- [IsValidIndex](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.buckets2d-1/isvalidindex.md): Gets whether a [column,row] index pair is within the bucket domain.
- [SetAll](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.buckets2d-1/setall.md): Assign a value to all cells in this array.
- [ToArray](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.buckets2d-1/toarray.md): Gets a linear copy of the array.
- [ToNestedArray](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.buckets2d-1/tonestedarray.md): Gets a nested array copy of this bucket list. The secondary arrays represent the individual rows.
- [ToString](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.buckets2d-1/tostring.md): Gets a string representation of this Buckets2D.
