SensorSwitch class

The SensorSwitch class gives you access to *SENSOR_SWITCH keyword in PRIMER. More...

The PRIMER JavaScript API provides many class constants, properties and methods. For Arup to be able to extend and enhance the API in the future any constant, property or method names beginning with a lowercase or uppercase letter are reserved.
If you need to add your own properties or methods to one of the existing classes then to avoid any potential future conflict you should ensure that the name begins with either an underscore (_) or a dollar sign ($) or the name is prefixed with your own unique identifier.
For example if company 'ABC' need to add a property called 'example' then to avoid any potential future conflict use one of:

Class functions

Member functions

SensorSwitch constants

Name Description
SensorSwitch.SWITCH Sensor switch is *SENSOR_SWITCH.
SensorSwitch.SWITCH_CALC_LOGIC Sensor switch is *SENSOR_SWITCH_CALC-LOGIC.
SensorSwitch.SWITCH_SHELL_TO_VENT Sensor switch is *SENSOR_SWITCH_SHELL_TO_VENT.

SensorSwitch properties

Name Type Description
abid integer Airbag ID.
amax real Maximum allowable area for failed vent surface area (VA).
c23 integer/real Vent coefficient if positive or user defined load curve ID if negative.
exists (read only) logical true if *SENSOR_SWITCH exists, false if referred to but not defined.
filtrid integer Filter ID.
id integer Part set ID or Part ID.
id_flag logical Turns _TITLE/_ID ON or OFF. Used only for SensorSwitch.SWITCH_SHELL_TO_VENT.
include integer The Include file number that the *SENSOR_SWITCH is in.
itype integer 0 for Part, 1 for Part Set.
label integer SensorSwitch number. The switid property is an alternative name for this.
logic string Logic operator.
model (read only) integer The Model number that the *SENSOR_SWITCH is in.
nrow integer Number of Shell Fail Time Cards.
nswit (read only) integer Number of sensor switch IDs defined. IDs can be positive for "AND", negative ID for "OR". Applicable to SensorSwitch.SWITCH_CALC_LOGIC.
option constant SENSOR_SWITCH suffix. Can be SensorSwitch.SWITCH, SensorSwitch.SWITCH_CALC_LOGIC or SensorSwitch.SWITCH_SHELL_TO_VENT.
sensid integer ID of the sensor whose value will be compared.
switid integer SensorSwitch number. The label property is an alternative name for this.
timwin real Trigger status change when the value given by the sensor is less/greater (depending on logic) than value for duration defined by timwin.
title string SensorSwitch title. Used only for SensorSwitch.SWITCH_SHELL_TO_VENT.
type string This property is deprecated in version R9.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Type used for sensor. Can either be "SENSOR" or "TIME"  [deprecated]
value real Critical value.

Detailed Description

The SensorSwitch class allows you to create, modify, edit and manipulate *SENSOR_SWITCH. See the documentation below for more details.

Constructor

new SensorSwitch(Option[constant], Model[Model], Switch ID[integer])

Description

Create a new SensorSwitch object.

