The NodeSet class gives you access to constrained node set cards in PRIMER, not set node cards. For access to set node cards, refer to the Set class. 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 |
| cnsid | integer | Constrained node set number (identical to label). |
| colour | Colour | The colour of the node set |
| dof | integer | Degree of freedom. |
| exists (read only) | logical | true if node set exists, false if referred to but not defined. |
| id | logical | true if _ID option is set, false if not |
| include | integer | The Include file number that the node set is in. |
| label | integer | Constrained node set number. |
| model (read only) | integer | The Model number that the node set is in. |
| nsid | integer | Set Node ID. |
| tf | real | Failure time. |
Detailed DescriptionThe NodeSet class allows you to create, modify, edit and manipulate constrained node set cards. See the documentation below for more details. |
Constructornew NodeSet(Model[Model], nsid[integer], dof[integer], tf[real], label (optional)[integer])DescriptionCreate a new NodeSet object. |
Model that constrained node set will be created in
Set Node ID.
Degree of freedom.
Failure time.
Constrained node set number.
ReturnsNodeSet object Return typeNodeSet |
ExampleTo create a new constrained node set 500 in model m, of type SET, with node set 9, degree of freedom 1 and failure time 1000 var n = new NodeSet(m, 9, 1, 1000, 500);
|
Details of functionsAssociateComment(Comment[Comment])DescriptionAssociates a comment with a node set. |
Comment that will be attached to the node set
ReturnsNo return value |
ExampleTo associate comment c to the node set ns: ns.AssociateComment(c);
|
Blank()DescriptionBlanks the node set |
No arguments
ReturnsNo return value |
ExampleTo blank node set ns: ns.Blank();
|
BlankAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionBlanks all of the node sets in the model. |
Model that all node sets 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 node sets in model m: NodeSet.BlankAll(m);
|
BlankFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionBlanks all of the flagged node sets in the model. |
Model that all the flagged node sets will be blanked in
Flag set on the node sets 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 node sets in model m flagged with f: NodeSet.BlankFlagged(m, f);
|
Blanked()DescriptionChecks if the node set is blanked or not. |
No arguments
Returnstrue if blanked, false if not. Return typeBoolean |
ExampleTo check if node set ns is blanked: if (ns.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 node set ns: ns.Browse();
|
ClearFlag(flag[Flag])DescriptionClears a flag on the node set. |
Flag to clear on the node set
ReturnsNo return value |
ExampleTo clear flag f for node set ns: ns.ClearFlag(f);
|
Copy(range (optional)[boolean])DescriptionCopies the node set. The target include of the copied node set 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().
ReturnsNodeSet object Return typeNodeSet |
ExampleTo copy node set ns into node set z: var z = ns.Copy();
|
Create(Model[Model], modal (optional)[boolean]) [static]DescriptionStarts an interactive editing panel to create a node set |
Model that the node set 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.
ReturnsNodeSet object (or null if not made). Return typeNodeSet |
ExampleTo start creating a node set in model m: var ns = NodeSet.Create(m);
|
DetachComment(Comment[Comment])DescriptionDetaches a comment from a node set. |
Comment that will be detached from the node set
ReturnsNo return value |
ExampleTo detach comment c from the node set ns: ns.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 node set ns: ns.Edit();
|
Error(message[string], details (optional)[string])DescriptionAdds an error for node set. 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 node set ns: ns.Error("My custom error");
|
ExtractColour()DescriptionExtracts the actual colour used for node set. |
No arguments
Returnscolour value (integer) Return typeNumber |
ExampleTo return the colour used for drawing node set ns: var colour = ns.ExtractColour();
|
First(Model[Model]) [static]DescriptionReturns the first node set in the model. |
Model to get first node set in
ReturnsNodeSet object (or null if there are no node sets in the model). Return typeNodeSet |
ExampleTo get the first node set in model m: var ns = NodeSet.First(m);
|
FirstFreeLabel(Model[Model], layer (optional)[Include number]) [static]DescriptionReturns the first free node set label in the model. Also see NodeSet.LastFreeLabel(), NodeSet.NextFreeLabel() and Model.FirstFreeItemLabel(). |
Model to get first free node set 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).
ReturnsNodeSet label. Return typeNumber |
ExampleTo get the first free node set label in model m: var label = NodeSet.FirstFreeLabel(m);
|
FlagAll(Model[Model], flag[Flag]) [static]DescriptionFlags all of the node sets in the model with a defined flag. |
Model that all node sets will be flagged in
Flag to set on the node sets
ReturnsNo return value |
ExampleTo flag all of the node sets with flag f in model m: NodeSet.FlagAll(m, f);
|
Flagged(flag[Flag])DescriptionChecks if the node set is flagged or not. |
Flag to test on the node set
Returnstrue if flagged, false if not. Return typeBoolean |
ExampleTo check if node set ns has flag f set on it: if (ns.Flagged(f) ) do_something...
|
ForEach(Model[Model], func[function], extra (optional)[any]) [static]DescriptionCalls a function for each node set in the model. |
Model that all node sets are in
Function to call for each node set
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 NodeSet objects or properties for all of the node sets in a model in PRIMER. If the optional property argument is not given then an array of NodeSet objects is returned. If the property argument is given, that property value for each node set is returned in the array instead of a NodeSet object |
Model to get node sets from
Name for property to get for all node sets in the model
ReturnsArray of NodeSet objects or properties Return typeArray |
GetComments()DescriptionExtracts the comments associated to a node set. |
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 node set ns: var comm_array = ns.GetComments();
|
GetFlagged(Model[Model], flag[Flag], property (optional)[string]) [static]DescriptionReturns an array of NodeSet objects for all of the flagged node sets in a model in PRIMER If the optional property argument is not given then an array of NodeSet objects is returned. If the property argument is given, then that property value for each node set is returned in the array instead of a NodeSet object |
Model to get node sets from
Flag set on the node sets that you want to retrieve
Name for property to get for all flagged node sets in the model
ReturnsArray of NodeSet objects or properties Return typeArray |
GetFromID(Model[Model], number[integer]) [static]DescriptionReturns the NodeSet object for a node set ID. |
Model to find the node set in
number of the node set you want the NodeSet object for
ReturnsNodeSet object (or null if node set does not exist). Return typeNodeSet |
ExampleTo get the NodeSet object for node set 100 in model m var ns = NodeSet.GetFromID(m, 100);
|
GetParameter(prop[string])DescriptionChecks if a NodeSet 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 NodeSet.ViewParameters() method and 'method chaining' (see the examples below). |
node set property to get parameter for
ReturnsParameter object if property is a parameter, null if not. Return typeParameter |
Keyword()DescriptionReturns the keyword for this node_set (*CONSTRAINED_NODE_SET). Note that a carriage return is not added. See also NodeSet.KeywordCards() |
No arguments
Returnsstring containing the keyword. Return typeString |
ExampleTo get the keyword for node_set n: var key = n.Keyword();
|
KeywordCards()DescriptionReturns the keyword cards for the node_set. Note that a carriage return is not added. See also NodeSet.Keyword() |
No arguments
Returnsstring containing the cards. Return typeString |
ExampleTo get the cards for node_set n: var cards = n.KeywordCards();
|
Last(Model[Model]) [static]DescriptionReturns the last node set in the model. |
Model to get last node set in
ReturnsNodeSet object (or null if there are no node sets in the model). Return typeNodeSet |
ExampleTo get the last node set in model m: var ns = NodeSet.Last(m);
|
LastFreeLabel(Model[Model], layer (optional)[Include number]) [static]DescriptionReturns the last free node set label in the model. Also see NodeSet.FirstFreeLabel(), NodeSet.NextFreeLabel() and see Model.LastFreeItemLabel() |
Model to get last free node set 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.
ReturnsNodeSet label. Return typeNumber |
ExampleTo get the last free node set label in model m: var label = NodeSet.LastFreeLabel(m);
|
Next()DescriptionReturns the next node set in the model. |
No arguments
ReturnsNodeSet object (or null if there are no more node sets in the model). Return typeNodeSet |
ExampleTo get the node set in model m after node set ns: var ns = ns.Next();
|
NextFreeLabel(Model[Model], layer (optional)[Include number]) [static]DescriptionReturns the next free (highest+1) node set label in the model. Also see NodeSet.FirstFreeLabel(), NodeSet.LastFreeLabel() and Model.NextFreeItemLabel() |
Model to get next free node set 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).
ReturnsNodeSet label. Return typeNumber |
ExampleTo get the next free node set label in model m: var label = NodeSet.NextFreeLabel(m);
|
Pick(prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean], button text (optional)[string]) [static]DescriptionAllows the user to pick a node set. |
Text to display as a prompt to the user
If the argument is a Model then only node sets from that model can be picked. If the argument is a Flag then only node sets that are flagged with limit can be selected. If omitted, or null, any node sets 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.
ReturnsNodeSet object (or null if not picked) Return typeNodeSet |
ExampleTo pick a node set from model m giving the prompt 'Pick node set from screen': var ns = NodeSet.Pick('Pick node set from screen', m);
|
Previous()DescriptionReturns the previous node set in the model. |
No arguments
ReturnsNodeSet object (or null if there are no more node sets in the model). Return typeNodeSet |
ExampleTo get the node set in model m before node set ns: var ns = ns.Previous();
|
RenumberAll(Model[Model], start[integer]) [static]DescriptionRenumbers all of the node sets in the model. |
Model that all node sets will be renumbered in
Start point for renumbering
ReturnsNo return value |
ExampleTo renumber all of the node sets in model m, from 1000000: NodeSet.RenumberAll(m, 1000000);
|
RenumberFlagged(Model[Model], flag[Flag], start[integer]) [static]DescriptionRenumbers all of the flagged node sets in the model. |
Model that all the flagged node sets will be renumbered in
Flag set on the node sets that you want to renumber
Start point for renumbering
ReturnsNo return value |
ExampleTo renumber all of the node sets in model m flagged with f, from 1000000: NodeSet.RenumberFlagged(m, f, 1000000);
|
Select(flag[Flag], prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean]) [static]DescriptionAllows the user to select node sets using standard PRIMER object menus. |
Flag to use when selecting node sets
Text to display as a prompt to the user
If the argument is a Model then only node sets from that model can be selected. If the argument is a Flag then only node sets that are flagged with limit can be selected (limit should be different to flag). If omitted, or null, any node sets 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 node sets selected or null if menu cancelled Return typeNumber |
SetFlag(flag[Flag])DescriptionSets a flag on the node set. |
Flag to set on the node set
ReturnsNo return value |
ExampleTo set flag f for node set ns: ns.SetFlag(f);
|
Sketch(redraw (optional)[boolean])DescriptionSketches the node set. The node set will be sketched until you either call NodeSet.Unsketch(), NodeSet.UnsketchAll(), Model.UnsketchAll(), or delete the model |
If model should be redrawn or not after the node set is sketched. If omitted redraw is true. If you want to sketch several node sets and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo sketch node set ns: ns.Sketch();
|
SketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionSketches all of the flagged node sets in the model. The node sets will be sketched until you either call NodeSet.Unsketch(), NodeSet.UnsketchFlagged(), Model.UnsketchAll(), or delete the model |
Model that all the flagged node sets will be sketched in
Flag set on the node sets that you want to sketch
If model should be redrawn or not after the node sets are sketched. If omitted redraw is true. If you want to sketch flagged node sets several times and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo sketch all node sets flagged with flag in model m: NodeSet.SketchFlagged(m, flag);
|
Total(Model[Model], exists (optional)[boolean]) [static]DescriptionReturns the total number of node sets in the model. |
Model to get total for
true if only existing node sets should be counted. If false or omitted referenced but undefined node sets will also be included in the total.
Returnsnumber of node sets Return typeNumber |
ExampleTo get the total number of node sets in model m: var total = NodeSet.Total(m);
|
Unblank()DescriptionUnblanks the node set |
No arguments
ReturnsNo return value |
ExampleTo unblank node set ns: ns.Unblank();
|
UnblankAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionUnblanks all of the node sets in the model. |
Model that all node sets 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 node sets in model m: NodeSet.UnblankAll(m);
|
UnblankFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionUnblanks all of the flagged node sets in the model. |
Model that the flagged node sets will be unblanked in
Flag set on the node sets 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 node sets in model m flagged with f: NodeSet.UnblankFlagged(m, f);
|
UnflagAll(Model[Model], flag[Flag]) [static]DescriptionUnsets a defined flag on all of the node sets in the model. |
Model that the defined flag for all node sets will be unset in
Flag to unset on the node sets
ReturnsNo return value |
ExampleTo unset the flag f on all the node sets in model m: NodeSet.UnflagAll(m, f);
|
Unsketch(redraw (optional)[boolean])DescriptionUnsketches the node set. |
If model should be redrawn or not after the node set is unsketched. If omitted redraw is true. If you want to unsketch several node sets and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo unsketch node set ns: ns.Unsketch();
|
UnsketchAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionUnsketches all node sets. |
Model that all node sets will be unblanked in
If model should be redrawn or not after the node sets 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 node sets in model m: NodeSet.UnsketchAll(m);
|
UnsketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionUnsketches all flagged node sets in the model. |
Model that all node sets will be unsketched in
Flag set on the node sets that you want to unsketch
If model should be redrawn or not after the node sets 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 node sets flagged with flag in model m: NodeSet.UnsketchAll(m, flag);
|
No arguments
ReturnsNodeSet object. Return typeNodeSet |
ExampleTo check if NodeSet property ns.example is a parameter by using the NodeSet.GetParameter() method: if (ns.ViewParameters().GetParameter(ns.example) ) do_something...
|
Warning(message[string], details (optional)[string])DescriptionAdds a warning for node set. 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 node set ns: ns.Warning("My custom warning");
|
Xrefs()DescriptionReturns the cross references for this node set. |
No arguments
ReturnsXrefs object. Return typeXrefs |
ExampleTo get the cross references for node set ns: var xrefs = ns.Xrefs();
|
toString()DescriptionCreates a string containing the node_set data in keyword format. Note that this contains the keyword header and the keyword cards. See also NodeSet.Keyword() and NodeSet.KeywordCards(). |
No arguments
Returnsstring Return typeString |
ExampleTo get data for node set n in keyword format var s = n.toString();
|