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