Template:APIStub
From Space Engineers Wiki
Contents
Usage
Examples
Search For Single Block With Name
void Main()
{
IMyBeacon beacon = GridTerminalSystem.GetBlockWithName("Beacon"); //beacon is initialized to the first block that is named "Beacon"
}
Search For All Blocks Of Type
void Main()
{
List<IMyTerminalBlock> blocks = new List<IMyTerminalBlock>();
GridTerminalSystem.GetBlocksOfType<IMyBeacon>(blocks); //search for all blocks of type "beacon" and put them into the "blocks" list.
}
Search For All Blocks With Part of a Name
void Main()
{
List<IMyTerminalBlock> blocks = new List<IMyTerminalBlock>();
GridTerminalSystem.GetBlocksOfName("[Docking]", blocks); //retrieves all blocks with the string [Docking] in the name and puts them into the blocks list.
}