Arguments

  • Option (constant)

    SENSOR_SWITCH suffix. Can be SensorSwitch.SWITCH, SensorSwitch.SWITCH_CALC_LOGIC or SensorSwitch.SWITCH_SHELL_TO_VENT.

  • Model (Model)

    Model that *SENSOR_SWITCH will be created in

  • Switch ID (integer)

    SensorSwitch id. This is required for the SensorSwitch.SWITCH and SensorSwitch.SWITCH_CALC_LOGIC options and ignored for SensorSwitch.SWITCH_SHELL_TO_VENT.

    Returns

    SensorSwitch object

    Return type

    SensorSwitch

    Example

    To create a new *SENSOR_SWITCH in model m with label 100:

    var sc = new SensorSwitch(SensorSwitch.SWITCH, m, 100);

    Details of functions

    AssociateComment(Comment[Comment])

    Description

    Associates a comment with a *SENSOR_SWITCH.

    Arguments

  • Comment (Comment)

    Comment that will be attached to the *SENSOR_SWITCH

    Returns

    No return value

    Example

    To associate comment c to the *SENSOR_SWITCH ss:

    ss.AssociateComment(c);


    Browse(modal (optional)[boolean])

    Description

    Starts an edit panel in Browse mode.

    Arguments

  • modal (optional) (boolean)

    If this window is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the window will be modal.

    Returns

    no return value

    Example

    To Browse *SENSOR_SWITCH ss:

    ss.Browse();


    ClearFlag(flag[Flag])

    Description

    Clears a flag on the *SENSOR_SWITCH.

    Arguments

  • flag (Flag)

    Flag to clear on the *SENSOR_SWITCH

    Returns

    No return value

    Example

    To clear flag f for *SENSOR_SWITCH ss:

    ss.ClearFlag(f);


    Copy(range (optional)[boolean])

    Description

    Copies the *SENSOR_SWITCH. The target include of the copied *SENSOR_SWITCH can be set using Options.copy_target_include.

    Arguments

  • range (optional) (boolean)

    If you want to keep the copied item in the range specified for the current include. Default value is false. To set current include, use Include.MakeCurrentLayer().

    Returns

    SensorSwitch object

    Return type

    SensorSwitch

    Example

    To copy *SENSOR_SWITCH ss into *SENSOR_SWITCH z:

    var z = ss.Copy();


    Create(Model[Model], modal (optional)[boolean]) [static]

    Description

    Starts an interactive editing panel to create a *SENSOR_SWITCH

    Arguments

  • Model (Model)

    Model that the *SENSOR_SWITCH will be created in.

  • modal (optional) (boolean)

    If this window is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the window will be modal.

    Returns

    SensorSwitch object (or null if not made).

    Return type

    SensorSwitch

    Example

    To start creating a *SENSOR_SWITCH in model m:

    var ss = SensorSwitch.Create(m);


    DetachComment(Comment[Comment])

    Description

    Detaches a comment from a *SENSOR_SWITCH.

    Arguments

  • Comment (Comment)

    Comment that will be detached from the *SENSOR_SWITCH

    Returns

    No return value

    Example

    To detach comment c from the *SENSOR_SWITCH ss:

    ss.DetachComment(c);


    Edit(modal (optional)[boolean])

    Description

    Starts an interactive editing panel.

    Arguments

  • modal (optional) (boolean)

    If this window is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the window will be modal.

    Returns

    no return value

    Example

    To Edit *SENSOR_SWITCH ss:

    ss.Edit();


    Error(message[string], details (optional)[string])

    Description

    Adds an error for *SENSOR_SWITCH. For more details on checking see the Check class.

    Arguments

  • message (string)

    The error message to give

  • details (optional) (string)

    An optional detailed error message

    Returns

    No return value

    Example

    To add an error message "My custom error" for *SENSOR_SWITCH ss:

    ss.Error("My custom error");


    First(Model[Model]) [static]

    Description

    Returns the first *SENSOR_SWITCH in the model.

    Arguments

  • Model (Model)

    Model to get first *SENSOR_SWITCH in

    Returns

    SensorSwitch object (or null if there are no *SENSOR_SWITCHs in the model).

    Return type

    SensorSwitch

    Example

    To get the first *SENSOR_SWITCH in model m:

    var ss = SensorSwitch.First(m);


    FirstFreeLabel(Model[Model], layer (optional)[Include number]) [static]

    Description

    Returns the first free *SENSOR_SWITCH label in the model. Also see SensorSwitch.LastFreeLabel(), SensorSwitch.NextFreeLabel() and Model.FirstFreeItemLabel().

    Arguments

  • Model (Model)

    Model to get first free *SENSOR_SWITCH label in

  • layer (optional) (Include number)

    Include file (0 for the main file) to search for labels in (Equivalent to First free in layer in editing panels). If omitted the whole model will be used (Equivalent to First free in editing panels).

    Returns

    SensorSwitch label.

    Return type

    Number

    Example

    To get the first free *SENSOR_SWITCH label in model m:

    var label = SensorSwitch.FirstFreeLabel(m);


    FlagAll(Model[Model], flag[Flag]) [static]

    Description

    Flags all of the *SENSOR_SWITCHs in the model with a defined flag.

    Arguments

  • Model (Model)

    Model that all *SENSOR_SWITCHs will be flagged in

  • flag (Flag)

    Flag to set on the *SENSOR_SWITCHs

    Returns

    No return value

    Example

    To flag all of the *SENSOR_SWITCHs with flag f in model m:

    SensorSwitch.FlagAll(m, f);


    Flagged(flag[Flag])

    Description

    Checks if the *SENSOR_SWITCH is flagged or not.

    Arguments

  • flag (Flag)

    Flag to test on the *SENSOR_SWITCH

    Returns

    true if flagged, false if not.

    Return type

    Boolean

    Example

    To check if *SENSOR_SWITCH ss has flag f set on it:

    if (ss.Flagged(f) ) do_something...


    ForEach(Model[Model], func[function], extra (optional)[any]) [static]

    Description

    Calls a function for each *SENSOR_SWITCH in the model.
    Note that ForEach has been designed to make looping over *SENSOR_SWITCHs as fast as possible and so has some limitations.
    Firstly, a single temporary SensorSwitch object is created and on each function call it is updated with the current *SENSOR_SWITCH data. This means that you should not try to store the SensorSwitch object for later use (e.g. in an array) as it is temporary.
    Secondly, you cannot create new *SENSOR_SWITCHs inside a ForEach loop.

    Arguments

  • Model (Model)

    Model that all *SENSOR_SWITCHs are in

  • func (function)

    Function to call for each *SENSOR_SWITCH

  • extra (optional) (any)

    An optional extra object/array/string etc that will appended to arguments when calling the function

    Returns

    No return value

    Example

    To call function test for all of the *SENSOR_SWITCHs in model m:

    SensorSwitch.ForEach(m, test);
    function test(ss)
    {
    // ss is SensorSwitch object
    }

    To call function test for all of the *SENSOR_SWITCHs in model m with optional object:

    var data = { x:0, y:0 };
    SensorSwitch.ForEach(m, test, data);
    function test(ss, extra)
    {
    // ss is SensorSwitch object
    // extra is data
    }


    GetAll(Model[Model], property (optional)[string]) [static]

    Description

    Returns an array of SensorSwitch objects or properties for all of the *SENSOR_SWITCHs in a model in PRIMER. If the optional property argument is not given then an array of SensorSwitch objects is returned. If the property argument is given, that property value for each *SENSOR_SWITCH is returned in the array instead of a SensorSwitch object

    Arguments

  • Model (Model)

    Model to get *SENSOR_SWITCHs from

  • property (optional) (string)

    Name for property to get for all *SENSOR_SWITCHs in the model

    Returns

    Array of SensorSwitch objects or properties

    Return type

    Array

    Example

    To make an array of SensorSwitch objects for all of the *SENSOR_SWITCHs in model m:

    var a = SensorSwitch.GetAll(m);

    To return an array containing the value of property 'foo' (for example 'x' for a node) for each *SENSOR_SWITCH in model m:

    var a = SensorSwitch.GetAll(m, 'foo');


    GetComments()

    Description

    Extracts the comments associated to a *SENSOR_SWITCH.

    Arguments

    No arguments

    Returns

    Array of Comment objects (or null if there are no comments associated to the node).

    Return type

    Array

    Example

    To get the array of comments associated to the *SENSOR_SWITCH ss:

    var comm_array = ss.GetComments();


    GetFlagged(Model[Model], flag[Flag], property (optional)[string]) [static]

    Description

    Returns an array of SensorSwitch objects for all of the flagged *SENSOR_SWITCHs in a model in PRIMER If the optional property argument is not given then an array of SensorSwitch objects is returned. If the property argument is given, then that property value for each *SENSOR_SWITCH is returned in the array instead of a SensorSwitch object

    Arguments

  • Model (Model)

    Model to get *SENSOR_SWITCHs from

  • flag (Flag)

    Flag set on the *SENSOR_SWITCHs that you want to retrieve

  • property (optional) (string)

    Name for property to get for all flagged *SENSOR_SWITCHs in the model

    Returns

    Array of SensorSwitch objects or properties

    Return type

    Array

    Example

    To make an array of SensorSwitch objects for all of the *SENSOR_SWITCHs in model m flagged with f:

    var ss = SensorSwitch.GetFlagged(m, f);

    To return an array containing the value of property 'foo' (for example 'x' for a node) for all of the *SENSOR_SWITCHs in model m flagged with f:

    var a = SensorSwitch.GetFlagged(m, f, 'foo');


    GetFromID(Model[Model], number[integer]) [static]

    Description

    Returns the SensorSwitch object for a *SENSOR_SWITCH ID.

    Arguments

  • Model (Model)

    Model to find the *SENSOR_SWITCH in

  • number (integer)

    number of the *SENSOR_SWITCH you want the SensorSwitch object for

    Returns

    SensorSwitch object (or null if *SENSOR_SWITCH does not exist).

    Return type

    SensorSwitch

    Example

    To get the SensorSwitch object for *SENSOR_SWITCH 100 in model m

    var ss = SensorSwitch.GetFromID(m, 100);


    GetParameter(prop[string])

    Description

    Checks if a SensorSwitch property is a parameter or not. Note that object properties that are parameters are normally returned as the integer or float parameter values as that is virtually always what the user would want. For this function to work the JavaScript interpreter must use the parameter name instead of the value. This can be done by setting the Options.property_parameter_names option to true before calling the function and then resetting it to false afterwards.. This behaviour can also temporarily be switched by using the SensorSwitch.ViewParameters() method and 'method chaining' (see the examples below).

    Arguments

  • prop (string)

    *SENSOR_SWITCH property to get parameter for

    Returns

    Parameter object if property is a parameter, null if not.

    Return type

    Parameter

    Example

    To check if SensorSwitch property ss.example is a parameter:

    Options.property_parameter_names = true;
    if (ss.GetParameter(ss.example) ) do_something...
    Options.property_parameter_names = false;

    To check if SensorSwitch property ss.example is a parameter by using the GetParameter method:

    if (ss.ViewParameters().GetParameter(ss.example) ) do_something...


    GetRow(row[integer])

    Description

    Returns the data for a row in the SENSOR_SWITCH_SHELL_TO_VENT.

    Arguments

  • row (integer)

    The row you want the data for. Note row indices start at 0.

    Returns

    An array of numbers containing the row variables SSID, FTIME and C23V.

    Return type

    Number

    Example

    To get the data for the 2nd row in sensor switch ss:

    var data = ss.GetRow(1);


    GetSwitch(row[integer])

    Description

    Returns switch ID information for *SENSOR_SWITCH_CALC-LOGIC.

    Arguments

  • row (integer)

    The row you want the data for. Note row indices start at 0.

    Returns

    Object containing sensor switch ID information.

    Return type

    Object

    Example

    To get the data for the 2nd switch in sensor switch ss:

    var data = ss.GetSwitch(1);
    Message("Switch 2: " + data.swit);


    Keyword()

    Description

    Returns the keyword for this *SENSOR_SWITCH. Note that a carriage return is not added. See also SensorSwitch.KeywordCards()

    Arguments

    No arguments

    Returns

    string containing the keyword.

    Return type

    String

    Example

    To get the keyword for SensorSwitch ss:

    var key = ss.Keyword();


    KeywordCards()

    Description

    Returns the keyword cards for the *SENSOR_SWITCH. Note that a carriage return is not added. See also SensorSwitch.Keyword()

    Arguments

    No arguments

    Returns

    string containing the cards.

    Return type

    String

    Example

    To get the cards for sensor switch ss:

    var cards = ss.KeywordCards();


    Last(Model[Model]) [static]

    Description

    Returns the last *SENSOR_SWITCH in the model.

    Arguments

  • Model (Model)

    Model to get last *SENSOR_SWITCH in

    Returns

    SensorSwitch object (or null if there are no *SENSOR_SWITCHs in the model).

    Return type

    SensorSwitch

    Example

    To get the last *SENSOR_SWITCH in model m:

    var ss = SensorSwitch.Last(m);


    LastFreeLabel(Model[Model], layer (optional)[Include number]) [static]

    Description

    Returns the last free *SENSOR_SWITCH label in the model. Also see SensorSwitch.FirstFreeLabel(), SensorSwitch.NextFreeLabel() and see Model.LastFreeItemLabel()

    Arguments

  • Model (Model)

    Model to get last free *SENSOR_SWITCH label in

  • layer (optional) (Include number)

    Include file (0 for the main file) to search for labels in (Equivalent to Highest free in layer in editing panels). If omitted the whole model will be used.

    Returns

    SensorSwitch label.

    Return type

    Number

    Example

    To get the last free *SENSOR_SWITCH label in model m:

    var label = SensorSwitch.LastFreeLabel(m);


    Next()

    Description

    Returns the next *SENSOR_SWITCH in the model.

    Arguments

    No arguments

    Returns

    SensorSwitch object (or null if there are no more *SENSOR_SWITCHs in the model).

    Return type

    SensorSwitch

    Example

    To get the *SENSOR_SWITCH in model m after *SENSOR_SWITCH ss:

    var ss = ss.Next();


    NextFreeLabel(Model[Model], layer (optional)[Include number]) [static]

    Description

    Returns the next free (highest+1) *SENSOR_SWITCH label in the model. Also see SensorSwitch.FirstFreeLabel(), SensorSwitch.LastFreeLabel() and Model.NextFreeItemLabel()

    Arguments

  • Model (Model)

    Model to get next free *SENSOR_SWITCH label in

  • layer (optional) (Include number)

    Include file (0 for the main file) to search for labels in (Equivalent to Highest+1 in layer in editing panels). If omitted the whole model will be used (Equivalent to Highest+1 in editing panels).

    Returns

    SensorSwitch label.

    Return type

    Number

    Example

    To get the next free *SENSOR_SWITCH label in model m:

    var label = SensorSwitch.NextFreeLabel(m);


    Previous()

    Description

    Returns the previous *SENSOR_SWITCH in the model.

    Arguments

    No arguments

    Returns

    SensorSwitch object (or null if there are no more *SENSOR_SWITCHs in the model).

    Return type

    SensorSwitch

    Example

    To get the *SENSOR_SWITCH in model m before *SENSOR_SWITCH ss:

    var ss = ss.Previous();


    RemoveRow(row[integer])

    Description

    Removes the data for a row in *SENSOR_SWITCH_SHELL_TO_VENT.

    Arguments

  • row (integer)

    The row you want to remove the data for. Note that row indices start at 0.

    Returns

    No return value.

    Example

    To remove the second row of data for sensor switch ss:

    ss.RemoveRow(1);


    RemoveSwitch(row[integer])

    Description

    Removes sensor switch ID from *SENSOR_SWITCH_CALC-LOGIC.

    Arguments

  • row (integer)

    The sensor switch ID that you want to remove. Note that row indices start at 0.

    Returns

    No return value.

    Example

    To remove the second sensor switch ID for sensor switch ss:

    ss.RemoveSwitch(1);


    RenumberAll(Model[Model], start[integer]) [static]

    Description

    Renumbers all of the *SENSOR_SWITCHs in the model.

    Arguments

  • Model (Model)

    Model that all *SENSOR_SWITCHs will be renumbered in

  • start (integer)

    Start point for renumbering

    Returns

    No return value

    Example

    To renumber all of the *SENSOR_SWITCHs in model m, from 1000000:

    SensorSwitch.RenumberAll(m, 1000000);


    RenumberFlagged(Model[Model], flag[Flag], start[integer]) [static]

    Description

    Renumbers all of the flagged *SENSOR_SWITCHs in the model.

    Arguments

  • Model (Model)

    Model that all the flagged *SENSOR_SWITCHs will be renumbered in

  • flag (Flag)

    Flag set on the *SENSOR_SWITCHs that you want to renumber

  • start (integer)

    Start point for renumbering

    Returns

    No return value

    Example

    To renumber all of the *SENSOR_SWITCHs in model m flagged with f, from 1000000:

    SensorSwitch.RenumberFlagged(m, f, 1000000);


    Select(flag[Flag], prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean]) [static]

    Description

    Allows the user to select *SENSOR_SWITCHs using standard PRIMER object menus.

    Arguments

  • flag (Flag)

    Flag to use when selecting *SENSOR_SWITCHs

  • prompt (string)

    Text to display as a prompt to the user

  • limit (optional) (Model or Flag)

    If the argument is a Model then only *SENSOR_SWITCHs from that model can be selected. If the argument is a Flag then only *SENSOR_SWITCHs that are flagged with limit can be selected (limit should be different to flag). If omitted, or null, any *SENSOR_SWITCHs can be selected. from any model.

  • modal (optional) (boolean)

    If selection is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the selection will be modal.

    Returns

    Number of *SENSOR_SWITCHs selected or null if menu cancelled

    Return type

    Number

    Example

    To select *SENSOR_SWITCHs from model m, flagging those selected with flag f, giving the prompt 'Select *SENSOR_SWITCHs':

    SensorSwitch.Select(f, 'Select *SENSOR_SWITCHs', m);

    To select *SENSOR_SWITCHs, flagging those selected with flag f but limiting selection to *SENSOR_SWITCHs flagged with flag l, giving the prompt 'Select *SENSOR_SWITCHs':

    SensorSwitch.Select(f, 'Select *SENSOR_SWITCHs', l);


    SetFlag(flag[Flag])

    Description

    Sets a flag on the *SENSOR_SWITCH.

    Arguments

  • flag (Flag)

    Flag to set on the *SENSOR_SWITCH

    Returns

    No return value

    Example

    To set flag f for *SENSOR_SWITCH ss:

    ss.SetFlag(f);


    SetRow(row[integer], data[Array of data])

    Description

    Sets the data for a row in *SENSOR_SWITCH_SHELL_TO_VENT.

    Arguments

  • row (integer)

    The row you want to set the data for. Note that row indices start at 0.

  • data (Array of data)

    An array containing the row variables SSID, FTIME and C23V.

    Returns

    No return value.

    Example

    To set the second row of data for sensor switch ss to be shell set list 11, time 12.0 and vent coefficient 0.7:

    var array = [11, 12.0, 0.7];
    ss.SetRow(1, array);

    To append a new row of data (using the same array of values):

    ss.SetRow(ss.nrow, array);


    SetSwitch(index[integer], data[object])

    Description

    Specifies a sensor switch ID for a *SENSOR_SWITCH_CALC-LOGIC.

    Arguments

  • index (integer)

    The index of the *SENSOR_SWITCH_CALC-LOGIC data to set. Note that indices start at 0, not 1.
    0 <= index <= nswit

  • data (object)

    Object containing sensor swith ID data.

    Object has the following properties:

    Name Type Description
    swit integer Positive or negative sensor switch id.

    Returns

    No return value.

    Example

    To set the value of -10 for sensor switch 5 (indices start with 0) for *SENSOR_SWITCH_CALC-LOGIC s:

    var data = { swit: -10 };
    s.SetSwitch(4, data);

    To append a new line of data (using the same example values):

    var data2 = {swit: -10};
    s.SetSwitch(b.lines, data2);


    Total(Model[Model], exists (optional)[boolean]) [static]

    Description

    Returns the total number of *SENSOR_SWITCHs in the model.

    Arguments

  • Model (Model)

    Model to get total for

  • exists (optional) (boolean)

    true if only existing *SENSOR_SWITCHs should be counted. If false or omitted referenced but undefined *SENSOR_SWITCHs will also be included in the total.

    Returns

    number of *SENSOR_SWITCHs

    Return type

    Number

    Example

    To get the total number of *SENSOR_SWITCHs in model m:

    var total = SensorSwitch.Total(m);


    UnflagAll(Model[Model], flag[Flag]) [static]

    Description

    Unsets a defined flag on all of the *SENSOR_SWITCHs in the model.

    Arguments

  • Model (Model)

    Model that the defined flag for all *SENSOR_SWITCHs will be unset in

  • flag (Flag)

    Flag to unset on the *SENSOR_SWITCHs

    Returns

    No return value

    Example

    To unset the flag f on all the *SENSOR_SWITCHs in model m:

    SensorSwitch.UnflagAll(m, f);


    ViewParameters()

    Description

    Object properties that are parameters are normally returned as the integer or float parameter values as that is virtually always what the user would want. This function temporarily changes the behaviour so that if a property is a parameter the parameter name is returned instead. This can be used with 'method chaining' (see the example below) to make sure a property argument is correct.

    Arguments

    No arguments

    Returns

    SensorSwitch object.

    Return type

    SensorSwitch

    Example

    To check if SensorSwitch property ss.example is a parameter by using the SensorSwitch.GetParameter() method:

    if (ss.ViewParameters().GetParameter(ss.example) ) do_something...


    Warning(message[string], details (optional)[string])

    Description

    Adds a warning for *SENSOR_SWITCH. For more details on checking see the Check class.

    Arguments

  • message (string)

    The warning message to give

  • details (optional) (string)

    An optional detailed warning message

    Returns

    No return value

    Example

    To add a warning message "My custom warning" for *SENSOR_SWITCH ss:

    ss.Warning("My custom warning");


    Xrefs()

    Description

    Returns the cross references for this *SENSOR_SWITCH.

    Arguments

    No arguments

    Returns

    Xrefs object.

    Return type

    Xrefs

    Example

    To get the cross references for *SENSOR_SWITCH ss:

    var xrefs = ss.Xrefs();


    toString()

    Description

    Creates a string containing the sensor switch data in keyword format. Note that this contains the keyword header and the keyword cards. See also SensorSwitch.Keyword() and SensorSwitch.KeywordCards().

    Arguments

    No arguments

    Returns

    string

    Return type

    String

    Example

    To get data for sensor switch ss in keyword format

    var str = ss.toString();