The LoadRigidBody class gives you access to define load rigidbody 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 |
| cid | integer | Coordinate system ID |
| dof | integer | Applicable degrees-of-freedom |
| exists (read only) | logical | true if load rigidbody exists, false if referred to but not defined. |
| include | integer | The Include file number that the load rigidbody is in. |
| lcid | integer | Curve ID |
| m1 | integer | Node 1 ID |
| m2 | integer | Node 2 ID |
| m3 | integer | Node 3 ID |
| model (read only) | integer | The Model number that the load rigidbody is in. |
| pid | integer | Part ID |
| sf | real | Curve scale factor |
Detailed DescriptionThe LoadRigidBody class allows you to create, modify, edit and manipulate load rigidbody cards. See the documentation below for more details. |
Constructornew LoadRigidBody(Model[Model], pid[integer], dof[integer], lcid[integer], sf (optional)[real], cid (optional)[integer], m1 (optional)[integer], m2 (optional)[integer], m3 (optional)[integer])DescriptionCreate a new LoadRigidBody object. |
Model that load rigidbody will be created in
Part ID
Applicable degrees-of-freedom
Curve ID
Curve scale factor
Coordinate system ID
Node 1 ID
Node 2 ID
Node 3 ID
ReturnsLoadRigidBody object Return typeLoadRigidBody |
ExampleTo create a new load rigidbody in model m, for part 100, with loadcurve 9 and a scale factor of 0.5 var lrb = new LoadRigidBody(m, 100, 2, 9, 0.5);
|
Details of functionsAssociateComment(Comment[Comment])DescriptionAssociates a comment with a load rigidbody. |
Comment that will be attached to the load rigidbody
ReturnsNo return value |
ExampleTo associate comment c to the load rigidbody lrb: lrb.AssociateComment(c);
|
Blank()DescriptionBlanks the load rigidbody |
No arguments
ReturnsNo return value |
ExampleTo blank load rigidbody lrb: lrb.Blank();
|
BlankAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionBlanks all of the load rigidbodies in the model. |
Model that all load rigidbodies 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 load rigidbodies in model m: LoadRigidBody.BlankAll(m);
|
BlankFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionBlanks all of the flagged load rigidbodies in the model. |
Model that all the flagged load rigidbodies will be blanked in
Flag set on the load rigidbodies 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 load rigidbodies in model m flagged with f: LoadRigidBody.BlankFlagged(m, f);
|
Blanked()DescriptionChecks if the load rigidbody is blanked or not. |
No arguments
Returnstrue if blanked, false if not. Return typeBoolean |
ExampleTo check if load rigidbody lrb is blanked: if (lrb.Blanked() ) do_something...
|
ClearFlag(flag[Flag])DescriptionClears a flag on the load rigidbody. |
Flag to clear on the load rigidbody
ReturnsNo return value |
ExampleTo clear flag f for load rigidbody lrb: lrb.ClearFlag(f);
|
Copy(range (optional)[boolean])DescriptionCopies the load rigidbody. The target include of the copied load rigidbody 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().
ReturnsLoadRigidBody object Return typeLoadRigidBody |
ExampleTo copy load rigidbody lrb into load rigidbody z: var z = lrb.Copy();
|
DetachComment(Comment[Comment])DescriptionDetaches a comment from a load rigidbody. |
Comment that will be detached from the load rigidbody
ReturnsNo return value |
ExampleTo detach comment c from the load rigidbody lrb: lrb.DetachComment(c);
|
Error(message[string], details (optional)[string])DescriptionAdds an error for load rigidbody. 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 load rigidbody lrb: lrb.Error("My custom error");
|
First(Model[Model]) [static]DescriptionReturns the first load rigidbody in the model. |
Model to get first load rigidbody in
ReturnsLoadRigidBody object (or null if there are no load rigidbodies in the model). Return typeLoadRigidBody |
ExampleTo get the first load rigidbody in model m: var lrb = LoadRigidBody.First(m);
|
FlagAll(Model[Model], flag[Flag]) [static]DescriptionFlags all of the load rigidbodies in the model with a defined flag. |
Model that all load rigidbodies will be flagged in
Flag to set on the load rigidbodies
ReturnsNo return value |
ExampleTo flag all of the load rigidbodies with flag f in model m: LoadRigidBody.FlagAll(m, f);
|
Flagged(flag[Flag])DescriptionChecks if the load rigidbody is flagged or not. |
Flag to test on the load rigidbody
Returnstrue if flagged, false if not. Return typeBoolean |
ExampleTo check if load rigidbody lrb has flag f set on it: if (lrb.Flagged(f) ) do_something...
|
ForEach(Model[Model], func[function], extra (optional)[any]) [static]DescriptionCalls a function for each load rigidbody in the model. |
Model that all load rigidbodies are in
Function to call for each load rigidbody
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 LoadRigidBody objects or properties for all of the load rigidbodies in a model in PRIMER. If the optional property argument is not given then an array of LoadRigidBody objects is returned. If the property argument is given, that property value for each load rigidbody is returned in the array instead of a LoadRigidBody object |
Model to get load rigidbodies from
Name for property to get for all load rigidbodies in the model
ReturnsArray of LoadRigidBody objects or properties Return typeArray |
GetComments()DescriptionExtracts the comments associated to a load rigidbody. |
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 load rigidbody lrb: var comm_array = lrb.GetComments();
|
GetFlagged(Model[Model], flag[Flag], property (optional)[string]) [static]DescriptionReturns an array of LoadRigidBody objects for all of the flagged load rigidbodies in a model in PRIMER If the optional property argument is not given then an array of LoadRigidBody objects is returned. If the property argument is given, then that property value for each load rigidbody is returned in the array instead of a LoadRigidBody object |
Model to get load rigidbodies from
Flag set on the load rigidbodies that you want to retrieve
Name for property to get for all flagged load rigidbodies in the model
ReturnsArray of LoadRigidBody objects or properties Return typeArray |
GetFromID(Model[Model], number[integer]) [static]DescriptionReturns the LoadRigidBody object for a load rigidbody ID. |
Model to find the load rigidbody in
number of the load rigidbody you want the LoadRigidBody object for
ReturnsLoadRigidBody object (or null if load rigidbody does not exist). Return typeLoadRigidBody |
ExampleTo get the LoadRigidBody object for load rigidbody 100 in model m var lrb = LoadRigidBody.GetFromID(m, 100);
|
GetParameter(prop[string])DescriptionChecks if a LoadRigidBody 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 LoadRigidBody.ViewParameters() method and 'method chaining' (see the examples below). |
load rigidbody property to get parameter for
ReturnsParameter object if property is a parameter, null if not. Return typeParameter |
Keyword()DescriptionReturns the keyword for this load rigidbody (*LOAD_RIGIDBODY). Note that a carriage return is not added. See also LoadRigidBody.KeywordCards() |
No arguments
Returnsstring containing the keyword. Return typeString |
ExampleTo get the keyword for load rigidbody lrb: var key = lrb.Keyword();
|
KeywordCards()DescriptionReturns the keyword cards for the load rigidbody. Note that a carriage return is not added. See also LoadRigidBody.Keyword() |
No arguments
Returnsstring containing the cards. Return typeString |
ExampleTo get the cards for load rigidbody lrb: var cards = lrb.KeywordCards();
|
Last(Model[Model]) [static]DescriptionReturns the last load rigidbody in the model. |
Model to get last load rigidbody in
ReturnsLoadRigidBody object (or null if there are no load rigidbodies in the model). Return typeLoadRigidBody |
ExampleTo get the last load rigidbody in model m: var lrb = LoadRigidBody.Last(m);
|
Next()DescriptionReturns the next load rigidbody in the model. |
No arguments
ReturnsLoadRigidBody object (or null if there are no more load rigidbodies in the model). Return typeLoadRigidBody |
ExampleTo get the load rigidbody in model m after load rigidbody lrb: var lrb = lrb.Next();
|
Pick(prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean], button text (optional)[string]) [static]DescriptionAllows the user to pick a load rigidbody. |
Text to display as a prompt to the user
If the argument is a Model then only load rigidbodies from that model can be picked. If the argument is a Flag then only load rigidbodies that are flagged with limit can be selected. If omitted, or null, any load rigidbodies 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.
ReturnsLoadRigidBody object (or null if not picked) Return typeLoadRigidBody |
ExampleTo pick a load rigidbody from model m giving the prompt 'Pick load rigidbody from screen': var lrb = LoadRigidBody.Pick('Pick load rigidbody from screen', m);
|
Previous()DescriptionReturns the previous load rigidbody in the model. |
No arguments
ReturnsLoadRigidBody object (or null if there are no more load rigidbodies in the model). Return typeLoadRigidBody |
ExampleTo get the load rigidbody in model m before load rigidbody lrb: var lrb = lrb.Previous();
|
Select(flag[Flag], prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean]) [static]DescriptionAllows the user to select load rigidbodies using standard PRIMER object menus. |
Flag to use when selecting load rigidbodies
Text to display as a prompt to the user
If the argument is a Model then only load rigidbodies from that model can be selected. If the argument is a Flag then only load rigidbodies that are flagged with limit can be selected (limit should be different to flag). If omitted, or null, any load rigidbodies 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 load rigidbodies selected or null if menu cancelled Return typeNumber |
SetFlag(flag[Flag])DescriptionSets a flag on the load rigidbody. |
Flag to set on the load rigidbody
ReturnsNo return value |
ExampleTo set flag f for load rigidbody lrb: lrb.SetFlag(f);
|
Sketch(redraw (optional)[boolean])DescriptionSketches the load rigidbody. The load rigidbody will be sketched until you either call LoadRigidBody.Unsketch(), LoadRigidBody.UnsketchAll(), Model.UnsketchAll(), or delete the model |
If model should be redrawn or not after the load rigidbody is sketched. If omitted redraw is true. If you want to sketch several load rigidbodies and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo sketch load rigidbody lrb: lrb.Sketch();
|
SketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionSketches all of the flagged load rigidbodies in the model. The load rigidbodies will be sketched until you either call LoadRigidBody.Unsketch(), LoadRigidBody.UnsketchFlagged(), Model.UnsketchAll(), or delete the model |
Model that all the flagged load rigidbodies will be sketched in
Flag set on the load rigidbodies that you want to sketch
If model should be redrawn or not after the load rigidbodies are sketched. If omitted redraw is true. If you want to sketch flagged load rigidbodies several times and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo sketch all load rigidbodies flagged with flag in model m: LoadRigidBody.SketchFlagged(m, flag);
|
Total(Model[Model], exists (optional)[boolean]) [static]DescriptionReturns the total number of load rigidbodies in the model. |
Model to get total for
true if only existing load rigidbodies should be counted. If false or omitted referenced but undefined load rigidbodies will also be included in the total.
Returnsnumber of load rigidbodies Return typeNumber |
ExampleTo get the total number of load rigidbodies in model m: var total = LoadRigidBody.Total(m);
|
Unblank()DescriptionUnblanks the load rigidbody |
No arguments
ReturnsNo return value |
ExampleTo unblank load rigidbody lrb: lrb.Unblank();
|
UnblankAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionUnblanks all of the load rigidbodies in the model. |
Model that all load rigidbodies 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 load rigidbodies in model m: LoadRigidBody.UnblankAll(m);
|
UnblankFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionUnblanks all of the flagged load rigidbodies in the model. |
Model that the flagged load rigidbodies will be unblanked in
Flag set on the load rigidbodies 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 load rigidbodies in model m flagged with f: LoadRigidBody.UnblankFlagged(m, f);
|
UnflagAll(Model[Model], flag[Flag]) [static]DescriptionUnsets a defined flag on all of the load rigidbodies in the model. |
Model that the defined flag for all load rigidbodies will be unset in
Flag to unset on the load rigidbodies
ReturnsNo return value |
ExampleTo unset the flag f on all the load rigidbodies in model m: LoadRigidBody.UnflagAll(m, f);
|
Unsketch(redraw (optional)[boolean])DescriptionUnsketches the load rigidbody. |
If model should be redrawn or not after the load rigidbody is unsketched. If omitted redraw is true. If you want to unsketch several load rigidbodies and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo unsketch load rigidbody lrb: lrb.Unsketch();
|
UnsketchAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionUnsketches all load rigidbodies. |
Model that all load rigidbodies will be unblanked in
If model should be redrawn or not after the load rigidbodies 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 load rigidbodies in model m: LoadRigidBody.UnsketchAll(m);
|
UnsketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionUnsketches all flagged load rigidbodies in the model. |
Model that all load rigidbodies will be unsketched in
Flag set on the load rigidbodies that you want to unsketch
If model should be redrawn or not after the load rigidbodies 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 load rigidbodies flagged with flag in model m: LoadRigidBody.UnsketchAll(m, flag);
|
No arguments
ReturnsLoadRigidBody object. Return typeLoadRigidBody |
ExampleTo check if LoadRigidBody property lrb.example is a parameter by using the LoadRigidBody.GetParameter() method: if (lrb.ViewParameters().GetParameter(lrb.example) ) do_something...
|
Warning(message[string], details (optional)[string])DescriptionAdds a warning for load rigidbody. 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 load rigidbody lrb: lrb.Warning("My custom warning");
|
Xrefs()DescriptionReturns the cross references for this load rigidbody. |
No arguments
ReturnsXrefs object. Return typeXrefs |
ExampleTo get the cross references for load rigidbody lrb: var xrefs = lrb.Xrefs();
|
toString()DescriptionCreates a string containing the load rigidbody data in keyword format. Note that this contains the keyword header and the keyword cards. See also LoadRigidBody.Keyword() and LoadRigidBody.KeywordCards(). |
No arguments
Returnsstring Return typeString |
ExampleTo get data for load rigidbody lrb in keyword format var s = lrb.toString();
|