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