Skip to main content

Home > blockly > WorkspaceSvg > newBlock

WorkspaceSvg.newBlock() method

Obtain a newly created block.

Signature:

newBlock(prototypeName: string, opt_id?: string): BlockSvg;

Parameters

ParameterTypeDescription
prototypeNamestringName of the language object containing type-specific functions for this block.
opt_idstring(Optional) Optional ID. Use this ID if provided, otherwise create a new ID.

Returns:

BlockSvg

The created block.