Skip to main content
This API creates or updates the current lasso selection using a rectangle (pixel coordinates). After calling it successfully, you can call other lasso-related APIs (for example getLassoRect() / getLassoElements()).
static lassoElements(rect: Rect): Promise<APIResponse<boolean>>;
Parameters
ParameterTypeDescription
rectRectSelection rectangle (pixel coordinates)
Returns

Example

import { PluginCommAPI } from 'sn-plugin-lib';

export async function exampleLassoElements() {
 const rect = { left: 100, top: 120, right: 600, bottom: 400 };
 const res = await PluginCommAPI.lassoElements(rect);
 if (!res.success) {
 throw new Error(res.error?.message ?? 'lassoElements call failed');
 }
 return res.result;
}