SensorDefine class

The SensorDefine class gives you access to *SENSOR_DEFINE 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

SensorDefine constants

Name Description
SensorDefine.DEFINE_CALC_MATH Sensor define is *SENSOR_DEFINE_CALC_MATH.
SensorDefine.DEFINE_ELEMENT Sensor define is *SENSOR_DEFINE_ELEMENT.
SensorDefine.DEFINE_ELEMENT_SET Sensor define is *SENSOR_DEFINE_ELEMENT_SET.
SensorDefine.DEFINE_FORCE Sensor define is *SENSOR_DEFINE_FORCE.
SensorDefine.DEFINE_FUNCTION Sensor define is *SENSOR_DEFINE_FUNCTION.
SensorDefine.DEFINE_MISC Sensor define is *SENSOR_DEFINE_MISC.
SensorDefine.DEFINE_NODE Sensor define is *SENSOR_DEFINE_NODE.
SensorDefine.DEFINE_NODE_SET Sensor define is *SENSOR_DEFINE_NODE_SET.

SensorDefine properties

Name Type Description
calc string Mathematical calculation. Can be "ABSSUM", "MIN", "MAX", "MAXMAG", "MINMAG", "MULTIPLY", "SQRE", "SQRTSQRE", "SQRT", "SUMABS", "SUM" .
comp string Component type. Can be "XX", "YY", "ZZ", "XY", "YZ", "ZX", "HYDR", "MAXS", "PRIN1", "PRIN2", PRIN3", "VM", "F[ID]", "AXIAL", "SHEARS", "SHEART".
crd integer Optional coordinate system.
ctype string Sensor type or Output component type. Can be "STRAIN", "STRESS", "FORCE", "MOMENT", "DLEN" or "FAIL" for SensorDefine.DEFINE_ELEMENT or SensorDefine.DEFINE_ELEMENT_SET and "ACC", "VEL", "COORD" or "TEMP" for SensorDefine.DEFINE_NODE or SensorDefine.DEFINE_NODE_SET
elemid integer Element ID or element set ID when option_SET is active.
etype string Element type. Can be "BEAM", "SHELL", "SOLID", "DISC-ELE", "SEATBELT" or "TSHELL".
exists (read only) logical true if *SENSOR_DEFINE exists, false if referred to but not defined.
ftype string Force type. Can be "AIRBAG", "CONTACT", "CONTACT2D", "CPM", "JOINT", "JOINTSTIF", "PRESC-MOT", "RWALL", "SPC", "SPOTWELD", "X-SECTION".
func integer Function ID.
func_sens1 integer 1st Sensor ID if positive or number of sensor ID if negative.
func_sens10 integer 10th Sensor ID.
func_sens11 integer 11th Sensor ID.
func_sens12 integer 12th Sensor ID.
func_sens13 integer 13th Sensor ID.
func_sens14 integer 14th Sensor ID.
func_sens15 integer 15th Sensor ID.
func_sens16 integer 16th Sensor ID.
func_sens2 integer 2nd Sensor ID.
func_sens3 integer 3rd Sensor ID.
func_sens4 integer 4th Sensor ID.
func_sens5 integer 5th Sensor ID.
func_sens6 integer 6th Sensor ID.
func_sens7 integer 7th Sensor ID.
func_sens8 integer 8th Sensor ID.
func_sens9 integer 9th Sensor ID.
i0 string I0. Can be "ADDMASS", "KINETIC", "INTERNAL", "ERODEKE", or "ERODEIE" when MTYPE = "MATSUM" or "SOLID", "SHELL", "TSHELL", "BEAM", or "DISC" when MTYPE = "NFAILE" or "TEMP", or "VOL" when MTYPE = "CVBAG", or "PRES", or "VOL" when MTYPE = "ICVOL", or "PULLRATE", "PULLOUT" or "FORCE" when MTYPE = "RETRACTOR".
i1 integer/string I1. Applicable for "ANGLE", "BNDOUT", "CURVE", "CVBAG", "ICVOL", "MATSUM" or "NFAILE".
i2 integer/string I2. Applicable only for when MTYPE = "ANGLE".
i3 integer/string I3. Applicable only for MTYPE = "ANGLE".
i4 integer/string I4. Applicable only for MTYPE = "ANGLE".
i5 string I5.
include integer The Include file number that the *SENSOR_DEFINE is in.
label integer SensorDefine number. The sensid property is an alternative name for this.
layer integer/string Layer of integration. Can be "BOT", "TOP" or "i" to monitor the stress of the ith integration point when ctype = "STRESS".
model (read only) integer The Model number that the *SENSOR_DEFINE is in.
mtype string Entity to be traced. Can be "ANGLE", "BNDOUT", "CURVE", "CVBAG", "ICVOL",'MATSUM', "NFAILE", "RETRACTOR", "RIGIDBODY" .
node1 integer Node or Node set ID based on option SET for an accelerometer sensor.
node2 integer Node ID for an accelerometer sensor.
option constant SENSOR_DEFINE suffix. Can be SensorDefine.DEFINE_CALC_MATH, SensorDefine.DEFINE_ELEMENT, SensorDefine.DEFINE_ELEMENT_SET, SensorDefine.DEFINE_FORCE, SensorDefine.DEFINE_MISC, SensorDefine.DEFINE_NODE, SensorDefine.DEFINE_NODE_SET or SensorDefine.DEFINE_FUNCTION.
pwr real Power (Optional parameters).
sens1 integer 1st Sensor ID.
sens2 integer 2nd Sensor ID.
sens3 integer 3rd Sensor ID.
sens4 integer 4th Sensor ID.
sens5 integer 5th Sensor ID.
sens6 integer 6th Sensor ID.
sensid integer SensorDefine number. The label property is an alternative name for this.
setopt string Option to process set of data when SET option is specified. Can be "AVG", "MAX", "MIN" or "SUM".
sf real Scale factor (Optional parameters).
typeid integer ID defined in the associated KEYWORD command.
vid integer/string Vector along which the forces is measured. Can be "X", "Y", "Z", "XL", "YL", "ZL", "XMOMENT", "YMOMENT", "ZMOMENT", "XLMOMENT", "YLMOMENT", "ZLMOMENT" or vector ID n in coordinate system CRD for SensorDefine.DEFINE_FORCE or ID of vector along which the nodal values for SensorDefine.DEFINE_NODE and SensorDefine.DEFINE_NODE_SET.

