remote and control seat is not seen as IMyFuntionalblock,

Twotwinbrothers shared this bug 5 years ago
Outdated

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");
}}}

Replies (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

Leave a Comment
 
Attach a file