---
title: "SetSelectionCmd | Customer's Canvas On-Premises"
canonical: "https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/SetSelectionCmd/"
---

# SetSelectionCmd

> The command to set the text selection by start and end points.

## Classes

### SetSelectionCmd

#### Implements

- [`ICommand`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICommand.md#icommand)

#### Constructors

##### Constructor

```ts
new SetSelectionCmd(textManager, initData): SetSelectionCmd;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `textManager` | [`ITextManager`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ITextManager.md#itextmanager) |
| `initData` | [`SetSelectionCmdData`](#setselectioncmddata) |

###### Returns

[`SetSelectionCmd`](#setselectioncmd)

#### Methods

##### execute()

```ts
execute(): boolean;
```

Executes the command.

###### Returns

`boolean`

true if changes were made, false otherwise.

###### Implementation of

[`ICommand`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICommand.md#icommand).[`execute`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICommand.md#execute)

***

### SetSelectionCmdData

Data required to initialize the command.

#### Constructors

##### Constructor

```ts
new SetSelectionCmdData(startPoint, endPoint): SetSelectionCmdData;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `startPoint` | [IPoint](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/IPoint.md) |
| `endPoint` | [IPoint](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/IPoint.md) |

###### Returns

[`SetSelectionCmdData`](#setselectioncmddata)

#### Properties

##### endPoint

```ts
endPoint: IPoint;
```

The end point for text selection.

##### startPoint

```ts
startPoint: IPoint;
```

The starting point for text selection.
