> ## Documentation Index
> Fetch the complete documentation index at: https://docs.supernote.com/llms.txt
> Use this file to discover all available pages before exploring further.

# getLassoElements

> Get lasso data (element list). On success, accessor fields are filled.

<Note>
  You must create a lasso selection before calling this API; otherwise the call fails.
</Note>

```ts theme={null}
static getLassoElements(): Promise<APIResponse<Element[]>>;
```

**Returns**

* [`APIResponse<Element[]>`](/en/api-reference/supernote-plugin/types/api-response):
  See [`Element`](/en/api-reference/supernote-plugin/types/trail) for element types and fields.

## Example

```ts wrap theme={null}
import { PluginCommAPI, ElementType, type Element } from 'sn-plugin-lib';

/**
 * Example: get lasso elements and filter by type.
 */
export async function exampleGetLassoElements() {
 const res = await PluginCommAPI.getLassoElements();
 if (!res.success) {
 throw new Error(res.error?.message ?? 'getLassoElements call failed');
 }

 const elements = (res.result ?? []) as Element[];
 const strokes = elements.filter((e) => e.type === ElementType.TYPE_STROKE);
 return { elements, strokes };
}
```
