Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

Air Vent Methods/Properties

Discussion in 'Programming Questions and Suggestions' started by Computermaster, Apr 29, 2015.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. Computermaster Trainee Engineer

    Messages:
    3
    Where can I find a complete listing of all the air vent information?

    I've already searched the forums, used Google, and checked Documentation.chm in the Tools folder.

    I'm referring to a listing like this:

    Spotlight
    Interface name: IMyReflectorLight
    Parent: IMyLightingBlock
    Parent: IMyFunctionalBlock
    Fields:
    float Radius
    float Intensity
    float BlinkIntervalSeconds
    float BlinkLenght
    float BlinkOffset
    Terminal properties:
    Color -> Color
    Radius -> Single
    Falloff -> Single
    Intensity -> Single
    Blink Interval -> Single
    Blink Lenght -> Single
    Blink Offset -> Single
    Actions:
    OnOff -> Toggle block On/Off
    OnOff_On -> Toggle block On
    OnOff_Off -> Toggle block Off
    IncreaseRadius -> Increase Radius
    DecreaseRadius -> Decrease Radius
    IncreaseBlink Interval -> Increase Blink Interval
    DecreaseBlink Interval -> Decrease Blink Interval
    IncreaseBlink Lenght -> Increase Blink Length
    DecreaseBlink Lenght -> Decrease Blink Length
    IncreaseBlink Offset -> Increase Blink Offset
    DecreaseBlink Offset -> Decrease Blink Offset
     
  2. mexmer Senior Engineer

    Messages:
    1,977
    for block fields (accessors), you can check in documention for actions/properties, you can use following code
    Code:
    void Main()
    {
    IMyTextPanel screen2 = (IMyTextPanel) GridTerminalSystem.GetBlockWithName("LCD Test");
    if (screen2 != null)
    {
    StringBuilder values = new StringBuilder();
    List<IMyTerminalBlock> blocks = new List<IMyTerminalBlock>();
    StringBuilder test = new StringBuilder();
    GridTerminalSystem.GetBlocksOfType<IMyAirVent>(blocks);
    if (blocks.Count > 0)
    {
    List<ITerminalAction> resultList = new List<ITerminalAction>();
    IMyTerminalBlock unit = blocks[0];
    unit.GetActions(resultList);
    values.Append("IMyAirVent\nActions:\n" + unit.CustomName + "\n");
    for (int i=0;i<resultList.Count;i++)
    {
    StringBuilder temp = new StringBuilder();
    values.Append(resultList[i].Id + ":" + resultList[i].Name + "(");
    
    if (resultList[i].Id.Length == 0)
    resultList[i].WriteValue(unit, temp);
    else
    unit.GetActionWithName(resultList[i].Id.ToString()).WriteValue(unit, temp);
    
    values.Append(temp.ToString());
    values.Append(")\n");
    }
    List<ITerminalProperty> propList = new List<ITerminalProperty>();
    unit.GetProperties(propList);
    values.Append("\nProperties:\n");
    for (int i=0;i<propList.Count;i++)
    values.Append(propList[i].Id + ":" + propList[i].TypeName + "\n");
    values.Append("\nDetailedInfo:\n" + unit.DetailedInfo);
    values.Append("\n----------\n");
    }
    else
    values.Append("No Blocks Found");
    
    screen2.SetValue("FontSize", 0.8f);
    screen2.ShowTextureOnScreen();
    screen2.WritePublicText(values.ToString());
    screen2.ShowPublicTextOnScreen();
    }
    
     
Thread Status:
This last post in this thread was made more than 31 days old.