# GetSelection()

> Returns the list of TreeViewItem IDs that are currently selected.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.IMGUI.Controls](/engine/6000.0/script-reference/unityeditor/imgui/controls.md)
* **Assembly:** UnityEditor

```csharp
public IList<int> GetSelection()
```

### Returns

| Type                                                                                     | Description |
| ---------------------------------------------------------------------------------------- | ----------- |
| [IList\<int>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ilist-1) |             |
