Skip to main content

Type Alias: AddProductToSnappingPoint()

AddProductToSnappingPoint = (instanceId, snapIdTo, productId?, force?) => Promise<boolean>

Function

Adds a product to a specific snapping point on a modular scene.

The target instance and snap mesh identify the existing connection point. Without productId, the action uses the product currently selected for addition in Redux. Supplying productId overrides that selection for this placement only and does not change the selected-product observer state.

Occupied snapping points are rejected by default. Set force to true only when the integration intentionally permits more than one connection at the target snap. Forced placement still respects snap visibility, conditional rules, product compatibility, and collision validation.

Parameters

instanceId

string

Unique ID of the existing scene product that owns the target snap point

snapIdTo

string

Mesh ID of the target snapping point on the existing product

productId?

string

Optional product ID to add instead of the Redux-selected product

force?

boolean

Whether to allow placement when the target snap is already occupied. Defaults to false

Returns

Promise<boolean>

true when the product was added, or false when validation or placement failed

Example

// Use the product currently selected in the modular product picker
await window.mimeeqApp.actions.addProductToSnappingPoint(instanceId, snapIdTo);

// Add a specific product directly, without changing the picker selection
await window.mimeeqApp.actions.addProductToSnappingPoint(
instanceId,
snapIdTo,
productId,
);

// Deliberately use an occupied snap while keeping all other validation active
const added = await window.mimeeqApp.actions.addProductToSnappingPoint(
instanceId,
snapIdTo,
productId,
true,
);