blockly > Workspace > getAllBlocks

Workspace.getAllBlocks() method

Find all blocks in workspace. Blocks are optionally sorted by position; top to bottom (with slight LTR or RTL bias).

Signature:

getAllBlocks(ordered?: boolean): Block[];

Parameters

Parameter Type Description
ordered boolean (Optional) Sort the list if true.

Returns:

Block[]

Array of blocks.