remote and control seat is not seen as IMyFuntionalblock,

Roy Winter shared this bug 19 months ago
Considered

I use this code to add a "itemname" to every Terminal block. only the RemoteControl wil not add "itemname" to its name.


why can a remote and control seat not be turn off?


List<IMyTerminalBlock> listl = new List<IMyTerminalBlock >();
GridTerminalSystem.GetBlocksOfType<IMyFunctionalBlock >(listl);
for(int i = 0;i < listl.Count;i++){
IMyFunctionalBlock term = listl as IMyFunctionalBlock;

if(arg.Contains("instal")){
if(!term.CustomName.Contains(itemname) ){
term.CustomName =(itemname+term.CustomName);
Echo (term+" installed");
}}
if(arg.Contains("uninstal")){
if(term.CustomName.Contains(itemname) ){
term.CustomName = (term.CustomName.Replace (itemname,""));
Echo (term+" uninstalled");
}}}

Comments (3)

photo
1

You are looking up IMyFunctionalBlocks. Remote control does not have that interface so won't be found this way.

photo
2

If you are trying to tag all terminal blocks, then maybe do this instead:

GridTerminalSystem.GetBlocksOfType<IMyTerminalBlock>(listl);


That way you can also modify blocks that aren't part of the IMyFunctionalBlock family

photo
1

Hello, Engineer!


Thank you for your feedback! Your topic has been added between considered issues.

Please keep voting for the issue as it will help us to identify the most serious bugs.


We really appreciate your patience.


Kind Regards

Keen Software House: QA Department