Skip to main content
You must create a lasso selection before calling this API. The lasso selection must contain exactly one geometry; otherwise the call fails.
static modifyLassoGeometry(geometry: Geometry): Promise<APIResponse<boolean>>;
Parameters
ParameterTypeDescription
geometryGeometryGeometry data
Returns

Example

import { PluginCommAPI, type Geometry } from 'sn-plugin-lib';

/**
 * Example: modify the lasso-selected geometry.
 */
export async function exampleModifyLassoGeometry() {
 const listRes = await PluginCommAPI.getLassoGeometries();
 if (!listRes.success) {
 throw new Error(listRes.error?.message ?? 'getLassoGeometries call failed');
 }

 const geometries = (listRes.result ?? []) as Geometry[];

 if (geometries.length !== 1) {
 throw new Error('Make sure the current lasso selection includes exactly one geometry');
 }
 const first = geometries[0];
 if (!first) {
 return false;
 }

 const res = await PluginCommAPI.modifyLassoGeometry(first);
 if (!res.success) {
 throw new Error(res.error?.message ?? 'modifyLassoGeometry call failed');
 }
 return res.result;
}