void helloSurface(IMyTextSurface surface, int n = 0, string providerName = "NONE") { string s = "provider: " + providerName + "\n"; try { IMyTerminalBlock b = (IMyTerminalBlock)surface; s += "block: " + b.CustomName + "\n"; } catch { s += "block: EXCEPTION\n"; } s += "#" + n + " Name: " + surface.Name + "\n"; s += "DisplayName: " + surface.DisplayName + "\n"; surface.ContentType = ContentType.TEXT_AND_IMAGE; const string font = "Monospace"; surface.Font = font; Vector2 scale = surface.MeasureStringInPixels(new StringBuilder(s), font, 1); Vector2 size = surface.SurfaceSize; s += "width: " + size.X + "\n"; s += "est. text width: " + scale.X; surface.FontSize = size.X / scale.X; // the computed width seems off for some of the new displays, in particular "keyboard" paels surface.WriteText(s); } void Main(string argument) { // LCD Panels are not derived from TextPanelProvider... List surfaces = new List(); GridTerminalSystem.GetBlocksOfType(surfaces, b=> (Me.CubeGrid == ((IMyTerminalBlock)b).CubeGrid)); foreach(var surface in surfaces) helloSurface(surface); // ... while the new Displays are not derived from MyTerminalBlock List providers = new List(); GridTerminalSystem.GetBlocksOfType(providers, b => (Me.CubeGrid == ((IMyTerminalBlock)b).CubeGrid)); foreach(var provider in providers) { IMyTerminalBlock b = (IMyTerminalBlock) provider; string providerName = b.CustomName; for (int n = 0; n < provider.SurfaceCount; n++) helloSurface(provider.GetSurface(n), n, providerName); } }