blockly > Obszar roboczy > getBlockById
Metoda Workspace.getBlockById()
Znajdź w tym obszarze roboczym bryłę o określonym identyfikatorze.
Podpis:
getBlockById(id: string): Block | null;
Parametry
Parametr |
Typ |
Opis |
id |
ciąg znaków |
Identyfikator bloku do znalezienia. |
Zwroty:
Zablokuj | wartość null
Żądany blok lub wartość null, jeśli nie znaleziono.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2024-08-22 UTC.
[null,null,["Ostatnia aktualizacja: 2024-08-22 UTC."],[[["The `getBlockById()` method searches for a block within the workspace using its unique ID."],["It accepts a single argument, `id` (string), which represents the ID of the target block."],["If found, the method returns the corresponding `Block` object; otherwise, it returns `null`."]]],[]]