如何获取 Blockly 工作区中的块总数

How do I get the total number of blocks in a Blockly workspace

如果我有一个 Blockly 工作区,我怎样才能得到正在使用的块总数?

workspace.getAllBlocks(false).length

文档:https://developers.google.com/blockly/reference/js/Blockly.Workspace#getAllBlocks