The Accelerometer class gives you access to seatbelt accelerometer cards 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 |
| colour | Colour | The colour of the accelerometer |
| exists (read only) | logical | true if accelerometer exists, false if referred to but not defined. |
| igrav | integer | Gravitational acceleration due to body force loads is included in acceleration output if igrav is 0, removed if igrav is 1. |
| include | integer | The Include file number that the accelerometer is in. |
| intopt | integer | Integration option; velocities are integrated from global accelerations and transformed into local system if intopt is 0, they are integrated directly from local accelerations if intopt is 1. |
| label | integer | Accelerometer number. Also see the sbacid property which is an alternative name for this. |
| mass | real | Optional added mass for accelerometer |
| model (read only) | integer | The Model number that the accelerometer is in. |
| nid1 | integer | Node number 1 |
| nid2 | integer | Node number 2 |
| nid3 | integer | Node number 3 |
| sbacid | integer | Accelerometer number. Also see the label property which is an alternative name for this. |
| transparency | integer | The transparency of the accelerometer (0-100) 0% is opaque, 100% is transparent. |
Detailed DescriptionThe Accelerometer class allows you to create, modify, edit and manipulate seatbelt accelerometer cards. See the documentation below for more details. |
Constructornew Accelerometer(Model[Model], sbacid[integer], nid1[integer], nid2[integer], nid3[integer], igrav (optional)[integer], intopt (optional)[integer], mass (optional)[real])DescriptionCreate a new Seatbelt Accelerometer object. |
Model that accelerometer will be created in
Accelerometer number. Also see the label property which is an alternative name for this.
Node number 1
Node number 2
Node number 3
Gravitational acceleration due to body force loads is included in acceleration output if igrav is 0, removed if igrav is 1.
Integration option; velocities are integrated from global accelerations and transformed into local system if intopt is 0, they are integrated directly from local accelerations if intopt is 1.
Optional added mass for accelerometer
ReturnsAccelerometer object Return typeAccelerometer |
ExampleTo create a new seatbelt accelerometer in model m with label 100, nodes 1, 2 and 3: var a = new Accelerometer(m, 100, 1, 2, 3);
|
Details of functionsAssociateComment(Comment[Comment])DescriptionAssociates a comment with a accelerometer. |
Comment that will be attached to the accelerometer
ReturnsNo return value |
ExampleTo associate comment c to the accelerometer a: a.AssociateComment(c);
|
Blank()DescriptionBlanks the accelerometer |
No arguments
ReturnsNo return value |
ExampleTo blank accelerometer a: a.Blank();
|
BlankAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionBlanks all of the accelerometers in the model. |
Model that all accelerometers will be blanked in
If model should be redrawn or not. If omitted redraw is false. If you want to do several (un)blanks and only redraw after the last one then use false for all redraws apart from the last one. Alternatively you can redraw using View.Redraw().
ReturnsNo return value |
ExampleTo blank all of the accelerometers in model m: Accelerometer.BlankAll(m);
|
BlankFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionBlanks all of the flagged accelerometers in the model. |
Model that all the flagged accelerometers will be blanked in
Flag set on the accelerometers that you want to blank
If model should be redrawn or not. If omitted redraw is false. If you want to do several (un)blanks and only redraw after the last one then use false for all redraws apart from the last one. Alternatively you can redraw using View.Redraw().
ReturnsNo return value |
ExampleTo blank all of the accelerometers in model m flagged with f: Accelerometer.BlankFlagged(m, f);
|
Blanked()DescriptionChecks if the accelerometer is blanked or not. |
No arguments
Returnstrue if blanked, false if not. Return typeBoolean |
ExampleTo check if accelerometer a is blanked: if (a.Blanked() ) do_something...
|
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 accelerometer a: a.Browse();
|
ClearFlag(flag[Flag])DescriptionClears a flag on the accelerometer. |
Flag to clear on the accelerometer
ReturnsNo return value |
ExampleTo clear flag f for accelerometer a: a.ClearFlag(f);
|
Copy(range (optional)[boolean])DescriptionCopies the accelerometer. The target include of the copied accelerometer 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().
ReturnsAccelerometer object Return typeAccelerometer |
ExampleTo copy accelerometer a into accelerometer z: var z = a.Copy();
|
Create(Model[Model], modal (optional)[boolean]) [static]DescriptionStarts an interactive editing panel to create a accelerometer |
Model that the accelerometer 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.
ReturnsAccelerometer object (or null if not made). Return typeAccelerometer |
ExampleTo start creating a accelerometer in model m: var a = Accelerometer.Create(m);
|
DetachComment(Comment[Comment])DescriptionDetaches a comment from a accelerometer. |
Comment that will be detached from the accelerometer
ReturnsNo return value |
ExampleTo detach comment c from the accelerometer a: a.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 accelerometer a: a.Edit();
|
Error(message[string], details (optional)[string])DescriptionAdds an error for accelerometer. 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 accelerometer a: a.Error("My custom error");
|
ExtractColour()DescriptionExtracts the actual colour used for accelerometer. |
No arguments
Returnscolour value (integer) Return typeNumber |
ExampleTo return the colour used for drawing accelerometer a: var colour = a.ExtractColour();
|
First(Model[Model]) [static]DescriptionReturns the first accelerometer in the model. |
Model to get first accelerometer in
ReturnsAccelerometer object (or null if there are no accelerometers in the model). Return typeAccelerometer |
ExampleTo get the first accelerometer in model m: var a = Accelerometer.First(m);
|
FirstFreeLabel(Model[Model], layer (optional)[Include number]) [static]DescriptionReturns the first free accelerometer label in the model. Also see Accelerometer.LastFreeLabel(), Accelerometer.NextFreeLabel() and Model.FirstFreeItemLabel(). |
Model to get first free accelerometer 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).
ReturnsAccelerometer label. Return typeNumber |
ExampleTo get the first free accelerometer label in model m: var label = Accelerometer.FirstFreeLabel(m);
|
FlagAll(Model[Model], flag[Flag]) [static]DescriptionFlags all of the accelerometers in the model with a defined flag. |
Model that all accelerometers will be flagged in
Flag to set on the accelerometers
ReturnsNo return value |
ExampleTo flag all of the accelerometers with flag f in model m: Accelerometer.FlagAll(m, f);
|
Flagged(flag[Flag])DescriptionChecks if the accelerometer is flagged or not. |
Flag to test on the accelerometer
Returnstrue if flagged, false if not. Return typeBoolean |
ExampleTo check if accelerometer a has flag f set on it: if (a.Flagged(f) ) do_something...
|
ForEach(Model[Model], func[function], extra (optional)[any]) [static]DescriptionCalls a function for each accelerometer in the model. |
Model that all accelerometers are in
Function to call for each accelerometer
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 Accelerometer objects or properties for all of the accelerometers in a model in PRIMER. If the optional property argument is not given then an array of Accelerometer objects is returned. If the property argument is given, that property value for each accelerometer is returned in the array instead of a Accelerometer object |
Model to get accelerometers from
Name for property to get for all accelerometers in the model
ReturnsArray of Accelerometer objects or properties Return typeArray |
GetComments()DescriptionExtracts the comments associated to a accelerometer. |
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 accelerometer a: var comm_array = a.GetComments();
|
GetFlagged(Model[Model], flag[Flag], property (optional)[string]) [static]DescriptionReturns an array of Accelerometer objects for all of the flagged accelerometers in a model in PRIMER If the optional property argument is not given then an array of Accelerometer objects is returned. If the property argument is given, then that property value for each accelerometer is returned in the array instead of a Accelerometer object |
Model to get accelerometers from
Flag set on the accelerometers that you want to retrieve
Name for property to get for all flagged accelerometers in the model
ReturnsArray of Accelerometer objects or properties Return typeArray |
GetFromID(Model[Model], number[integer]) [static]DescriptionReturns the Accelerometer object for a accelerometer ID. |
Model to find the accelerometer in
number of the accelerometer you want the Accelerometer object for
ReturnsAccelerometer object (or null if accelerometer does not exist). Return typeAccelerometer |
ExampleTo get the Accelerometer object for accelerometer 100 in model m var a = Accelerometer.GetFromID(m, 100);
|
GetParameter(prop[string])DescriptionChecks if a Accelerometer 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 Accelerometer.ViewParameters() method and 'method chaining' (see the examples below). |
accelerometer property to get parameter for
ReturnsParameter object if property is a parameter, null if not. Return typeParameter |
Keyword()DescriptionReturns the keyword for this accelerometer (*ELEMENT_SEATBELT_ACCELEROMETER) Note that a carriage return is not added. See also Accelerometer.KeywordCards() |
No arguments
Returnsstring containing the keyword. Return typeString |
ExampleTo get the keyword for accelerometer a: var key = a.Keyword();
|
KeywordCards()DescriptionReturns the keyword cards for the accelerometer. Note that a carriage return is not added. See also Accelerometer.Keyword() |
No arguments
Returnsstring containing the cards. Return typeString |
ExampleTo get the cards for accelerometer a: var cards = a.KeywordCards();
|
Last(Model[Model]) [static]DescriptionReturns the last accelerometer in the model. |
Model to get last accelerometer in
ReturnsAccelerometer object (or null if there are no accelerometers in the model). Return typeAccelerometer |
ExampleTo get the last accelerometer in model m: var a = Accelerometer.Last(m);
|
LastFreeLabel(Model[Model], layer (optional)[Include number]) [static]DescriptionReturns the last free accelerometer label in the model. Also see Accelerometer.FirstFreeLabel(), Accelerometer.NextFreeLabel() and see Model.LastFreeItemLabel() |
Model to get last free accelerometer 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.
ReturnsAccelerometer label. Return typeNumber |
ExampleTo get the last free accelerometer label in model m: var label = Accelerometer.LastFreeLabel(m);
|
Next()DescriptionReturns the next accelerometer in the model. |
No arguments
ReturnsAccelerometer object (or null if there are no more accelerometers in the model). Return typeAccelerometer |
ExampleTo get the accelerometer in model m after accelerometer a: var a = a.Next();
|
NextFreeLabel(Model[Model], layer (optional)[Include number]) [static]DescriptionReturns the next free (highest+1) accelerometer label in the model. Also see Accelerometer.FirstFreeLabel(), Accelerometer.LastFreeLabel() and Model.NextFreeItemLabel() |
Model to get next free accelerometer 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).
ReturnsAccelerometer label. Return typeNumber |
ExampleTo get the next free accelerometer label in model m: var label = Accelerometer.NextFreeLabel(m);
|
Pick(prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean], button text (optional)[string]) [static]DescriptionAllows the user to pick a accelerometer. |
Text to display as a prompt to the user
If the argument is a Model then only accelerometers from that model can be picked. If the argument is a Flag then only accelerometers that are flagged with limit can be selected. If omitted, or null, any accelerometers from any model can be selected. from any model.
If picking is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the pick will be modal.
By default the window with the prompt will have a button labelled 'Cancel' which if pressed will cancel the pick and return null. If you want to change the text on the button use this argument. If omitted 'Cancel' will be used.
ReturnsAccelerometer object (or null if not picked) Return typeAccelerometer |
ExampleTo pick a accelerometer from model m giving the prompt 'Pick accelerometer from screen': var a = Accelerometer.Pick('Pick accelerometer from screen', m);
|
Previous()DescriptionReturns the previous accelerometer in the model. |
No arguments
ReturnsAccelerometer object (or null if there are no more accelerometers in the model). Return typeAccelerometer |
ExampleTo get the accelerometer in model m before accelerometer a: var a = a.Previous();
|
RenumberAll(Model[Model], start[integer]) [static]DescriptionRenumbers all of the accelerometers in the model. |
Model that all accelerometers will be renumbered in
Start point for renumbering
ReturnsNo return value |
ExampleTo renumber all of the accelerometers in model m, from 1000000: Accelerometer.RenumberAll(m, 1000000);
|
RenumberFlagged(Model[Model], flag[Flag], start[integer]) [static]DescriptionRenumbers all of the flagged accelerometers in the model. |
Model that all the flagged accelerometers will be renumbered in
Flag set on the accelerometers that you want to renumber
Start point for renumbering
ReturnsNo return value |
ExampleTo renumber all of the accelerometers in model m flagged with f, from 1000000: Accelerometer.RenumberFlagged(m, f, 1000000);
|
Select(flag[Flag], prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean]) [static]DescriptionAllows the user to select accelerometers using standard PRIMER object menus. |
Flag to use when selecting accelerometers
Text to display as a prompt to the user
If the argument is a Model then only accelerometers from that model can be selected. If the argument is a Flag then only accelerometers that are flagged with limit can be selected (limit should be different to flag). If omitted, or null, any accelerometers 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 accelerometers selected or null if menu cancelled Return typeNumber |
SetFlag(flag[Flag])DescriptionSets a flag on the accelerometer. |
Flag to set on the accelerometer
ReturnsNo return value |
ExampleTo set flag f for accelerometer a: a.SetFlag(f);
|
Sketch(redraw (optional)[boolean])DescriptionSketches the accelerometer. The accelerometer will be sketched until you either call Accelerometer.Unsketch(), Accelerometer.UnsketchAll(), Model.UnsketchAll(), or delete the model |
If model should be redrawn or not after the accelerometer is sketched. If omitted redraw is true. If you want to sketch several accelerometers and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo sketch accelerometer a: a.Sketch();
|
SketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionSketches all of the flagged accelerometers in the model. The accelerometers will be sketched until you either call Accelerometer.Unsketch(), Accelerometer.UnsketchFlagged(), Model.UnsketchAll(), or delete the model |
Model that all the flagged accelerometers will be sketched in
Flag set on the accelerometers that you want to sketch
If model should be redrawn or not after the accelerometers are sketched. If omitted redraw is true. If you want to sketch flagged accelerometers several times and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo sketch all accelerometers flagged with flag in model m: Accelerometer.SketchFlagged(m, flag);
|
Total(Model[Model], exists (optional)[boolean]) [static]DescriptionReturns the total number of accelerometers in the model. |
Model to get total for
true if only existing accelerometers should be counted. If false or omitted referenced but undefined accelerometers will also be included in the total.
Returnsnumber of accelerometers Return typeNumber |
ExampleTo get the total number of accelerometers in model m: var total = Accelerometer.Total(m);
|
Unblank()DescriptionUnblanks the accelerometer |
No arguments
ReturnsNo return value |
ExampleTo unblank accelerometer a: a.Unblank();
|
UnblankAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionUnblanks all of the accelerometers in the model. |
Model that all accelerometers will be unblanked in
If model should be redrawn or not. If omitted redraw is false. If you want to do several (un)blanks and only redraw after the last one then use false for all redraws apart from the last one. Alternatively you can redraw using View.Redraw().
ReturnsNo return value |
ExampleTo unblank all of the accelerometers in model m: Accelerometer.UnblankAll(m);
|
UnblankFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionUnblanks all of the flagged accelerometers in the model. |
Model that the flagged accelerometers will be unblanked in
Flag set on the accelerometers that you want to unblank
If model should be redrawn or not. If omitted redraw is false. If you want to do several (un)blanks and only redraw after the last one then use false for all redraws apart from the last one. Alternatively you can redraw using View.Redraw().
ReturnsNo return value |
ExampleTo unblank all of the accelerometers in model m flagged with f: Accelerometer.UnblankFlagged(m, f);
|
UnflagAll(Model[Model], flag[Flag]) [static]DescriptionUnsets a defined flag on all of the accelerometers in the model. |
Model that the defined flag for all accelerometers will be unset in
Flag to unset on the accelerometers
ReturnsNo return value |
ExampleTo unset the flag f on all the accelerometers in model m: Accelerometer.UnflagAll(m, f);
|
Unsketch(redraw (optional)[boolean])DescriptionUnsketches the accelerometer. |
If model should be redrawn or not after the accelerometer is unsketched. If omitted redraw is true. If you want to unsketch several accelerometers and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo unsketch accelerometer a: a.Unsketch();
|
UnsketchAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionUnsketches all accelerometers. |
Model that all accelerometers will be unblanked in
If model should be redrawn or not after the accelerometers are unsketched. If omitted redraw is true. If you want to unsketch several things and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo unsketch all accelerometers in model m: Accelerometer.UnsketchAll(m);
|
UnsketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionUnsketches all flagged accelerometers in the model. |
Model that all accelerometers will be unsketched in
Flag set on the accelerometers that you want to unsketch
If model should be redrawn or not after the accelerometers are unsketched. If omitted redraw is true. If you want to unsketch several things and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo unsketch all accelerometers flagged with flag in model m: Accelerometer.UnsketchAll(m, flag);
|
No arguments
ReturnsAccelerometer object. Return typeAccelerometer |
ExampleTo check if Accelerometer property a.example is a parameter by using the Accelerometer.GetParameter() method: if (a.ViewParameters().GetParameter(a.example) ) do_something...
|
Warning(message[string], details (optional)[string])DescriptionAdds a warning for accelerometer. 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 accelerometer a: a.Warning("My custom warning");
|
Xrefs()DescriptionReturns the cross references for this accelerometer. |
No arguments
ReturnsXrefs object. Return typeXrefs |
ExampleTo get the cross references for accelerometer a: var xrefs = a.Xrefs();
|
toString()DescriptionCreates a string containing the accelerometer data in keyword format. Note that this contains the keyword header and the keyword cards. See also Accelerometer.Keyword() and Accelerometer.KeywordCards(). |
No arguments
Returnsstring Return typeString |
ExampleTo get data for accelerometer a in keyword format var str = a.toString();
|