The Set class gives you access to sets 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 |
| Set.2D_SEGMENT | This constant is deprecated in version 11.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions. Please use Set.SEGMENT_2D instead. [deprecated] |
| Set.ADD | Set type is *SET_XYZ_ADD. |
| Set.ALL_TYPES | All set types - used in blanking etc. |
| Set.BEAM | Set beam type |
| Set.BOX | Set box type |
| Set.DISCRETE | Set discrete type |
| Set.GENERAL | Set type is *SET_XYZ_GENERAL. |
| Set.GENERATE | Set type is *SET_XYZ_GENERATE. |
| Set.IGA_EDGE | Set IGA edge uvw/xyz type |
| Set.IGA_FACE | Set IGA face uvw/xyz type |
| Set.IGA_POINT_UVW | Set IGA point uvw type |
| Set.IGA_UVW | Set UVW option for *SET_IGA_EDGE and *SET_IGA_FACE. |
| Set.IGA_XYZ | Set XYZ option for *SET_IGA_EDGE and *SET_IGA_FACE. |
| Set.INTERSECT | Set type is *SET_XYZ_INTERSECT. |
| Set.MM_GROUP | Set multi-material group type |
| Set.MODE | Set mode type |
| Set.NODE | Set node type |
| Set.PART | Set part type |
| Set.PART_TREE | Set part tree type |
| Set.PERI_LAMINATE | Set Peri Laminate type |
| Set.SEGMENT | Set segment type |
| Set.SEGMENT_2D | Set segment 2d type |
| Set.SHELL | Set shell type |
| Set.SOLID | Set solid type |
| Set.TSHELL | Set thick shell type |
| Name | Type | Description |
| add | logical | If _ADD option is active. |
| advanced (read only) | logical | If _ADD_ADVANCED option is active. |
| collect | logical | If _COLLECT option is active. To manage _COLLECT sets PRIMER creates a 'parent' set that can be used to sketch/view all of the items from the _COLLECT sets with the same label. PRIMER then manages each _COLLECT set with the same label as a 'child' of this 'parent' set. Also see collect_children and GetCollectChild. If the collect property is unset for a child collect set then a new label will be assigned for the child set. If the collect property is unset for a parent collect set then all of the child sets will be reassigned new labels. |
| collect_children (read only) | integer | The number of child _COLLECT sets if _COLLECT option is active. |
| colour | Colour | The colour of the set |
| column (read only) | logical | If _COLUMN option is active. |
| da1 | real | The first default attribute for the set (only valid for Set.IGA_EDGE, Set.IGA_FACE, Set.IGA_POINT_UVW, Set.NODE, Set.PART, Set.SEGMENT, Set.SEGMENT_2D and Set.SHELL) |
| da2 | real | The second default attribute for the set (only valid for Set.IGA_EDGE, Set.IGA_FACE, Set.IGA_POINT_UVW, Set.NODE, Set.PART, Set.SEGMENT, Set.SEGMENT_2D and Set.SHELL) |
| da3 | real | The third default attribute for the set (only valid for Set.IGA_EDGE, Set.IGA_FACE, Set.IGA_POINT_UVW, Set.NODE, Set.PART, Set.SEGMENT, Set.SEGMENT_2D and Set.SHELL) |
| da4 | real | The fourth default attribute for the set (only valid for Set.IGA_EDGE, Set.IGA_FACE, Set.IGA_POINT_UVW, Set.NODE, Set.PART, Set.SEGMENT, Set.SEGMENT_2D and Set.SHELL) |
| exists (read only) | logical | true if set exists, false if referred to but not defined. |
| general | logical | If _GENERAL option is active. |
| general_lines (read only) | integer | Number of lines of data for _GENERAL set (if _GENERAL option is active). |
| generate | logical | If _GENERATE option is active. |
| iga_opt (read only) | constant | Option for IGA_EGDE and IGA_FACE. Can be Set.IGA_UVW, Set.IGA_XYZ |
| include | integer | The Include file number that the set is in. |
| increment (read only) | logical | If _GENERATE_INCREMENT option is active. |
| intersect | logical | If _INTERSECT option is active. |
| its | integer | Coupling type across different scales in two-scale cosimulation (only valid for Set.SEGMENT or Set.NODE). |
| label | integer | Set number. Also see the sid property which is an alternative name for this. |
| model | integer | The Model number that the set is in. |
| sid | integer | Set number. Also see the label property which is an alternative name for this. |
| smooth (read only) | logical | If _LIST_SMOOTH option is active. |
| solver | string | Solver to attach to set. Can be "MECH", "CESE", "EM", "ICFD" or blank (only valid for Set.IGA_EDGE, Set.IGA_FACE, Set.IGA_POINT_UVW, Set.NODE, Set.PART, Set.SEGMENT and Set.SOLID). |
| title | string | Set title |
| total (read only) | integer | The total number of items in the set. Note that for _GENERAL and _GENERATE sets this is expensive to compute. |
| transparency | integer | The transparency of the set (0-100) 0% is opaque, 100% is transparent. |
| type (read only) | constant | Set type. Can be Set.BEAM, Set.BOX Set.DISCRETE, Set.IGA_EDGE, Set.IGA_FACE, Set.IGA_POINT_UVW, Set.MM_GROUP, Set.MODE, Set.NODE, Set.PART, Set.PART_TREE, Set.PERI_LAMINATE, Set.SEGMENT, Set.SEGMENT_2D, Set.SHELL, Set.SOLID or Set.TSHELL |
Constructornew Set(Model[Model], details[object])DescriptionCreate a new Set object. |
Model that set will be created in
Details for creating the Set
Object has the following properties:
| Name | Type | Description |
| iga_opt (optional) | constant | IGA type. Can be Set.IGA_UVW or Set.IGA_XYZ. Only valid for set types Set.IGA_EDGE and Set.IGA_FACE where it must be given |
| option (optional) | constant | Set type. Can be Set.ADD, Set.INTERSECT, Set.GENERAL or Set.GENERATE |
| sid | integer | Set number |
| title (optional) | string | Title for the set |
| type | constant | Type of set. Can be Set.BEAM, Set.BOX, Set.DISCRETE, Set.IGA_EDGE, Set.IGA_FACE, Set.IGA_POINT_UVW, Set.MM_GROUP, Set.MODE, Set.NODE, Set.PART, Set.PART_TREE, Set.PERI_LAMINATE, Set.SEGMENT, Set.SEGMENT_2D, Set.SHELL, Set.SOLID or Set.TSHELL |
ReturnsSet object Return typeSet |
new Set(Model[Model], sid[integer], type[constant], title (optional)[string], option (optional)[constant]) [deprecated]This function is deprecated in version 22.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions. DescriptionCreate a new Set object. |
Model that set will be created in
Set number
Type of set. Can be Set.BEAM, Set.BOX, Set.DISCRETE, Set.MM_GROUP, Set.MODE, Set.NODE, Set.PART, Set.PART_TREE, Set.PERI_LAMINATE, Set.SEGMENT, Set.SEGMENT_2D, Set.SHELL, Set.SOLID or Set.TSHELL
Title for the set
Set type. Can be Set.ADD, Set.INTERSECT, Set.GENERAL or Set.GENERATE
ReturnsSet object Return typeSet |
ExampleTo create a new node set in model m with label 100: var s = new Set(m, 100, Set.NODE); To create a new *NODE_SET_ADD in model m with label 101: var s = new Set(m, 101, Set.NODE,"", Set.ADD);
|
id of the item to add to the set (normal, _ADD or _ADD_ADVANCED sets) or Start ID (_GENERATE sets)
type of the item to add to the set [1-7] (_ADD_ADVANCED sets) or End ID (_GENERATE sets)
(only for SEGMENT, _GENERATE, _GENERATE_INCREMENT and _ADD_ADVANCED sets)
Increment for _GENERATE_INCREMENT sets, otherwise id of the item to add to the set
(only for SEGMENT and _GENERATE_INCREMENT sets)
id of the item to add to the set
(only for SEGMENT sets)
ReturnsNo return value |
AddCollectChild(set[Set])DescriptionAdds a child collect set to the set. The child set label will be changed to be the same as the parent set and it will become a child. Also see Set.collect_children and Set.GetCollectChild. |
Set to be added as a child collect set.
ReturnsNo return value |
ExampleTo make set ns2 to node set ns: ns.AddCollectChild(ns2);
|
AddFlagged(flag[Flag])DescriptionAdds flagged items to the set. This cannot be used for _GENERAL or _GENERATE sets and cannot be used for segment sets |
Flag for items to add to the set
ReturnsNo return value |
ExampleTo add any nodes flagged with flag f to node set ns: ns.AddFlagged(f);
|
AllItems()DescriptionReturns an array containing all of the items in the set, decomposing any complex set definitions as required to give those items. For Set.SEGMENT sets, each index in the array is an array containing the segment node IDs. For all other set types each index in the array is an item ID |
No arguments
Returnsarray Return typeArray |
ExampleTo get the items in set s: var items = s.AllItems();
|
BlankAll(Model[Model], type (optional)[constant], redraw (optional)[boolean]) [static]DescriptionBlanks all of the sets in the model. |
Model that all sets will be blanked in
Type of sets to blank. Can be Set.BEAM, Set.BOX, Set.DISCRETE, Set.MM_GROUP, Set.NODE, Set.PART, Set.PART_TREE, Set.PERI_LAMINATE, Set.SEGMENT, Set.SEGMENT_2D, Set.SHELL, Set.SOLID or Set.TSHELL. Set.ALL_TYPES. If omitted sets of all types will be blanked.
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 sets in model m: Set.BlankAll(m); To blank all of the node sets in model m: Set.BlankAll(m, Set.NODE);
|
BlankFlagged(Model[Model], flag[Flag], type (optional)[constant], redraw (optional)[boolean]) [static]DescriptionBlanks all of the flagged sets in the model. |
Model that all the flagged sets will be blanked in
Flag set on the sets that you want to blank
Type of sets to blank. Can be Set.BEAM, Set.BOX, Set.DISCRETE, Set.MM_GROUP, Set.NODE, Set.PART, Set.PART_TREE, Set.PERI_LAMINATE, Set.SEGMENT, Set.SEGMENT_2D, Set.SHELL, Set.SOLID or Set.TSHELL. Set.ALL_TYPES. If set, only flagged sets of this type will be blanked. If omitted flagged sets of all types will be blanked.
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 sets in model m flagged with f: Set.BlankFlagged(m, f); To blank all of the node sets in model m flagged with f: Set.BlankFlagged(m, f, Set.NODE);
|
Blanked()DescriptionChecks if the set is blanked or not. |
No arguments
Returnstrue if blanked, false if not. Return typeBoolean |
ExampleTo check if set s is blanked: if (s.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 set s: var s.Browse();
|
ClearFlag(flag[Flag])DescriptionClears a flag on the set. |
Flag to clear on the set
ReturnsNo return value |
ExampleTo clear flag f for set s: s.ClearFlag(f);
|
Contains(id[integer])DescriptionChecks if an item is in the set. This cannot be used for ADD_ADVANCED, _GENERAL or _GENERATE sets and cannot be used for segment sets |
id of the item to check.
Returnstrue if item is in set, false if not Return typeBoolean |
ExampleTo see if node 10 is in node set ns: if (ns.Contains(10) )
{
do something...
}
|
Copy(range (optional)[boolean])DescriptionCopies the set. |
If you want to keep the copied item in the range specified for the current include. To set current include, use Include.MakeCurrentLayer() .
ReturnsSet object Return typeSet |
ExampleTo copy node net ns into node net ns1: var ns1 = ns.Copy();
|
Create(Model[Model], type[constant], modal (optional)[boolean]) [static]DescriptionStarts an interactive editing panel to create a set. |
Model that the set will be created in
Type of the set that you want to create. Can be Set.BEAM, Set.BOX, Set.DISCRETE, Set.IGA_EDGE, Set.IGA_FACE, Set.IGA_POINT_UVW, Set.MM_GROUP, Set.MODE, Set.NODE, Set.PART, Set.PART_TREE, Set.PERI_LAMINATE, Set.SEGMENT, Set.SEGMENT_2D, Set.SHELL, Set.SOLID or Set.TSHELL
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.
ReturnsSet object (or null if not made) Return typeSet |
ExampleTo start creating a node set in model m: var s = Set.Create(m, Set.NODE);
|
Edit(modal (optional)[boolean])DescriptionStarts an interactive editing panel to edit the set. |
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 set s: var s.Edit();
|
Empty()DescriptionRemoves all items from the set. This cannot be used for _GENERATE sets and cannot be used for segment sets |
No arguments
ReturnsNo return value |
ExampleTo remove all nodes from node set ns: ns.Empty(f);
|
Error(message[string], details (optional)[string])DescriptionAdds an error for a 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 set s: s.Error("My custom error");
|
First(Model[Model], type[constant]) [static]DescriptionReturns the first set in the model. |
Model to get first set in
Type of the set. Can be Set.BEAM, Set.BOX, Set.DISCRETE, Set.IGA_EDGE, Set.IGA_FACE, Set.IGA_POINT_UVW, Set.MM_GROUP, Set.MODE, Set.NODE, Set.PART, Set.PART_TREE, Set.PERI_LAMINATE, Set.SEGMENT, Set.SEGMENT_2D, Set.SHELL, Set.SOLID or Set.TSHELL
ReturnsSet object (or null if there are no sets in the model). Return typeSet |
ExampleTo get the first node set in model m: var n = Set.First(m, Set.NODE);
|
FirstFreeLabel(Model[Model], type[constant], layer (optional)[Include number]) [static]DescriptionReturns the first free set label in the model. Also see Set.LastFreeLabel(), Set.NextFreeLabel() and Model.FirstFreeItemLabel(). |
Model to get first free Set label in
Type of the set. Can be Set.BEAM, Set.BOX, Set.DISCRETE, Set.IGA_EDGE, Set.IGA_FACE, Set.IGA_POINT_UVW, Set.MM_GROUP, Set.MODE, Set.NODE, Set.PART, Set.PART_TREE, Set.PERI_LAMINATE, Set.SEGMENT, Set.SEGMENT_2D, Set.SHELL, Set.SOLID or Set.TSHELL
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).
ReturnsSet label. Return typeNumber |
ExampleTo get the first free node set label in model m: var label = Set.FirstFreeLabel(m, Set.NODE);
|
FlagAll(Model[Model], flag[Flag], type (optional)[constant]) [static]DescriptionFlags all of the sets in the model with a defined flag. |
Model that all sets will be flagged in
Flag to set on the sets
Type of the set. Can be Set.BEAM, Set.BOX Set.DISCRETE, Set.IGA_EDGE, Set.IGA_FACE, Set.IGA_POINT_UVW, Set.MM_GROUP, Set.MODE, Set.NODE, Set.PART, Set.PART_TREE, Set.PERI_LAMINATE, Set.SEGMENT, Set.SEGMENT_2D, Set.SHELL, Set.SOLID or Set.TSHELL. If set, only sets of this type will be flagged. If omitted sets of all types will be flagged.
ReturnsNo return value |
ExampleTo flag all of the node sets with flag f in model m: Set.FlagAll(m, f, Set.NODE);
|
Flagged(flag[Flag])DescriptionChecks if the set is flagged or not. |
Flag to clear on the set
Returnstrue if flagged, false if not. Return typeBoolean |
ExampleTo check if set s has flag f set on it: if (s.Flagged(f) ) do_something...
|
GetAll(Model[Model], type[constant]) [static]DescriptionReturns an array of Set objects for all of the sets in a models in PRIMER |
Model to get sets from
Type of the set. Can be Set.BEAM, Set.BOX, Set.DISCRETE, Set.IGA_EDGE, Set.IGA_FACE, Set.IGA_POINT_UVW, Set.MM_GROUP, Set.MODE, Set.NODE, Set.PART, Set.PART_TREE, Set.PERI_LAMINATE, Set.SEGMENT, Set.SEGMENT_2D, Set.SHELL, Set.SOLID or Set.TSHELL
ReturnsArray of Set objects Return typeArray |
ExampleTo make an array of Set objects for all of the node sets in model m var n = Set.GetAll(m, Set.NODE);
|
GetCollectChild(number[Integer])DescriptionReturns a child collect set. Also see Set.collect_children and Set.AddCollectChild. |
The index of the child collect set to return. Note that indices start at 0, not 1
ReturnsSet object Return typeSet |
ExampleTo loop over the child collect sets for set ns: if (ns.collect)
{
for (i=0; i<ns.collect_children; i++)
var child = ns.GetCollectChild(i);
}
|
GetFlagged(Model[Model], flag[Flag], type[constant]) [static]DescriptionReturns an array of Set objects for all of the flagged sets in a models in PRIMER |
Model to get sets from
Flag set on the set that you want to retrieve
Type of the set. Can be Set.BEAM, Set.BOX, Set.DISCRETE, Set.IGA_EDGE, Set.IGA_FACE, Set.IGA_POINT_UVW, Set.MM_GROUP, Set.MODE, Set.NODE, Set.PART, Set.PART_TREE, Set.PERI_LAMINATE, Set.SEGMENT, Set.SEGMENT_2D, Set.SHELL, Set.SOLID or Set.TSHELL
ReturnsArray of Set objects Return typeArray |
ExampleTo make an array of Set objects for all of the node sets in model m flagged with f var n = Set.GetFlagged(m, f, Set.NODE);
|
GetFromID(Model[Model], set number[integer], type[constant]) [static]DescriptionReturns the Set object for a set ID. |
Model to find the set in
number of the set you want the Set object for
Type of the set. Can be Set.BEAM, Set.BOX, Set.DISCRETE, Set.IGA_EDGE, Set.IGA_FACE, Set.IGA_POINT_UVW, Set.MM_GROUP, Set.MODE, Set.NODE, Set.PART, Set.PART_TREE, Set.PERI_LAMINATE, Set.SEGMENT, Set.SEGMENT_2D, Set.SHELL, Set.SOLID or Set.TSHELL
ReturnsSet object (or null if set does not exist). Return typeSet |
ExampleTo get the Set object for node set 100 in model m var n = Set.GetFromID(m, 100, Set.NODE);
|
GetGeneralData(index[Integer])DescriptionReturns a line of data for a GENERAL set. |
The index of the GENERAL data to return. Note that indices start at 0, not 1.
0 <= index < general_lines
ReturnsArray containing data. Return typeArray |
ExampleTo loop over the lines of general data sets for set s: if (s.general)
{
for (i=0; i<s.general_lines; i++)
var data = s.GetGeneralData(i);
}
|
Keyword()DescriptionReturns the keyword for this set (*SET_NODE etc). Note that a carriage return is not added. See also Set.KeywordCards() |
No arguments
Returnsstring containing the keyword. Return typeString |
ExampleTo get the keyword for set s: var key = s.Keyword();
|
KeywordCards()DescriptionReturns the keyword cards for the set. Note that a carriage return is not added. See also Set.Keyword() |
No arguments
Returnsstring containing the cards. Return typeString |
ExampleTo get the cards for set s: var cards = s.KeywordCards();
|
Last(Model[Model], type[constant]) [static]DescriptionReturns the last set in the model. |
Model to get last set in
Type of the set. Can be Set.BEAM, Set.BOX, Set.DISCRETE, Set.IGA_EDGE, Set.IGA_FACE, Set.IGA_POINT_UVW, Set.MM_GROUP, Set.MODE, Set.NODE, Set.PART, Set.PART_TREE, Set.PERI_LAMINATE, Set.SEGMENT, Set.SEGMENT_2D, Set.SHELL, Set.SOLID or Set.TSHELL
ReturnsSet object (or null if there are no sets in the model). Return typeSet |
ExampleTo get the last node set in model m: var n = Set.Last(m, Set.NODE);
|
LastFreeLabel(Model[Model], type[constant], layer (optional)[Include number]) [static]DescriptionReturns the last free set label in the model. Also see Set.FirstFreeLabel(), Set.NextFreeLabel() and Model.LastFreeItemLabel(). |
Model to get last free Set label in
Type of the set. Can be Set.BEAM, Set.BOX, Set.DISCRETE, Set.IGA_EDGE, Set.IGA_FACE, Set.IGA_POINT_UVW, Set.MM_GROUP, Set.MODE, Set.NODE, Set.PART, Set.PART_TREE, Set.PERI_LAMINATE, Set.SEGMENT, Set.SEGMENT_2D, Set.SHELL, Set.SOLID or Set.TSHELL
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.
ReturnsSet label. Return typeNumber |
ExampleTo get the last free node set label in model m: var label = Set.LastFreeLabel(m, Set.NODE);
|
Next()DescriptionReturns the next set in the model. |
No arguments
ReturnsSet object (or null if there are no more sets in the model). Return typeSet |
ExampleTo get the set in model m after set n: var n = n.Next();
|
NextFreeLabel(Model[Model], type[constant], layer (optional)[Include number]) [static]DescriptionReturns the next free set label in the model. Also see Set.FirstFreeLabel(), Set.LastFreeLabel() and Model.NextFreeItemLabel(). |
Model to get next free Set label in
Type of the set. Can be Set.BEAM, Set.BOX, Set.DISCRETE, Set.IGA_EDGE, Set.IGA_FACE, Set.IGA_POINT_UVW, Set.MM_GROUP, Set.MODE, Set.NODE, Set.PART, Set.PART_TREE, Set.PERI_LAMINATE, Set.SEGMENT, Set.SEGMENT_2D, Set.SHELL, Set.SOLID or Set.TSHELL
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).
ReturnsSet label. Return typeNumber |
ExampleTo get the next free node set label in model m: var label = Set.NextFreeLabel(m, Set.NODE);
|
Pick(type[constant], prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean], button text (optional)[string]) [static]DescriptionAllows the user to pick a set. |
Type of sets to pick. Can be Set.BEAM, Set.BOX, Set.DISCRETE, Set.MM_GROUP, Set.NODE, Set.PART, Set.PART_TREE, Set.PERI_LAMINATE, Set.SEGMENT, Set.SEGMENT_2D, Set.SHELL, Set.SOLID or Set.TSHELL.
Text to display as a prompt to the user
If the argument is a Model then only sets from that model can be picked. If the argument is a Flag then only sets that are flagged with limit can be selected. If omitted, or null, any 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.
ReturnsSet object (or null if not picked) Return typeSet |
ExampleTo pick a node set from model m giving the prompt 'Pick set from screen': var n = Set.Pick(Set.NODE, 'Pick set from screen', m);
|
Previous()DescriptionReturns the previous set in the model. |
No arguments
ReturnsSet object (or null if there are no more sets in the model). Return typeSet |
ExampleTo get the set in model m before this one: var s = s.Previous();
|
No arguments
ReturnsNo return type Return typenull |
ExampleTo rebuild the cache for set s: s.RebuildCache();
|
id of the item to remove from the set.
ReturnsNo return value |
ExampleTo remove node 10 from node set ns: ns.Remove(10);
|
RemoveFlagged(flag[Flag])DescriptionRemoves flagged items from the set. This cannot be used for _GENERAL or _GENERATE sets and cannot be used for segment sets |
Flag for items to remove from the set
ReturnsNo return value |
ExampleTo remove any nodes flagged with flag f from node set ns: ns.RemoveFlagged(f);
|
RemoveGeneralData(index[Integer])DescriptionRemoves a line of data from a GENERAL set. |
The index of the GENERAL data to remove. Note that indices start at 0, not 1.
0 <= index < general_lines
ReturnsNo return value |
ExampleTo remove the first line of general data sets for set s: if (s.general)
{
s.RemoveGeneralData(0);
}
|
RenumberAll(Model[Model], start[integer], type (optional)[constant]) [static]DescriptionRenumbers all of the sets in the model. |
Model that all sets will be renumbered in
Start point for renumbering
Type of sets to renumber. Can be Set.BEAM, Set.BOX Set.DISCRETE, Set.IGA_EDGE, Set.IGA_FACE, Set.IGA_POINT_UVW, Set.MM_GROUP, Set.MODE, Set.NODE, Set.PART, Set.PART_TREE, Set.PERI_LAMINATE, Set.SEGMENT, Set.SEGMENT_2D, Set.SHELL, Set.SOLID or Set.TSHELL. If omitted sets of all types will be blanked.
ReturnsNo return value |
ExampleTo renumber all of the sets in model m, from 1000000: Set.RenumberAll(m, 1000000); To renumber all of the node sets in model m, from 1000000: Set.RenumberAll(m, 1000000, Set.NODE);
|
RenumberFlagged(Model[Model], flag[Flag], start[integer], type (optional)[constant]) [static]DescriptionRenumbers all of the flagged sets in the model. |
Model that all the flagged sets will be renumbered in
Flag set on the sets that you want to renumber
Start point for renumbering
Type of sets to renumber. Can be Set.BEAM, Set.BOX Set.DISCRETE, Set.IGA_EDGE, Set.IGA_FACE, Set.IGA_POINT_UVW, Set.MM_GROUP, Set.MODE, Set.NODE, Set.PART, Set.PART_TREE, Set.PERI_LAMINATE, Set.SEGMENT, Set.SEGMENT_2D, Set.SHELL, Set.SOLID or Set.TSHELL. If omitted sets of all types will be blanked.
ReturnsNo return value |
Select(type[constant], flag[Flag], prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean]) [static]DescriptionAllows the user to select sets using standard PRIMER object menus. |
Type of sets to pick. Can be Set.BEAM, Set.BOX Set.DISCRETE, Set.IGA_EDGE, Set.IGA_FACE, Set.IGA_POINT_UVW, Set.MM_GROUP, Set.MODE, Set.NODE, Set.PART, Set.PART_TREE, Set.PERI_LAMINATE, Set.SEGMENT, Set.SEGMENT_2D, Set.SHELL, Set.SOLID or Set.TSHELL.
Flag to use when selecting sets
Text to display as a prompt to the user
If the argument is a Model then only sets from that model can be selected. If the argument is a Flag then only sets that are flagged with limit can be selected (limit should be different to flag). If omitted, or null, any sets from any model can be selected.
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 items selected or null if menu cancelled Return typeNumber |
ExampleTo select node sets from model m, flagging those selected with flag f, giving the prompt 'Select sets': Set.Select(Set.NODE, f, 'Select sets', m);
|
SetFlag(flag[Flag])DescriptionSets a flag on the set. |
Flag to set on the set
ReturnsNo return value |
ExampleTo set flag f for set s: s.SetFlag(f);
|
SetGeneralData(index[Integer], data[Array of data])DescriptionSets a line of data for a GENERAL set. |
The index of the GENERAL data to set. Note that indices start at 0, not 1.
0 <= index <= general_lines
Array containing GENERAL data to set.
ReturnsNo return value. |
ExampleTo add nodes inside boxes 1, 2 and 3 as a new line of data to node general set s: var data = [ "BOX", 1, 2, 3]; s.SetGeneralData(s.general_lines, data);
|
Sketch(redraw (optional)[boolean])DescriptionSketches the set. The set will be sketched until you either call Set.Unsketch(), Set.UnsketchAll(), Model.UnsketchAll(), or delete the model |
If model should be redrawn or not after the set is sketched. If omitted redraw is true. If you want to sketch several sets and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo sketch set s: s.Sketch();
|
SketchFlagged(Model[Model], flag[Flag], type (optional)[constant], redraw (optional)[boolean]) [static]DescriptionSketches all of the flagged sets in the model. |
Model that all the flagged sets will be sketched in
Flag set on the sets that you want to sketch
Type of sets to sketch. Can be Set.BEAM, Set.BOX Set.DISCRETE, Set.MM_GROUP, Set.NODE, Set.PART, Set.PART_TREE, Set.PERI_LAMINATE, Set.SEGMENT, Set.SEGMENT_2D, Set.SHELL, Set.SOLID or Set.TSHELL. Set.ALL_TYPES. If set, only flagged sets of this type will be sketched. If omitted flagged sets of all types will be sketched.
If model should be redrawn or not. If omitted redraw is true. If you want to do several (un)sketches 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 sketch all of the sets in model m flagged with f: Set.SketchFlagged(m, f); To sketch all of the node sets in model m flagged with f: Set.SketchFlagged(m, f, Set.NODE);
|
Spool()DescriptionSpools a set, entry by entry. See also Set.StartSpool |
No arguments
ReturnsFor Set.SEGMENT returns an array containing node IDs, for all other set types returns the ID of the item. Returns 0 if no more items Return typeArray |
ExampleTo spool set s: var id;
s.StartSpool();
while (id = s.Spool())
{
do something...
}
|
StartSpool(raw (optional)[boolean])DescriptionStarts a set spooling operation. See also Set.Spool |
If true then the raw data from _GENERATE, _ADD and _INTERSECT sets will be returned instead of expanding the data ranges or child set contents. If omitted raw will be false.
ReturnsNo return value |
ExampleTo start spooling set s: s.StartSpool();
|
UnblankAll(Model[Model], type (optional)[constant], redraw (optional)[boolean]) [static]DescriptionUnblanks all of the sets in the model. |
Model that all sets will be unblanked in
Type of sets to unblank. Can be Set.BEAM, Set.BOX Set.DISCRETE, Set.MM_GROUP, Set.NODE, Set.PART, Set.PART_TREE, Set.PERI_LAMINATE, Set.SEGMENT, Set.SEGMENT_2D, Set.SHELL, Set.SOLID or Set.TSHELL. Set.ALL_TYPES. If omitted sets of all types will be blanked.
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 sets in model m: Set.UnblankAll(m); To unblank all of the node sets in model m: Set.UnblankAll(m, Set.NODE);
|
UnblankFlagged(Model[Model], flag[Flag], type (optional)[constant], redraw (optional)[boolean]) [static]DescriptionUnblanks all of the flagged sets in the model. |
Model that the flagged sets will be unblanked in
Flag set on the sets that you want to unblank
Type of sets to unblank. Can be Set.BEAM, Set.BOX Set.DISCRETE, Set.MM_GROUP, Set.NODE, Set.PART, Set.PART_TREE, Set.PERI_LAMINATE, Set.SEGMENT, Set.SEGMENT_2D, Set.SHELL, Set.SOLID or Set.TSHELL. Set.ALL_TYPES. If set, only flagged sets of this type will be unblanked. If omitted flagged sets of all types will be unblanked.
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 sets in model m flagged with f: Set.UnblankFlagged(m, f); To unblank all of the node sets in model m flagged with f: Set.UnblankFlagged(m, f, Set.NODE);
|
UnflagAll(Model[Model], flag[Flag], type (optional)[constant]) [static]DescriptionUnsets a defined flag on all of the sets in the model. |
Model that the defined flag for all sets will be unset in
Flag to unset on the sets
Type of the set. Can be Set.BEAM, Set.BOX Set.DISCRETE, Set.IGA_EDGE, Set.IGA_FACE, Set.IGA_POINT_UVW, Set.MM_GROUP, Set.MODE, Set.NODE, Set.PART, Set.PART_TREE, Set.PERI_LAMINATE, Set.SEGMENT, Set.SEGMENT_2D, Set.SHELL, Set.SOLID or Set.TSHELL
ReturnsNo return value |
ExampleTo unset the flag f on all the sets in model m: Set.UnflagAll(m, f);
|
Unsketch(redraw (optional)[boolean])DescriptionUnsketches the set. |
If model should be redrawn or not after the set is unsketched. If omitted redraw is true. If you want to unsketch several sets and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo unsketch set s: s.Unsketch();
|
UnsketchAll(Model[Model], type (optional)[constant], redraw (optional)[boolean]) [static]DescriptionUnsketches all sets. |
Model that all sets will be unsketched in
Type of sets to unsketch. Can be Set.BEAM, Set.BOX Set.DISCRETE, Set.MM_GROUP, Set.NODE, Set.PART, Set.PART_TREE, Set.PERI_LAMINATE, Set.SEGMENT, Set.SEGMENT_2D, Set.SHELL, Set.SOLID or Set.TSHELL. If omitted sets of all types will be unsketched.
If model should be redrawn or not after the 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 sets in model m: Set.UnsketchAll(m);
|
UnsketchFlagged(Model[Model], flag[Flag], type (optional)[constant], redraw (optional)[boolean]) [static]DescriptionUnsketches all flagged sets. |
Model that all sets will be unsketched in
Flag set on the sets that you want to unsketch
Type of sets to unsketch. Can be Set.BEAM, Set.BOX Set.DISCRETE, Set.MM_GROUP, Set.NODE, Set.PART, Set.PART_TREE, Set.PERI_LAMINATE, Set.SEGMENT, Set.SEGMENT_2D, Set.SHELL, Set.SOLID or Set.TSHELL. If omitted sets of all types will be unsketched.
If model should be redrawn or not after the 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 sets in model m flagged with f: Set.UnsketchFlagged(m, f); To unsketch all of the node sets in model m flagged with f: Set.UnsketchFlagged(m, f, Set.NODE);
|
Warning(message[string], details (optional)[string])DescriptionAdds a warning for a 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 set s: s.Warning("My custom warning");
|
Xrefs()DescriptionReturns the cross references for this set. |
No arguments
ReturnsXrefs object. Return typeXrefs |
ExampleTo get the cross references for this set: var xrefs = s.Xrefs();
|
toString()DescriptionCreates a string containing the set data in keyword format. Note that this contains the keyword header and the keyword cards. See also Set.Keyword() and Set.KeywordCards(). |
No arguments
Returnsstring Return typeString |
ExampleTo get data for set n in keyword format var s = n.toString();
|