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:
| 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 DescriptionThe SensorDefine class allows you to create, modify, edit and manipulate *SENSOR_DEFINE. See the documentation below for more details. |
Constructornew SensorDefine(Option[constant], Model[Model], Define ID[integer], Type or Entity 1[string/label], Entity 2[label])DescriptionCreate a new SensorDefine object. |
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 that *SENSOR_DEFINE will be created in
SensorDefine id.
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.
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.
ReturnsSensorDefine object Return typeSensorDefine |
Details of functionsAssociateComment(Comment[Comment])DescriptionAssociates a comment with a *SENSOR_DEFINE. |
Comment that will be attached to the *SENSOR_DEFINE
ReturnsNo return value |
ExampleTo associate comment c to the *SENSOR_DEFINE sd: sd.AssociateComment(c);
|
Browse(modal (optional)[boolean])DescriptionStarts an edit panel in Browse mode. |
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.
Returnsno return value |
ExampleTo Browse *SENSOR_DEFINE sd: sd.Browse();
|
ClearFlag(flag[Flag])DescriptionClears a flag on the *SENSOR_DEFINE. |
Flag to clear on the *SENSOR_DEFINE
ReturnsNo return value |
ExampleTo clear flag f for *SENSOR_DEFINE sd: sd.ClearFlag(f);
|
Copy(range (optional)[boolean])DescriptionCopies the *SENSOR_DEFINE. The target include of the copied *SENSOR_DEFINE can be set using Options.copy_target_include. |
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().
ReturnsSensorDefine object Return typeSensorDefine |
ExampleTo copy *SENSOR_DEFINE sd into *SENSOR_DEFINE z: var z = sd.Copy();
|
Create(Model[Model], modal (optional)[boolean]) [static]DescriptionStarts an interactive editing panel to create a *SENSOR_DEFINE |
Model that the *SENSOR_DEFINE will be created in.
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.
ReturnsSensorDefine object (or null if not made). Return typeSensorDefine |
ExampleTo start creating a *SENSOR_DEFINE in model m: var sd = SensorDefine.Create(m);
|
DetachComment(Comment[Comment])DescriptionDetaches a comment from a *SENSOR_DEFINE. |
Comment that will be detached from the *SENSOR_DEFINE
ReturnsNo return value |
ExampleTo detach comment c from the *SENSOR_DEFINE sd: sd.DetachComment(c);
|
Edit(modal (optional)[boolean])DescriptionStarts an interactive editing panel. |
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.
Returnsno return value |
ExampleTo Edit *SENSOR_DEFINE sd: sd.Edit();
|
Error(message[string], details (optional)[string])DescriptionAdds an error for *SENSOR_DEFINE. For more details on checking see the Check class. |
The error message to give
An optional detailed error message
ReturnsNo return value |
ExampleTo add an error message "My custom error" for *SENSOR_DEFINE sd: sd.Error("My custom error");
|
First(Model[Model]) [static]DescriptionReturns the first *SENSOR_DEFINE in the model. |
Model to get first *SENSOR_DEFINE in
ReturnsSensorDefine object (or null if there are no *SENSOR_DEFINEs in the model). Return typeSensorDefine |
ExampleTo get the first *SENSOR_DEFINE in model m: var sd = SensorDefine.First(m);
|
FirstFreeLabel(Model[Model], layer (optional)[Include number]) [static]DescriptionReturns the first free *SENSOR_DEFINE label in the model. Also see SensorDefine.LastFreeLabel(), SensorDefine.NextFreeLabel() and Model.FirstFreeItemLabel(). |
Model to get first free *SENSOR_DEFINE label in
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).
ReturnsSensorDefine label. Return typeNumber |
ExampleTo get the first free *SENSOR_DEFINE label in model m: var label = SensorDefine.FirstFreeLabel(m);
|
FlagAll(Model[Model], flag[Flag]) [static]DescriptionFlags all of the *SENSOR_DEFINEs in the model with a defined flag. |
Model that all *SENSOR_DEFINEs will be flagged in
Flag to set on the *SENSOR_DEFINEs
ReturnsNo return value |
ExampleTo flag all of the *SENSOR_DEFINEs with flag f in model m: SensorDefine.FlagAll(m, f);
|
Flagged(flag[Flag])DescriptionChecks if the *SENSOR_DEFINE is flagged or not. |
Flag to test on the *SENSOR_DEFINE
Returnstrue if flagged, false if not. Return typeBoolean |
ExampleTo 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]DescriptionCalls a function for each *SENSOR_DEFINE in the model. |
Model that all *SENSOR_DEFINEs are in
Function to call for each *SENSOR_DEFINE
An optional extra object/array/string etc that will appended to arguments when calling the function
ReturnsNo return value |
GetAll(Model[Model], property (optional)[string]) [static]DescriptionReturns 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 |
Model to get *SENSOR_DEFINEs from
Name for property to get for all *SENSOR_DEFINEs in the model
ReturnsArray of SensorDefine objects or properties Return typeArray |
GetComments()DescriptionExtracts the comments associated to a *SENSOR_DEFINE. |
No arguments
ReturnsArray of Comment objects (or null if there are no comments associated to the node). Return typeArray |
ExampleTo 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]DescriptionReturns 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 |
Model to get *SENSOR_DEFINEs from
Flag set on the *SENSOR_DEFINEs that you want to retrieve
Name for property to get for all flagged *SENSOR_DEFINEs in the model
ReturnsArray of SensorDefine objects or properties Return typeArray |
GetFromID(Model[Model], number[integer]) [static]DescriptionReturns the SensorDefine object for a *SENSOR_DEFINE ID. |
Model to find the *SENSOR_DEFINE in
number of the *SENSOR_DEFINE you want the SensorDefine object for
ReturnsSensorDefine object (or null if *SENSOR_DEFINE does not exist). Return typeSensorDefine |
ExampleTo get the SensorDefine object for *SENSOR_DEFINE 100 in model m var sd = SensorDefine.GetFromID(m, 100);
|
GetParameter(prop[string])DescriptionChecks 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). |
*SENSOR_DEFINE property to get parameter for
ReturnsParameter object if property is a parameter, null if not. Return typeParameter |
Keyword()DescriptionReturns the keyword for this *SENSOR_DEFINE. Note that a carriage return is not added. See also SensorDefine.KeywordCards() |
No arguments
Returnsstring containing the keyword. Return typeString |
ExampleTo get the keyword for SensorDefine sd: var key = sd.Keyword();
|
KeywordCards()DescriptionReturns the keyword cards for the *SENSOR_DEFINE. Note that a carriage return is not added. See also SensorDefine.Keyword() |
No arguments
Returnsstring containing the cards. Return typeString |
ExampleTo get the cards for sensor define sd: var cards = sd.KeywordCards();
|
Last(Model[Model]) [static]DescriptionReturns the last *SENSOR_DEFINE in the model. |
Model to get last *SENSOR_DEFINE in
ReturnsSensorDefine object (or null if there are no *SENSOR_DEFINEs in the model). Return typeSensorDefine |
ExampleTo get the last *SENSOR_DEFINE in model m: var sd = SensorDefine.Last(m);
|
LastFreeLabel(Model[Model], layer (optional)[Include number]) [static]DescriptionReturns the last free *SENSOR_DEFINE label in the model. Also see SensorDefine.FirstFreeLabel(), SensorDefine.NextFreeLabel() and see Model.LastFreeItemLabel() |
Model to get last free *SENSOR_DEFINE label in
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.
ReturnsSensorDefine label. Return typeNumber |
ExampleTo get the last free *SENSOR_DEFINE label in model m: var label = SensorDefine.LastFreeLabel(m);
|
Next()DescriptionReturns the next *SENSOR_DEFINE in the model. |
No arguments
ReturnsSensorDefine object (or null if there are no more *SENSOR_DEFINEs in the model). Return typeSensorDefine |
ExampleTo get the *SENSOR_DEFINE in model m after *SENSOR_DEFINE sd: var sd = sd.Next();
|
NextFreeLabel(Model[Model], layer (optional)[Include number]) [static]DescriptionReturns the next free (highest+1) *SENSOR_DEFINE label in the model. Also see SensorDefine.FirstFreeLabel(), SensorDefine.LastFreeLabel() and Model.NextFreeItemLabel() |
Model to get next free *SENSOR_DEFINE label in
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).
ReturnsSensorDefine label. Return typeNumber |
ExampleTo get the next free *SENSOR_DEFINE label in model m: var label = SensorDefine.NextFreeLabel(m);
|
Previous()DescriptionReturns the previous *SENSOR_DEFINE in the model. |
No arguments
ReturnsSensorDefine object (or null if there are no more *SENSOR_DEFINEs in the model). Return typeSensorDefine |
ExampleTo get the *SENSOR_DEFINE in model m before *SENSOR_DEFINE sd: var sd = sd.Previous();
|
RenumberAll(Model[Model], start[integer]) [static]DescriptionRenumbers all of the *SENSOR_DEFINEs in the model. |
Model that all *SENSOR_DEFINEs will be renumbered in
Start point for renumbering
ReturnsNo return value |
ExampleTo renumber all of the *SENSOR_DEFINEs in model m, from 1000000: SensorDefine.RenumberAll(m, 1000000);
|
RenumberFlagged(Model[Model], flag[Flag], start[integer]) [static]DescriptionRenumbers all of the flagged *SENSOR_DEFINEs in the model. |
Model that all the flagged *SENSOR_DEFINEs will be renumbered in
Flag set on the *SENSOR_DEFINEs that you want to renumber
Start point for renumbering
ReturnsNo return value |
ExampleTo 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]DescriptionAllows the user to select *SENSOR_DEFINEs using standard PRIMER object menus. |
Flag to use when selecting *SENSOR_DEFINEs
Text to display as a prompt to the user
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.
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.
ReturnsNumber of *SENSOR_DEFINEs selected or null if menu cancelled Return typeNumber |
SetFlag(flag[Flag])DescriptionSets a flag on the *SENSOR_DEFINE. |
Flag to set on the *SENSOR_DEFINE
ReturnsNo return value |
ExampleTo set flag f for *SENSOR_DEFINE sd: sd.SetFlag(f);
|
Total(Model[Model], exists (optional)[boolean]) [static]DescriptionReturns the total number of *SENSOR_DEFINEs in the model. |
Model to get total for
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.
Returnsnumber of *SENSOR_DEFINEs Return typeNumber |
ExampleTo get the total number of *SENSOR_DEFINEs in model m: var total = SensorDefine.Total(m);
|
UnflagAll(Model[Model], flag[Flag]) [static]DescriptionUnsets a defined flag on all of the *SENSOR_DEFINEs in the model. |
Model that the defined flag for all *SENSOR_DEFINEs will be unset in
Flag to unset on the *SENSOR_DEFINEs
ReturnsNo return value |
ExampleTo unset the flag f on all the *SENSOR_DEFINEs in model m: SensorDefine.UnflagAll(m, f);
|
No arguments
ReturnsSensorDefine object. Return typeSensorDefine |
ExampleTo 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])DescriptionAdds a warning for *SENSOR_DEFINE. For more details on checking see the Check class. |
The warning message to give
An optional detailed warning message
ReturnsNo return value |
ExampleTo add a warning message "My custom warning" for *SENSOR_DEFINE sd: sd.Warning("My custom warning");
|
Xrefs()DescriptionReturns the cross references for this *SENSOR_DEFINE. |
No arguments
ReturnsXrefs object. Return typeXrefs |
ExampleTo get the cross references for *SENSOR_DEFINE sd: var xrefs = sd.Xrefs();
|
toString()DescriptionCreates 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(). |
No arguments
Returnsstring Return typeString |
ExampleTo get data for sensor define sd in keyword format var str = sd.toString();
|