SelectionManager Class
Deprecated in 5.0 - will not be removed until after 2026-06-13. Use SelectionStorage from @itwin/unified-selection package instead.
The selection manager which stores the overall selection.
Implements
- ISelectionProvider
- Disposable
Methods
| Name | Description | |
|---|---|---|
| constructor(props: SelectionManagerProps): SelectionManager | Creates an instance of SelectionManager. | |
| [dispose](): void | ||
| addToSelection(source: string, imodel: IModelConnection, keys: Keys, level: number = 0, rulesetId?: string): void | Add keys to the selection | |
| addToSelectionWithScope(source: string, imodel: IModelConnection, ids: Id64Arg, scope: string | SelectionScope | SelectionScopeProps, level: number = 0, rulesetId?: string): Promise<void> | Add keys to selection after applying selection scope on them. | |
| clearSelection(source: string, imodel: IModelConnection, level: number = 0, rulesetId?: string): void | Clear current selection | |
| dispose(): void | Deprecated | |
| getHiliteSet(imodel: IModelConnection): Promise<HiliteSet> | Get the current hilite set for the specified imodel | |
| getHiliteSetIterator(imodel: IModelConnection): AsyncIterableIterator<HiliteSet, any, any> | Get the current hilite set iterator for the specified imodel. | |
| getSelection(imodel: IModelConnection, level: number = 0): Readonly<KeySet> | Get the selection currently stored in this manager | |
| getSelectionLevels(imodel: IModelConnection): number[] | Get the selection levels currently stored in this manager for the specified imodel | |
| removeFromSelection(source: string, imodel: IModelConnection, keys: Keys, level: number = 0, rulesetId?: string): void | Remove keys from current selection | |
| removeFromSelectionWithScope(source: string, imodel: IModelConnection, ids: Id64Arg, scope: string | SelectionScope | SelectionScopeProps, level: number = 0, rulesetId?: string): Promise<void> | Remove keys from current selection after applying selection scope on them. | |
| replaceSelection(source: string, imodel: IModelConnection, keys: Keys, level: number = 0, rulesetId?: string): void | Replace current selection | |
| replaceSelectionWithScope(source: string, imodel: IModelConnection, ids: Id64Arg, scope: string | SelectionScope | SelectionScopeProps, level: number = 0, rulesetId?: string): Promise<void> | Replace current selection with keys after applying selection scope on them. | |
| setSyncWithIModelToolSelection(imodel: IModelConnection, sync: boolean = true): void | Request the manager to sync with imodel's tool selection (see IModelConnection.selectionSet). |
|
| suspendIModelToolSelectionSync(imodel: IModelConnection): { [dispose]: () => void, dispose: () => void } | Temporarily suspends tool selection synchronization until the returned Disposable |
Properties
| Name | Type | Description | |
|---|---|---|---|
| scopes Readonly | SelectionScopesManager | Manager for selection scopes | |
| selectionChange Readonly | SelectionChangeEvent | An event which gets broadcasted on selection changes | |
| selectionStorage Readonly | SelectionStorage | Underlying selection storage used by this selection manager. |
Defined in
Last Updated: 28 October, 2025
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.