Stay organized with collections
Save and categorize content based on your preferences.
blockly > Workspace > remainingCapacityOfType
Workspace.remainingCapacityOfType() method
The number of blocks of the given type that may be added to the workspace before reaching the maxInstances allowed for that type.
Signature:
remainingCapacityOfType(type: string): number;
Parameters
Parameter |
Type |
Description |
type |
string |
Type of block to return capacity for. |
Returns:
number
Number of blocks of type left.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eremainingCapacityOfType\u003c/code\u003e method calculates the remaining number of blocks of a specific type that can be added to a Blockly workspace before reaching its maximum capacity.\u003c/p\u003e\n"],["\u003cp\u003eIt takes the block type as a string argument and returns the remaining capacity as a number.\u003c/p\u003e\n"],["\u003cp\u003eThis method helps manage the number of blocks of a specific type within a workspace.\u003c/p\u003e\n"]]],[],null,["[blockly](./blockly.md) \\\u003e [Workspace](./blockly.workspace_class.md) \\\u003e [remainingCapacityOfType](./blockly.workspace_class.remainingcapacityoftype_1_method.md)\n\nWorkspace.remainingCapacityOfType() method\n------------------------------------------\n\nThe number of blocks of the given type that may be added to the workspace before reaching the maxInstances allowed for that type.\n\n**Signature:** \n\n remainingCapacityOfType(type: string): number;\n\nParameters\n----------\n\n| Parameter | Type | Description |\n|-----------|--------|---------------------------------------|\n| type | string | Type of block to return capacity for. |\n\n**Returns:**\n\nnumber\n\nNumber of blocks of type left."]]