HomeGuidesRecipesDocumentationChangelog
Log InDiscussions
Discussions

Selection

This module is used to interact with the current scene selection set, which is the set of currently selected nodes in the active scene.

Example Selection

Click on a part of the air compressor to print information to the page (see even more details in the console).

Selection

includes

Checks if the selection set includes node(s).
Kind: inner property of Selection

parametertype
queryQueryObject | string | Array

toggle(query)

Toggles node(s) to the selection set.
Kind: inner method of Selection

parametertype
queryQueryObject | string | Array

add(query)

Adds node(s) to the selection set.
Kind: inner method of Selection

selectionSet.add({ name: 'Box' });
parametertype
queryQueryObject | string

remove(query)

Removes node(s) from the selection set.
Kind: inner method of Selection

selectionSet.remove({ name: 'Box' });
parametertypedescription
queryQueryObject | string | Array query object or nodeId or array of nodeIds

clear()

Removes all node(s) from the selection set.
Kind: inner method of Selection

selectionSet.clear()

Selection~set(query)

Set the node(s) of the selection set.
Kind: inner method of Selection

parametertype
queryQueryObject | string

getStyle()

Returns the style object for the selection set.
Kind: inner method of Selection

setStyle(selectionSetStyle)

Sets the selection set styling properties.
Kind: inner method of Selection

parametertype
selectionSetStyleSelectionSetStyle

Options

nametype
[outlineColor]color
[outlineThickness]integer
[color]color
[opacity]integer Value should be between 0 & 2
selectionSet.setStyle({ outlineColor: '#00ff00', outlineThickness: 2, color: '#ff0000', opacity: 0.5 });