The Retractor class gives you access to seatbelt retractor 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 retractor |
| dsid | integer | Retractor deactivation Sensor |
| exists (read only) | logical | true if retractor exists, false if referred to but not defined. |
| flopt | integer | limiting force flage |
| include | integer | The Include file number that the retractor is in. |
| label | integer | Retractor number. Also see the sbrid property which is an alternative name for this. |
| lcfl | integer | Loadcurve representing an adaptive multi-level load limiter |
| lfed | real | Fed length |
| llcid | integer | Loadcurve for loading (pull-out vs force) |
| model (read only) | integer | The Model number that the retractor is in. |
| nsbi | integer | Number of elements inside the retractor |
| pull | real | Amount of pull out between time delay ending and retractor locking |
| sbid | integer | Seatbelt1D number (or Set Shell number if sbrnid is negative). |
| sbrid | integer | Retractor number. Also see the label property which is an alternative name for this. |
| sbrnid | integer | Node number (or Set Node number if negative). |
| shell_seatbelt (read only) | logical | true if retractor is used for shell (2D) seatbelt elements. |
| sid1 | integer | Sensor number 1 |
| sid2 | integer | Sensor number 2 |
| sid3 | integer | Sensor number 3 |
| sid4 | integer | Sensor number 4 |
| tdel | real | Time delay after sensor triggers |
| transparency | integer | The transparency of the retractor (0-100) 0% is opaque, 100% is transparent. |
| ulcid | integer | Loadcurve for unloading (pull-out vs force) |
Detailed DescriptionThe Retractor class allows you to create, modify, edit and manipulate seatbelt retractor cards. See the documentation below for more details. |
Constructornew Retractor(Model[Model], sbrid[integer], sbrnid[integer], sbid[integer], llcid[integer], sid1[integer], sid2 (optional)[integer], sid3 (optional)[integer], sid4 (optional)[integer], tdel (optional)[real], pull (optional)[real], ulcid (optional)[integer], lfed (optional)[real], lcfl (optional)[integer], flopt(optional)[integer])DescriptionCreate a new Seatbelt Retractor object. |
Model that retractor will be created in
Retractor number.
Seatbelt number. (or Set Shell number if sbrnid is negative)
Loadcurve for loading (pull-out vs force)
Sensor number 1
Sensor number 2
Sensor number 3
Sensor number 4
Time delay after sensor triggers.
Amount of pull out between time delay ending and retractor locking.
Loadcurve for unloading (pull-out vs force)
Fed length
Loadcurve representing an adaptive multi-level load limiter
limiting force flage
ReturnsRetractor object Return typeRetractor |
ExampleTo create a new seatbelt retractor in model m with label 100, retractor Node 10, Seatbelt 20, Loading curve 30 and Sensor 40: var a = new Retractor(m, 100, 10, 20, 30, 40);
|
Details of functionsAssociateComment(Comment[Comment])DescriptionAssociates a comment with a retractor. |
Comment that will be attached to the retractor
ReturnsNo return value |
ExampleTo associate comment c to the retractor r: r.AssociateComment(c);
|
Blank()DescriptionBlanks the retractor |
No arguments
ReturnsNo return value |
ExampleTo blank retractor r: r.Blank();
|
BlankAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionBlanks all of the retractors in the model. |
Model that all retractors 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 retractors in model m: Retractor.BlankAll(m);
|
BlankFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionBlanks all of the flagged retractors in the model. |
Model that all the flagged retractors will be blanked in
Flag set on the retractors 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 retractors in model m flagged with f: Retractor.BlankFlagged(m, f);
|
Blanked()DescriptionChecks if the retractor is blanked or not. |
No arguments
Returnstrue if blanked, false if not. Return typeBoolean |
ExampleTo check if retractor r is blanked: if (r.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 retractor r: r.Browse();
|
ClearFlag(flag[Flag])DescriptionClears a flag on the retractor. |
Flag to clear on the retractor
ReturnsNo return value |
ExampleTo clear flag f for retractor r: r.ClearFlag(f);
|
Copy(range (optional)[boolean])DescriptionCopies the retractor. The target include of the copied retractor 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().
ReturnsRetractor object Return typeRetractor |
ExampleTo copy retractor r into retractor z: var z = r.Copy();
|
Create(Model[Model], modal (optional)[boolean]) [static]DescriptionStarts an interactive editing panel to create a retractor |
Model that the retractor 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.
ReturnsRetractor object (or null if not made). Return typeRetractor |
ExampleTo start creating a retractor in model m: var r = Retractor.Create(m);
|
DetachComment(Comment[Comment])DescriptionDetaches a comment from a retractor. |
Comment that will be detached from the retractor
ReturnsNo return value |
ExampleTo detach comment c from the retractor r: r.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 retractor r: r.Edit();
|
Error(message[string], details (optional)[string])DescriptionAdds an error for retractor. 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 retractor r: r.Error("My custom error");
|
ExtractColour()DescriptionExtracts the actual colour used for retractor. |
No arguments
Returnscolour value (integer) Return typeNumber |
ExampleTo return the colour used for drawing retractor r: var colour = r.ExtractColour();
|
First(Model[Model]) [static]DescriptionReturns the first retractor in the model. |
Model to get first retractor in
ReturnsRetractor object (or null if there are no retractors in the model). Return typeRetractor |
ExampleTo get the first retractor in model m: var r = Retractor.First(m);
|
FirstFreeLabel(Model[Model], layer (optional)[Include number]) [static]DescriptionReturns the first free retractor label in the model. Also see Retractor.LastFreeLabel(), Retractor.NextFreeLabel() and Model.FirstFreeItemLabel(). |
Model to get first free retractor 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).
ReturnsRetractor label. Return typeNumber |
ExampleTo get the first free retractor label in model m: var label = Retractor.FirstFreeLabel(m);
|
FlagAll(Model[Model], flag[Flag]) [static]DescriptionFlags all of the retractors in the model with a defined flag. |
Model that all retractors will be flagged in
Flag to set on the retractors
ReturnsNo return value |
ExampleTo flag all of the retractors with flag f in model m: Retractor.FlagAll(m, f);
|
Flagged(flag[Flag])DescriptionChecks if the retractor is flagged or not. |
Flag to test on the retractor
Returnstrue if flagged, false if not. Return typeBoolean |
ExampleTo check if retractor r has flag f set on it: if (r.Flagged(f) ) do_something...
|
ForEach(Model[Model], func[function], extra (optional)[any]) [static]DescriptionCalls a function for each retractor in the model. |
Model that all retractors are in
Function to call for each retractor
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 Retractor objects or properties for all of the retractors in a model in PRIMER. If the optional property argument is not given then an array of Retractor objects is returned. If the property argument is given, that property value for each retractor is returned in the array instead of a Retractor object |
Model to get retractors from
Name for property to get for all retractors in the model
ReturnsArray of Retractor objects or properties Return typeArray |
GetComments()DescriptionExtracts the comments associated to a retractor. |
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 retractor r: var comm_array = r.GetComments();
|
GetFlagged(Model[Model], flag[Flag], property (optional)[string]) [static]DescriptionReturns an array of Retractor objects for all of the flagged retractors in a model in PRIMER If the optional property argument is not given then an array of Retractor objects is returned. If the property argument is given, then that property value for each retractor is returned in the array instead of a Retractor object |
Model to get retractors from
Flag set on the retractors that you want to retrieve
Name for property to get for all flagged retractors in the model
ReturnsArray of Retractor objects or properties Return typeArray |
GetFromID(Model[Model], number[integer]) [static]DescriptionReturns the Retractor object for a retractor ID. |
Model to find the retractor in
number of the retractor you want the Retractor object for
ReturnsRetractor object (or null if retractor does not exist). Return typeRetractor |
ExampleTo get the Retractor object for retractor 100 in model m var r = Retractor.GetFromID(m, 100);
|
GetParameter(prop[string])DescriptionChecks if a Retractor 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 Retractor.ViewParameters() method and 'method chaining' (see the examples below). |
retractor property to get parameter for
ReturnsParameter object if property is a parameter, null if not. Return typeParameter |
Keyword()DescriptionReturns the keyword for this retractor (*ELEMENT_SEATBELT_RETREROMETER) Note that a carriage return is not added. See also Retractor.KeywordCards() |
No arguments
Returnsstring containing the keyword. Return typeString |
ExampleTo get the keyword for retractor r: var key = r.Keyword();
|
KeywordCards()DescriptionReturns the keyword cards for the retractor. Note that a carriage return is not added. See also Retractor.Keyword() |
No arguments
Returnsstring containing the cards. Return typeString |
ExampleTo get the cards for retractor r: var cards = r.KeywordCards();
|
Last(Model[Model]) [static]DescriptionReturns the last retractor in the model. |
Model to get last retractor in
ReturnsRetractor object (or null if there are no retractors in the model). Return typeRetractor |
ExampleTo get the last retractor in model m: var r = Retractor.Last(m);
|
LastFreeLabel(Model[Model], layer (optional)[Include number]) [static]DescriptionReturns the last free retractor label in the model. Also see Retractor.FirstFreeLabel(), Retractor.NextFreeLabel() and see Model.LastFreeItemLabel() |
Model to get last free retractor 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.
ReturnsRetractor label. Return typeNumber |
ExampleTo get the last free retractor label in model m: var label = Retractor.LastFreeLabel(m);
|
Next()DescriptionReturns the next retractor in the model. |
No arguments
ReturnsRetractor object (or null if there are no more retractors in the model). Return typeRetractor |
ExampleTo get the retractor in model m after retractor r: var r = r.Next();
|
NextFreeLabel(Model[Model], layer (optional)[Include number]) [static]DescriptionReturns the next free (highest+1) retractor label in the model. Also see Retractor.FirstFreeLabel(), Retractor.LastFreeLabel() and Model.NextFreeItemLabel() |
Model to get next free retractor 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).
ReturnsRetractor label. Return typeNumber |
ExampleTo get the next free retractor label in model m: var label = Retractor.NextFreeLabel(m);
|
Pick(prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean], button text (optional)[string]) [static]DescriptionAllows the user to pick a retractor. |
Text to display as a prompt to the user
If the argument is a Model then only retractors from that model can be picked. If the argument is a Flag then only retractors that are flagged with limit can be selected. If omitted, or null, any retractors 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.
ReturnsRetractor object (or null if not picked) Return typeRetractor |
ExampleTo pick a retractor from model m giving the prompt 'Pick retractor from screen': var r = Retractor.Pick('Pick retractor from screen', m);
|
Previous()DescriptionReturns the previous retractor in the model. |
No arguments
ReturnsRetractor object (or null if there are no more retractors in the model). Return typeRetractor |
ExampleTo get the retractor in model m before retractor r: var r = r.Previous();
|
RenumberAll(Model[Model], start[integer]) [static]DescriptionRenumbers all of the retractors in the model. |
Model that all retractors will be renumbered in
Start point for renumbering
ReturnsNo return value |
ExampleTo renumber all of the retractors in model m, from 1000000: Retractor.RenumberAll(m, 1000000);
|
RenumberFlagged(Model[Model], flag[Flag], start[integer]) [static]DescriptionRenumbers all of the flagged retractors in the model. |
Model that all the flagged retractors will be renumbered in
Flag set on the retractors that you want to renumber
Start point for renumbering
ReturnsNo return value |
ExampleTo renumber all of the retractors in model m flagged with f, from 1000000: Retractor.RenumberFlagged(m, f, 1000000);
|
Select(flag[Flag], prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean]) [static]DescriptionAllows the user to select retractors using standard PRIMER object menus. |
Flag to use when selecting retractors
Text to display as a prompt to the user
If the argument is a Model then only retractors from that model can be selected. If the argument is a Flag then only retractors that are flagged with limit can be selected (limit should be different to flag). If omitted, or null, any retractors 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 retractors selected or null if menu cancelled Return typeNumber |
SetFlag(flag[Flag])DescriptionSets a flag on the retractor. |
Flag to set on the retractor
ReturnsNo return value |
ExampleTo set flag f for retractor r: r.SetFlag(f);
|
Sketch(redraw (optional)[boolean])DescriptionSketches the retractor. The retractor will be sketched until you either call Retractor.Unsketch(), Retractor.UnsketchAll(), Model.UnsketchAll(), or delete the model |
If model should be redrawn or not after the retractor is sketched. If omitted redraw is true. If you want to sketch several retractors and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo sketch retractor r: r.Sketch();
|
SketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionSketches all of the flagged retractors in the model. The retractors will be sketched until you either call Retractor.Unsketch(), Retractor.UnsketchFlagged(), Model.UnsketchAll(), or delete the model |
Model that all the flagged retractors will be sketched in
Flag set on the retractors that you want to sketch
If model should be redrawn or not after the retractors are sketched. If omitted redraw is true. If you want to sketch flagged retractors several times and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo sketch all retractors flagged with flag in model m: Retractor.SketchFlagged(m, flag);
|
Total(Model[Model], exists (optional)[boolean]) [static]DescriptionReturns the total number of retractors in the model. |
Model to get total for
true if only existing retractors should be counted. If false or omitted referenced but undefined retractors will also be included in the total.
Returnsnumber of retractors Return typeNumber |
ExampleTo get the total number of retractors in model m: var total = Retractor.Total(m);
|
Unblank()DescriptionUnblanks the retractor |
No arguments
ReturnsNo return value |
ExampleTo unblank retractor r: r.Unblank();
|
UnblankAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionUnblanks all of the retractors in the model. |
Model that all retractors 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 retractors in model m: Retractor.UnblankAll(m);
|
UnblankFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionUnblanks all of the flagged retractors in the model. |
Model that the flagged retractors will be unblanked in
Flag set on the retractors 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 retractors in model m flagged with f: Retractor.UnblankFlagged(m, f);
|
UnflagAll(Model[Model], flag[Flag]) [static]DescriptionUnsets a defined flag on all of the retractors in the model. |
Model that the defined flag for all retractors will be unset in
Flag to unset on the retractors
ReturnsNo return value |
ExampleTo unset the flag f on all the retractors in model m: Retractor.UnflagAll(m, f);
|
Unsketch(redraw (optional)[boolean])DescriptionUnsketches the retractor. |
If model should be redrawn or not after the retractor is unsketched. If omitted redraw is true. If you want to unsketch several retractors and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo unsketch retractor r: r.Unsketch();
|
UnsketchAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionUnsketches all retractors. |
Model that all retractors will be unblanked in
If model should be redrawn or not after the retractors 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 retractors in model m: Retractor.UnsketchAll(m);
|
UnsketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionUnsketches all flagged retractors in the model. |
Model that all retractors will be unsketched in
Flag set on the retractors that you want to unsketch
If model should be redrawn or not after the retractors 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 retractors flagged with flag in model m: Retractor.UnsketchAll(m, flag);
|
No arguments
ReturnsRetractor object. Return typeRetractor |
ExampleTo check if Retractor property r.example is a parameter by using the Retractor.GetParameter() method: if (r.ViewParameters().GetParameter(r.example) ) do_something...
|
Warning(message[string], details (optional)[string])DescriptionAdds a warning for retractor. 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 retractor r: r.Warning("My custom warning");
|
Xrefs()DescriptionReturns the cross references for this retractor. |
No arguments
ReturnsXrefs object. Return typeXrefs |
ExampleTo get the cross references for retractor r: var xrefs = r.Xrefs();
|
toString()DescriptionCreates a string containing the retractor data in keyword format. Note that this contains the keyword header and the keyword cards. See also Retractor.Keyword() and Retractor.KeywordCards(). |
No arguments
Returnsstring Return typeString |
ExampleTo get data for retractor r in keyword format var str = r.toString();
|