Detailed Description

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

Constructor

new SensorDefine(Option[constant], Model[Model], Define ID[integer], Type or Entity 1[string/label], Entity 2[label])

Description

Create a new SensorDefine object.

Arguments

  • Option (constant)

    SENSOR_DEFINE suffix. Can be SensorDefine.DEFINE_CALC_MATH, SensorDefine.DEFINE_ELEMENT, SensorDefine.DEFINE_ELEMENT_SET, SensorDefine.DEFINE_FORCE, SensorDefine.DEFINE_MISC, SensorDefine.DEFINE_NODE, SensorDefine.DEFINE_NODE_SET or SensorDefine.DEFINE_FUNCTION.

  • Model (Model)

    Model that *SENSOR_DEFINE will be created in

  • Define ID (integer)

    SensorDefine id.

  • Type or Entity 1 (string/label)

    For SensorDefine.DEFINE_NODE, SensorDefine.DEFINE_NODE_SET option it is Node ID or NODE set ID respectively, For SensorDefine.DEFINE_FUNCTION option it is DEFINE_FUNCTION ID, For SensorDefine.DEFINE_CALC_MATH option it is Calc string, For SensorDefine.DEFINE_ELEMENT and SensorDefine.DEFINE_ELEMENT_SET option it is Etype string, For SensorDefine.DEFINE_FORCE option it is Ftype string, For SensorDefine.DEFINE_MISC option it is Mtype string.

  • Entity 2 (label)

    Applicable only for SensorDefine.DEFINE_NODE, SensorDefine.DEFINE_NODE_SET, SensorDefine.DEFINE_CALC_MATH, SensorDefine.DEFINE_ELEMENT, SensorDefine.DEFINE_ELEMENT_SET or SensorDefine.DEFINE_FORCE. It is NODE or NODE set ID for SensorDefine.DEFINE_NODE or SensorDefine.DEFINE_NODE_SET respectively, Sensor Define ID for SensorDefine.DEFINE_CALC_MATH, Element ID or Element set ID for SensorDefine.DEFINE_ELEMENT or SensorDefine.DEFINE_ELEMENT_SET respectively or Type ID for SensorDefine.DEFINE_FORCE.

    Returns

    SensorDefine object

    Return type

    SensorDefine

    Example

    To create a new *SENSOR_DEFINE_CALC-MATH in model m with label 100 with CALC option as MAX and SENS1 as -2:

    var sd1 = new SensorDefine(SensorDefine.DEFINE_CALC_MATH, m, 100, "MAX", -2);

    To create a new *SENSOR_DEFINE_MISC in model m with label 10 with MTYPE option as ANGLE:

    var sd2 = new SensorDefine(SensorDefine.DEFINE_MISC, m, 10, "ANGLE");

    To create a new *SENSOR_DEFINE_NODE in model m with label 11 with NODE1 and NODE2 as 5 and 6:

    var sd3 = new SensorDefine(SensorDefine.DEFINE_NODE, m, 11, 5, 6);

    To create a new *SENSOR_DEFINE_FUNCTION in model m with label 12 and FUNCTION ID as 6:

    var sd4 = new SensorDefine(SensorDefine.DEFINE_FUNCTION, m, 12, 6);

    Details of functions

    AssociateComment(Comment[Comment])

    Description

    Associates a comment with a *SENSOR_DEFINE.

    Arguments

  • Comment (Comment)

    Comment that will be attached to the *SENSOR_DEFINE

    Returns

    No return value

    Example

    To associate comment c to the *SENSOR_DEFINE sd:

    sd.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_DEFINE sd:

    sd.Browse();


    ClearFlag(flag[Flag])

    Description

    Clears a flag on the *SENSOR_DEFINE.

    Arguments

  • flag (Flag)

    Flag to clear on the *SENSOR_DEFINE

    Returns

    No return value

    Example

    To clear flag f for *SENSOR_DEFINE sd:

    sd.ClearFlag(f);


    Copy(range (optional)[boolean])

    Description

    Copies the *SENSOR_DEFINE. The target include of the copied *SENSOR_DEFINE 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

    SensorDefine object

    Return type

    SensorDefine

    Example

    To copy *SENSOR_DEFINE sd into *SENSOR_DEFINE z:

    var z = sd.Copy();


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

    Description

    Starts an interactive editing panel to create a *SENSOR_DEFINE

    Arguments

  • Model (Model)

    Model that the *SENSOR_DEFINE 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

    SensorDefine object (or null if not made).

    Return type

    SensorDefine

    Example

    To start creating a *SENSOR_DEFINE in model m:

    var sd = SensorDefine.Create(m);


    DetachComment(Comment[Comment])

    Description

    Detaches a comment from a *SENSOR_DEFINE.

    Arguments

  • Comment (Comment)

    Comment that will be detached from the *SENSOR_DEFINE

    Returns

    No return value

    Example

    To detach comment c from the *SENSOR_DEFINE sd:

    sd.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_DEFINE sd:

    sd.Edit();


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

    Description

    Adds an error for *SENSOR_DEFINE. 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_DEFINE sd:

    sd.Error("My custom error");


    First(Model[Model]) [static]

    Description

    Returns the first *SENSOR_DEFINE in the model.

    Arguments

  • Model (Model)

    Model to get first *SENSOR_DEFINE in

    Returns

    SensorDefine object (or null if there are no *SENSOR_DEFINEs in the model).

    Return type

    SensorDefine

    Example

    To get the first *SENSOR_DEFINE in model m:

    var sd = SensorDefine.First(m);


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

    Description

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

    Arguments

  • Model (Model)

    Model to get first free *SENSOR_DEFINE 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

    SensorDefine label.

    Return type

    Number

    Example

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

    var label = SensorDefine.FirstFreeLabel(m);


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

    Description

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

    Arguments

  • Model (Model)

    Model that all *SENSOR_DEFINEs will be flagged in

  • flag (Flag)

    Flag to set on the *SENSOR_DEFINEs

    Returns

    No return value

    Example

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

    SensorDefine.FlagAll(m, f);


    Flagged(flag[Flag])

    Description

    Checks if the *SENSOR_DEFINE is flagged or not.

    Arguments

  • flag (Flag)

    Flag to test on the *SENSOR_DEFINE

    Returns

    true if flagged, false if not.

    Return type

    Boolean

    Example

    To check if *SENSOR_DEFINE sd has flag f set on it:

    if (sd.Flagged(f) ) do_something...


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

    Description

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

    Arguments

  • Model (Model)

    Model that all *SENSOR_DEFINEs are in

  • func (function)

    Function to call for each *SENSOR_DEFINE

  • 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_DEFINEs in model m:

    SensorDefine.ForEach(m, test);
    function test(sd)
    {
    // sd is SensorDefine object
    }

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

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


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

    Description

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

    Arguments

  • Model (Model)

    Model to get *SENSOR_DEFINEs from

  • property (optional) (string)

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

    Returns

    Array of SensorDefine objects or properties

    Return type

    Array

    Example

    To make an array of SensorDefine objects for all of the *SENSOR_DEFINEs in model m:

    var a = SensorDefine.GetAll(m);

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

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


    GetComments()

    Description

    Extracts the comments associated to a *SENSOR_DEFINE.

    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_DEFINE sd:

    var comm_array = sd.GetComments();


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

    Description

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

    Arguments

  • Model (Model)

    Model to get *SENSOR_DEFINEs from

  • flag (Flag)

    Flag set on the *SENSOR_DEFINEs that you want to retrieve

  • property (optional) (string)

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

    Returns

    Array of SensorDefine objects or properties

    Return type

    Array

    Example

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

    var sd = SensorDefine.GetFlagged(m, f);

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

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


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

    Description

    Returns the SensorDefine object for a *SENSOR_DEFINE ID.

    Arguments

  • Model (Model)

    Model to find the *SENSOR_DEFINE in

  • number (integer)

    number of the *SENSOR_DEFINE you want the SensorDefine object for

    Returns

    SensorDefine object (or null if *SENSOR_DEFINE does not exist).

    Return type

    SensorDefine

    Example

    To get the SensorDefine object for *SENSOR_DEFINE 100 in model m

    var sd = SensorDefine.GetFromID(m, 100);


    GetParameter(prop[string])

    Description

    Checks if a SensorDefine 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 SensorDefine.ViewParameters() method and 'method chaining' (see the examples below).

    Arguments

  • prop (string)

    *SENSOR_DEFINE property to get parameter for

    Returns

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

    Return type

    Parameter

    Example

    To check if SensorDefine property sd.example is a parameter:

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

    To check if SensorDefine property sd.example is a parameter by using the GetParameter method:

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


    Keyword()

    Description

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

    Arguments

    No arguments

    Returns

    string containing the keyword.

    Return type

    String

    Example

    To get the keyword for SensorDefine sd:

    var key = sd.Keyword();


    KeywordCards()

    Description

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

    Arguments

    No arguments

    Returns

    string containing the cards.

    Return type

    String

    Example

    To get the cards for sensor define sd:

    var cards = sd.KeywordCards();


    Last(Model[Model]) [static]

    Description

    Returns the last *SENSOR_DEFINE in the model.

    Arguments

  • Model (Model)

    Model to get last *SENSOR_DEFINE in

    Returns

    SensorDefine object (or null if there are no *SENSOR_DEFINEs in the model).

    Return type

    SensorDefine

    Example

    To get the last *SENSOR_DEFINE in model m:

    var sd = SensorDefine.Last(m);


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

    Description

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

    Arguments

  • Model (Model)

    Model to get last free *SENSOR_DEFINE 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

    SensorDefine label.

    Return type

    Number

    Example

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

    var label = SensorDefine.LastFreeLabel(m);


    Next()

    Description

    Returns the next *SENSOR_DEFINE in the model.

    Arguments

    No arguments

    Returns

    SensorDefine object (or null if there are no more *SENSOR_DEFINEs in the model).

    Return type

    SensorDefine

    Example

    To get the *SENSOR_DEFINE in model m after *SENSOR_DEFINE sd:

    var sd = sd.Next();


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

    Description

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

    Arguments

  • Model (Model)

    Model to get next free *SENSOR_DEFINE 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

    SensorDefine label.

    Return type

    Number

    Example

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

    var label = SensorDefine.NextFreeLabel(m);


    Previous()

    Description

    Returns the previous *SENSOR_DEFINE in the model.

    Arguments

    No arguments

    Returns

    SensorDefine object (or null if there are no more *SENSOR_DEFINEs in the model).

    Return type

    SensorDefine

    Example

    To get the *SENSOR_DEFINE in model m before *SENSOR_DEFINE sd:

    var sd = sd.Previous();


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

    Description

    Renumbers all of the *SENSOR_DEFINEs in the model.

    Arguments

  • Model (Model)

    Model that all *SENSOR_DEFINEs will be renumbered in

  • start (integer)

    Start point for renumbering

    Returns

    No return value

    Example

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

    SensorDefine.RenumberAll(m, 1000000);


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

    Description

    Renumbers all of the flagged *SENSOR_DEFINEs in the model.

    Arguments

  • Model (Model)

    Model that all the flagged *SENSOR_DEFINEs will be renumbered in

  • flag (Flag)

    Flag set on the *SENSOR_DEFINEs that you want to renumber

  • start (integer)

    Start point for renumbering

    Returns

    No return value

    Example

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

    SensorDefine.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_DEFINEs using standard PRIMER object menus.

    Arguments

  • flag (Flag)

    Flag to use when selecting *SENSOR_DEFINEs

  • 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_DEFINEs from that model can be selected. If the argument is a Flag then only *SENSOR_DEFINEs that are flagged with limit can be selected (limit should be different to flag). If omitted, or null, any *SENSOR_DEFINEs 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_DEFINEs selected or null if menu cancelled

    Return type

    Number

    Example

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

    SensorDefine.Select(f, 'Select *SENSOR_DEFINEs', m);

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

    SensorDefine.Select(f, 'Select *SENSOR_DEFINEs', l);


    SetFlag(flag[Flag])

    Description

    Sets a flag on the *SENSOR_DEFINE.

    Arguments

  • flag (Flag)

    Flag to set on the *SENSOR_DEFINE

    Returns

    No return value

    Example

    To set flag f for *SENSOR_DEFINE sd:

    sd.SetFlag(f);


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

    Description

    Returns the total number of *SENSOR_DEFINEs in the model.

    Arguments

  • Model (Model)

    Model to get total for

  • exists (optional) (boolean)

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

    Returns

    number of *SENSOR_DEFINEs

    Return type

    Number

    Example

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

    var total = SensorDefine.Total(m);


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

    Description

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

    Arguments

  • Model (Model)

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

  • flag (Flag)

    Flag to unset on the *SENSOR_DEFINEs

    Returns

    No return value

    Example

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

    SensorDefine.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

    SensorDefine object.

    Return type

    SensorDefine

    Example

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

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


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

    Description

    Adds a warning for *SENSOR_DEFINE. 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_DEFINE sd:

    sd.Warning("My custom warning");


    Xrefs()

    Description

    Returns the cross references for this *SENSOR_DEFINE.

    Arguments

    No arguments

    Returns

    Xrefs object.

    Return type

    Xrefs

    Example

    To get the cross references for *SENSOR_DEFINE sd:

    var xrefs = sd.Xrefs();


    toString()

    Description

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

    Arguments

    No arguments

    Returns

    string

    Return type

    String

    Example

    To get data for sensor define sd in keyword format

    var str = sd.toString();