The NodalRigidBody class gives you access to define nodal rigid body 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 |
| cmo | integer | Centre of mass option |
| colour | Colour | The colour of the nrb |
| con1 | integer | First retraint parameter |
| con2 | integer | Second retraint parameter |
| drflag | integer | Displacement release flag |
| exists (read only) | logical | true if nodal rigid body exists, false if referred to but not defined. |
| idthrm | integer | Flag for the thermal constraint |
| include | integer | The Include file number that the nodal rigid body is in. |
| inertia | logical | Flag to turn on or off _INERTIA option |
| iprt | integer | Print flag |
| ixx | real | Ixx component of inertia tensor |
| ixy | real | Ixy component of inertia tensor |
| ixz | real | Ixz component of inertia tensor |
| iyy | real | Iyy component of inertia tensor |
| iyz | real | Iyz component of inertia tensor |
| izz | real | Izz component of inertia tensor |
| label | integer | NodalRigidBody ID of the NRB. Also see the pid property which is an alternative name for this. |
| model (read only) | integer | The Model number that the nodal rigid body is in. |
| nodeid | integer | Optional node point |
| nsid | integer | Nodal set ID |
| override | logical | Flag to turn on or off _OVERRIDE option |
| pid | integer | NodalRigidBody ID of the NRB. Also see the label property which is an alternative name for this. |
| pnode | integer | Optional nodal point |
| rrflag | integer | Rotation release flag |
| spc | logical | Flag to turn on or off _SPC option |
| thermal | logical | Flag to turn on or off _THERMAL option |
| tm | real | Translational mass |
| vrx | real | X rigid body rotational velocity |
| vry | real | Y rigid body rotational velocity |
| vrz | real | Z rigid body rotational velocity |
| vtx | real | X rigid body translational velocity |
| vty | real | Y rigid body translational velocity |
| vtz | real | Z rigid body translational velocity |
| xc | real | X coordinate centre of mass |
| xl | real | X coordinate of local x axis |
| xlip | real | X coordinate of local in plane vector |
| yc | real | Y coordinate centre of mass |
| yl | real | Y coordinate of local x axis |
| ylip | real | Y coordinate of local in plane vector |
| zc | real | Z coordinate centre of mass |
| zl | real | Z coordinate of local x axis |
| zlip | real | Z coordinate of local in plane vector |
Constructornew NodalRigidBody(Model[Model], nsid[integer], pid (optional)[integer], cid (optional)[integer], pnode (optional)[integer], iprt (optional)[integer], drflag (optional)[integer], rrflag (optional)[integer])DescriptionCreate a new NodalRigidBody object. |
Model that nrb will be created in
Nodal set ID
NodalRigidBody ID of the NRB. Also see the label property which is an alternative name for this.
Coordinate system ID
Optional nodal point
Print flag
Displacement release flag
Rotation release flag
ReturnsNodalRigidBody object Return typeNodalRigidBody |
ExampleTo create a new nrb in model m with label 200, using node set 50 var v = new NodalRigidBody(m, 50, 200);
|
Details of functionsAssociateComment(Comment[Comment])DescriptionAssociates a comment with a nodal rigid body. |
Comment that will be attached to the nodal rigid body
ReturnsNo return value |
ExampleTo associate comment c to the nodal rigid body nrb: nrb.AssociateComment(c);
|
Blank()DescriptionBlanks the nodal rigid body |
No arguments
ReturnsNo return value |
ExampleTo blank nodal rigid body nrb: nrb.Blank();
|
BlankAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionBlanks all of the nodal rigid bodies in the model. |
Model that all nodal rigid bodies 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 nodal rigid bodies in model m: NodalRigidBody.BlankAll(m);
|
BlankFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionBlanks all of the flagged nodal rigid bodies in the model. |
Model that all the flagged nodal rigid bodies will be blanked in
Flag set on the nodal rigid bodies 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 nodal rigid bodies in model m flagged with f: NodalRigidBody.BlankFlagged(m, f);
|
Blanked()DescriptionChecks if the nodal rigid body is blanked or not. |
No arguments
Returnstrue if blanked, false if not. Return typeBoolean |
ExampleTo check if nodal rigid body nrb is blanked: if (nrb.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 nodal rigid body nrb: nrb.Browse();
|
ClearFlag(flag[Flag])DescriptionClears a flag on the nodal rigid body. |
Flag to clear on the nodal rigid body
ReturnsNo return value |
ExampleTo clear flag f for nodal rigid body nrb: nrb.ClearFlag(f);
|
Copy(range (optional)[boolean])DescriptionCopies the nodal rigid body. The target include of the copied nodal rigid body 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().
ReturnsNodalRigidBody object Return typeNodalRigidBody |
ExampleTo copy nodal rigid body nrb into nodal rigid body z: var z = nrb.Copy();
|
Create(Model[Model], modal (optional)[boolean]) [static]DescriptionStarts an interactive editing panel to create a nodal rigid body |
Model that the nodal rigid body 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.
ReturnsNodalRigidBody object (or null if not made). Return typeNodalRigidBody |
ExampleTo start creating a nodal rigid body in model m: var nrb = NodalRigidBody.Create(m);
|
DetachComment(Comment[Comment])DescriptionDetaches a comment from a nodal rigid body. |
Comment that will be detached from the nodal rigid body
ReturnsNo return value |
ExampleTo detach comment c from the nodal rigid body nrb: nrb.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 nodal rigid body nrb: nrb.Edit();
|
Error(message[string], details (optional)[string])DescriptionAdds an error for nodal rigid body. 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 nodal rigid body nrb: nrb.Error("My custom error");
|
ExtractColour()DescriptionExtracts the actual colour used for nodal rigid body. |
No arguments
Returnscolour value (integer) Return typeNumber |
ExampleTo return the colour used for drawing nodal rigid body nrb: var colour = nrb.ExtractColour();
|
First(Model[Model]) [static]DescriptionReturns the first nodal rigid body in the model. |
Model to get first nodal rigid body in
ReturnsNodalRigidBody object (or null if there are no nodal rigid bodies in the model). Return typeNodalRigidBody |
ExampleTo get the first nodal rigid body in model m: var nrb = NodalRigidBody.First(m);
|
FirstFreeLabel(Model[Model], layer (optional)[Include number]) [static]DescriptionReturns the first free nodal rigid body label in the model. Also see NodalRigidBody.LastFreeLabel(), NodalRigidBody.NextFreeLabel() and Model.FirstFreeItemLabel(). |
Model to get first free nodal rigid body 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).
ReturnsNodalRigidBody label. Return typeNumber |
ExampleTo get the first free nodal rigid body label in model m: var label = NodalRigidBody.FirstFreeLabel(m);
|
FlagAll(Model[Model], flag[Flag]) [static]DescriptionFlags all of the nodal rigid bodies in the model with a defined flag. |
Model that all nodal rigid bodies will be flagged in
Flag to set on the nodal rigid bodies
ReturnsNo return value |
ExampleTo flag all of the nodal rigid bodies with flag f in model m: NodalRigidBody.FlagAll(m, f);
|
Flagged(flag[Flag])DescriptionChecks if the nodal rigid body is flagged or not. |
Flag to test on the nodal rigid body
Returnstrue if flagged, false if not. Return typeBoolean |
ExampleTo check if nodal rigid body nrb has flag f set on it: if (nrb.Flagged(f) ) do_something...
|
ForEach(Model[Model], func[function], extra (optional)[any]) [static]DescriptionCalls a function for each nodal rigid body in the model. |
Model that all nodal rigid bodies are in
Function to call for each nodal rigid body
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 NodalRigidBody objects or properties for all of the nodal rigid bodies in a model in PRIMER. If the optional property argument is not given then an array of NodalRigidBody objects is returned. If the property argument is given, that property value for each nodal rigid body is returned in the array instead of a NodalRigidBody object |
Model to get nodal rigid bodies from
Name for property to get for all nodal rigid bodies in the model
ReturnsArray of NodalRigidBody objects or properties Return typeArray |
GetComments()DescriptionExtracts the comments associated to a nodal rigid body. |
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 nodal rigid body nrb: var comm_array = nrb.GetComments();
|
GetFlagged(Model[Model], flag[Flag], property (optional)[string]) [static]DescriptionReturns an array of NodalRigidBody objects for all of the flagged nodal rigid bodies in a model in PRIMER If the optional property argument is not given then an array of NodalRigidBody objects is returned. If the property argument is given, then that property value for each nodal rigid body is returned in the array instead of a NodalRigidBody object |
Model to get nodal rigid bodies from
Flag set on the nodal rigid bodies that you want to retrieve
Name for property to get for all flagged nodal rigid bodies in the model
ReturnsArray of NodalRigidBody objects or properties Return typeArray |
GetFromID(Model[Model], number[integer]) [static]DescriptionReturns the NodalRigidBody object for a nodal rigid body ID. |
Model to find the nodal rigid body in
number of the nodal rigid body you want the NodalRigidBody object for
ReturnsNodalRigidBody object (or null if nodal rigid body does not exist). Return typeNodalRigidBody |
ExampleTo get the NodalRigidBody object for nodal rigid body 100 in model m var nrb = NodalRigidBody.GetFromID(m, 100);
|
GetParameter(prop[string])DescriptionChecks if a NodalRigidBody 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 NodalRigidBody.ViewParameters() method and 'method chaining' (see the examples below). |
nodal rigid body property to get parameter for
ReturnsParameter object if property is a parameter, null if not. Return typeParameter |
Keyword()DescriptionReturns the keyword for this nrb (*CONSTRAINED_NODAL_RIGID_BODY_xxxx). Note that a carriage return is not added. See also NodalRigidBody.KeywordCards() |
No arguments
Returnsstring containing the keyword. Return typeString |
ExampleTo get the keyword for nrb n: var key = n.Keyword();
|
KeywordCards()DescriptionReturns the keyword cards for the nrb. Note that a carriage return is not added. See also NodalRigidBody.Keyword() |
No arguments
Returnsstring containing the cards. Return typeString |
ExampleTo get the cards for nrb n: var cards = n.KeywordCards();
|
Last(Model[Model]) [static]DescriptionReturns the last nodal rigid body in the model. |
Model to get last nodal rigid body in
ReturnsNodalRigidBody object (or null if there are no nodal rigid bodies in the model). Return typeNodalRigidBody |
ExampleTo get the last nodal rigid body in model m: var nrb = NodalRigidBody.Last(m);
|
LastFreeLabel(Model[Model], layer (optional)[Include number]) [static]DescriptionReturns the last free nodal rigid body label in the model. Also see NodalRigidBody.FirstFreeLabel(), NodalRigidBody.NextFreeLabel() and see Model.LastFreeItemLabel() |
Model to get last free nodal rigid body 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.
ReturnsNodalRigidBody label. Return typeNumber |
ExampleTo get the last free nodal rigid body label in model m: var label = NodalRigidBody.LastFreeLabel(m);
|
Next()DescriptionReturns the next nodal rigid body in the model. |
No arguments
ReturnsNodalRigidBody object (or null if there are no more nodal rigid bodies in the model). Return typeNodalRigidBody |
ExampleTo get the nodal rigid body in model m after nodal rigid body nrb: var nrb = nrb.Next();
|
NextFreeLabel(Model[Model], layer (optional)[Include number]) [static]DescriptionReturns the next free (highest+1) nodal rigid body label in the model. Also see NodalRigidBody.FirstFreeLabel(), NodalRigidBody.LastFreeLabel() and Model.NextFreeItemLabel() |
Model to get next free nodal rigid body 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).
ReturnsNodalRigidBody label. Return typeNumber |
ExampleTo get the next free nodal rigid body label in model m: var label = NodalRigidBody.NextFreeLabel(m);
|
Pick(prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean], button text (optional)[string]) [static]DescriptionAllows the user to pick a nodal rigid body. |
Text to display as a prompt to the user
If the argument is a Model then only nodal rigid bodies from that model can be picked. If the argument is a Flag then only nodal rigid bodies that are flagged with limit can be selected. If omitted, or null, any nodal rigid bodies 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.
ReturnsNodalRigidBody object (or null if not picked) Return typeNodalRigidBody |
ExampleTo pick a nodal rigid body from model m giving the prompt 'Pick nodal rigid body from screen': var nrb = NodalRigidBody.Pick('Pick nodal rigid body from screen', m);
|
Previous()DescriptionReturns the previous nodal rigid body in the model. |
No arguments
ReturnsNodalRigidBody object (or null if there are no more nodal rigid bodies in the model). Return typeNodalRigidBody |
ExampleTo get the nodal rigid body in model m before nodal rigid body nrb: var nrb = nrb.Previous();
|
RenumberAll(Model[Model], start[integer]) [static]DescriptionRenumbers all of the nodal rigid bodies in the model. |
Model that all nodal rigid bodies will be renumbered in
Start point for renumbering
ReturnsNo return value |
ExampleTo renumber all of the nodal rigid bodies in model m, from 1000000: NodalRigidBody.RenumberAll(m, 1000000);
|
RenumberFlagged(Model[Model], flag[Flag], start[integer]) [static]DescriptionRenumbers all of the flagged nodal rigid bodies in the model. |
Model that all the flagged nodal rigid bodies will be renumbered in
Flag set on the nodal rigid bodies that you want to renumber
Start point for renumbering
ReturnsNo return value |
ExampleTo renumber all of the nodal rigid bodies in model m flagged with f, from 1000000: NodalRigidBody.RenumberFlagged(m, f, 1000000);
|
Select(flag[Flag], prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean]) [static]DescriptionAllows the user to select nodal rigid bodies using standard PRIMER object menus. |
Flag to use when selecting nodal rigid bodies
Text to display as a prompt to the user
If the argument is a Model then only nodal rigid bodies from that model can be selected. If the argument is a Flag then only nodal rigid bodies that are flagged with limit can be selected (limit should be different to flag). If omitted, or null, any nodal rigid bodies 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 nodal rigid bodies selected or null if menu cancelled Return typeNumber |
SetFlag(flag[Flag])DescriptionSets a flag on the nodal rigid body. |
Flag to set on the nodal rigid body
ReturnsNo return value |
ExampleTo set flag f for nodal rigid body nrb: nrb.SetFlag(f);
|
Sketch(redraw (optional)[boolean])DescriptionSketches the nodal rigid body. The nodal rigid body will be sketched until you either call NodalRigidBody.Unsketch(), NodalRigidBody.UnsketchAll(), Model.UnsketchAll(), or delete the model |
If model should be redrawn or not after the nodal rigid body is sketched. If omitted redraw is true. If you want to sketch several nodal rigid bodies and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo sketch nodal rigid body nrb: nrb.Sketch();
|
SketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionSketches all of the flagged nodal rigid bodies in the model. The nodal rigid bodies will be sketched until you either call NodalRigidBody.Unsketch(), NodalRigidBody.UnsketchFlagged(), Model.UnsketchAll(), or delete the model |
Model that all the flagged nodal rigid bodies will be sketched in
Flag set on the nodal rigid bodies that you want to sketch
If model should be redrawn or not after the nodal rigid bodies are sketched. If omitted redraw is true. If you want to sketch flagged nodal rigid bodies several times and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo sketch all nodal rigid bodies flagged with flag in model m: NodalRigidBody.SketchFlagged(m, flag);
|
Total(Model[Model], exists (optional)[boolean]) [static]DescriptionReturns the total number of nodal rigid bodies in the model. |
Model to get total for
true if only existing nodal rigid bodies should be counted. If false or omitted referenced but undefined nodal rigid bodies will also be included in the total.
Returnsnumber of nodal rigid bodies Return typeNumber |
ExampleTo get the total number of nodal rigid bodies in model m: var total = NodalRigidBody.Total(m);
|
Unblank()DescriptionUnblanks the nodal rigid body |
No arguments
ReturnsNo return value |
ExampleTo unblank nodal rigid body nrb: nrb.Unblank();
|
UnblankAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionUnblanks all of the nodal rigid bodies in the model. |
Model that all nodal rigid bodies 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 nodal rigid bodies in model m: NodalRigidBody.UnblankAll(m);
|
UnblankFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionUnblanks all of the flagged nodal rigid bodies in the model. |
Model that the flagged nodal rigid bodies will be unblanked in
Flag set on the nodal rigid bodies 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 nodal rigid bodies in model m flagged with f: NodalRigidBody.UnblankFlagged(m, f);
|
UnflagAll(Model[Model], flag[Flag]) [static]DescriptionUnsets a defined flag on all of the nodal rigid bodies in the model. |
Model that the defined flag for all nodal rigid bodies will be unset in
Flag to unset on the nodal rigid bodies
ReturnsNo return value |
ExampleTo unset the flag f on all the nodal rigid bodies in model m: NodalRigidBody.UnflagAll(m, f);
|
Unsketch(redraw (optional)[boolean])DescriptionUnsketches the nodal rigid body. |
If model should be redrawn or not after the nodal rigid body is unsketched. If omitted redraw is true. If you want to unsketch several nodal rigid bodies and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo unsketch nodal rigid body nrb: nrb.Unsketch();
|
UnsketchAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionUnsketches all nodal rigid bodies. |
Model that all nodal rigid bodies will be unblanked in
If model should be redrawn or not after the nodal rigid bodies 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 nodal rigid bodies in model m: NodalRigidBody.UnsketchAll(m);
|
UnsketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionUnsketches all flagged nodal rigid bodies in the model. |
Model that all nodal rigid bodies will be unsketched in
Flag set on the nodal rigid bodies that you want to unsketch
If model should be redrawn or not after the nodal rigid bodies 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 nodal rigid bodies flagged with flag in model m: NodalRigidBody.UnsketchAll(m, flag);
|
No arguments
ReturnsNodalRigidBody object. Return typeNodalRigidBody |
ExampleTo check if NodalRigidBody property nrb.example is a parameter by using the NodalRigidBody.GetParameter() method: if (nrb.ViewParameters().GetParameter(nrb.example) ) do_something...
|
Warning(message[string], details (optional)[string])DescriptionAdds a warning for nodal rigid body. 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 nodal rigid body nrb: nrb.Warning("My custom warning");
|
Xrefs()DescriptionReturns the cross references for this nodal rigid body. |
No arguments
ReturnsXrefs object. Return typeXrefs |
ExampleTo get the cross references for nodal rigid body nrb: var xrefs = nrb.Xrefs();
|
toString()DescriptionCreates a string containing the nrb data in keyword format. Note that this contains the keyword header and the keyword cards. See also NodalRigidBody.Keyword() and NodalRigidBody.KeywordCards(). |
No arguments
Returnsstring Return typeString |
ExampleTo get data for nrb n in keyword format var s = n.toString();
|