The StrainBeam class gives you access to define initial strain beam cards in PRIMER. More...
The PRIMER JavaScript API provides many class constants, properties and methods. For Arup to
be able to extend and enhance the API in the future any constant, property or method names beginning with a lowercase
or uppercase letter are reserved.
If you need to add your own properties or methods to one of the existing classes then to avoid any potential future conflict you
should ensure that the name begins with either an underscore (_) or a dollar sign ($) or the name is prefixed with your
own unique identifier.
For example if company 'ABC' need to add a property called 'example' then to avoid any potential future conflict use one of:
| Name | Type | Description |
| eid | integer | Beam Element ID |
| exists (read only) | logical | true if initial strain beam exists, false if referred to but not defined. |
| include | integer | The Include file number that the initial strain beam is in. |
| model (read only) | integer | The Model number that the initial strain beam is in. |
| rdisp | real | The initial displacement along the local r-axis |
| rrot | real | The initial rotation about the local r-axis |
| sdisp | real | The initial displacement along the local s-axis |
| srot | real | The initial rotation about the local s-axis |
| tdisp | real | The initial displacement aling the local t-axis |
| trot | real | The initial rotation about the local t-axis |
Detailed DescriptionThe StrainBeam class allows you to create, modify, edit and manipulate strain_beam cards. See the documentation below for more details. |
Constructornew StrainBeam(Model[Model], details[object])DescriptionCreate a new StrainBeam object. |
Model that strain_beam will be created in
Details for creating the StrainBeam
Object has the following properties:
| Name | Type | Description |
| eid | integer | Beam Element ID |
| rdisp (optional) | real | The initial displacement along the local r-axis |
| rrot (optional) | real | The initial rotation about the local r-axis |
| sdisp (optional) | real | The initial displacement along the local s-axis |
| srot (optional) | real | The initial rotation about the local s-axis |
| tdisp (optional) | real | The initial displacement along the local t-axis |
| trot (optional) | real | The initial rotation about the local t-axis |
ReturnsStrainBeam object Return typeStrainBeam |
Details of functionsAssociateComment(Comment[Comment])DescriptionAssociates a comment with a initial strain beam. |
Comment that will be attached to the initial strain beam
ReturnsNo return value |
ExampleTo associate comment c to the initial strain beam ieb: ieb.AssociateComment(c);
|
ClearFlag(flag[Flag])DescriptionClears a flag on the initial strain beam. |
Flag to clear on the initial strain beam
ReturnsNo return value |
ExampleTo clear flag f for initial strain beam ieb: ieb.ClearFlag(f);
|
Copy(range (optional)[boolean])DescriptionCopies the initial strain beam. The target include of the copied initial strain beam 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().
ReturnsStrainBeam object Return typeStrainBeam |
ExampleTo copy initial strain beam ieb into initial strain beam z: var z = ieb.Copy();
|
DetachComment(Comment[Comment])DescriptionDetaches a comment from a initial strain beam. |
Comment that will be detached from the initial strain beam
ReturnsNo return value |
ExampleTo detach comment c from the initial strain beam ieb: ieb.DetachComment(c);
|
Error(message[string], details (optional)[string])DescriptionAdds an error for initial strain beam. 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 initial strain beam ieb: ieb.Error("My custom error");
|
First(Model[Model]) [static]DescriptionReturns the first initial strain beam in the model. |
Model to get first initial strain beam in
ReturnsStrainBeam object (or null if there are no initial strain beams in the model). Return typeStrainBeam |
ExampleTo get the first initial strain beam in model m: var ieb = StrainBeam.First(m);
|
FlagAll(Model[Model], flag[Flag]) [static]DescriptionFlags all of the initial strain beams in the model with a defined flag. |
Model that all initial strain beams will be flagged in
Flag to set on the initial strain beams
ReturnsNo return value |
ExampleTo flag all of the initial strain beams with flag f in model m: StrainBeam.FlagAll(m, f);
|
Flagged(flag[Flag])DescriptionChecks if the initial strain beam is flagged or not. |
Flag to test on the initial strain beam
Returnstrue if flagged, false if not. Return typeBoolean |
ExampleTo check if initial strain beam ieb has flag f set on it: if (ieb.Flagged(f) ) do_something...
|
ForEach(Model[Model], func[function], extra (optional)[any]) [static]DescriptionCalls a function for each initial strain beam in the model. |
Model that all initial strain beams are in
Function to call for each initial strain beam
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 StrainBeam objects or properties for all of the initial strain beams in a model in PRIMER. If the optional property argument is not given then an array of StrainBeam objects is returned. If the property argument is given, that property value for each initial strain beam is returned in the array instead of a StrainBeam object |
Model to get initial strain beams from
Name for property to get for all initial strain beams in the model
ReturnsArray of StrainBeam objects or properties Return typeArray |
GetComments()DescriptionExtracts the comments associated to a initial strain beam. |
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 initial strain beam ieb: var comm_array = ieb.GetComments();
|
GetFlagged(Model[Model], flag[Flag], property (optional)[string]) [static]DescriptionReturns an array of StrainBeam objects for all of the flagged initial strain beams in a model in PRIMER If the optional property argument is not given then an array of StrainBeam objects is returned. If the property argument is given, then that property value for each initial strain beam is returned in the array instead of a StrainBeam object |
Model to get initial strain beams from
Flag set on the initial strain beams that you want to retrieve
Name for property to get for all flagged initial strain beams in the model
ReturnsArray of StrainBeam objects or properties Return typeArray |
GetFromID(Model[Model], number[integer]) [static]DescriptionReturns the StrainBeam object for a initial strain beam ID. |
Model to find the initial strain beam in
number of the initial strain beam you want the StrainBeam object for
ReturnsStrainBeam object (or null if initial strain beam does not exist). Return typeStrainBeam |
ExampleTo get the StrainBeam object for initial strain beam 100 in model m var ieb = StrainBeam.GetFromID(m, 100);
|
GetParameter(prop[string])DescriptionChecks if a StrainBeam 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 StrainBeam.ViewParameters() method and 'method chaining' (see the examples below). |
initial strain beam property to get parameter for
ReturnsParameter object if property is a parameter, null if not. Return typeParameter |
Keyword()DescriptionReturns the keyword for this initial strain beam (*INITIAL_STRAIN_SHELL). Note that a carriage return is not added. See also StrainBeam.KeywordCards() |
No arguments
Returnsstring containing the keyword. Return typeString |
ExampleTo get the keyword for strain_beam i: var key = i.Keyword();
|
KeywordCards()DescriptionReturns the keyword cards for the initial strain beam. Note that a carriage return is not added. See also StrainBeam.Keyword() |
No arguments
Returnsstring containing the cards. Return typeString |
ExampleTo get the cards for strain_beam i: var cards = i.KeywordCards();
|
Last(Model[Model]) [static]DescriptionReturns the last initial strain beam in the model. |
Model to get last initial strain beam in
ReturnsStrainBeam object (or null if there are no initial strain beams in the model). Return typeStrainBeam |
ExampleTo get the last initial strain beam in model m: var ieb = StrainBeam.Last(m);
|
Next()DescriptionReturns the next initial strain beam in the model. |
No arguments
ReturnsStrainBeam object (or null if there are no more initial strain beams in the model). Return typeStrainBeam |
ExampleTo get the initial strain beam in model m after initial strain beam ieb: var ieb = ieb.Next();
|
Pick(prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean], button text (optional)[string]) [static]DescriptionAllows the user to pick a initial strain beam. |
Text to display as a prompt to the user
If the argument is a Model then only initial strain beams from that model can be picked. If the argument is a Flag then only initial strain beams that are flagged with limit can be selected. If omitted, or null, any initial strain beams 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.
ReturnsStrainBeam object (or null if not picked) Return typeStrainBeam |
ExampleTo pick a initial strain beam from model m giving the prompt 'Pick initial strain beam from screen': var ieb = StrainBeam.Pick('Pick initial strain beam from screen', m);
|
Previous()DescriptionReturns the previous initial strain beam in the model. |
No arguments
ReturnsStrainBeam object (or null if there are no more initial strain beams in the model). Return typeStrainBeam |
ExampleTo get the initial strain beam in model m before initial strain beam ieb: var ieb = ieb.Previous();
|
Select(flag[Flag], prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean]) [static]DescriptionAllows the user to select initial strain beams using standard PRIMER object menus. |
Flag to use when selecting initial strain beams
Text to display as a prompt to the user
If the argument is a Model then only initial strain beams from that model can be selected. If the argument is a Flag then only initial strain beams that are flagged with limit can be selected (limit should be different to flag). If omitted, or null, any initial strain beams 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 initial strain beams selected or null if menu cancelled Return typeNumber |
SetFlag(flag[Flag])DescriptionSets a flag on the initial strain beam. |
Flag to set on the initial strain beam
ReturnsNo return value |
ExampleTo set flag f for initial strain beam ieb: ieb.SetFlag(f);
|
Sketch(redraw (optional)[boolean])DescriptionSketches the initial strain beam. The initial strain beam will be sketched until you either call StrainBeam.Unsketch(), StrainBeam.UnsketchAll(), Model.UnsketchAll(), or delete the model |
If model should be redrawn or not after the initial strain beam is sketched. If omitted redraw is true. If you want to sketch several initial strain beams and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo sketch initial strain beam ieb: ieb.Sketch();
|
SketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionSketches all of the flagged initial strain beams in the model. The initial strain beams will be sketched until you either call StrainBeam.Unsketch(), StrainBeam.UnsketchFlagged(), Model.UnsketchAll(), or delete the model |
Model that all the flagged initial strain beams will be sketched in
Flag set on the initial strain beams that you want to sketch
If model should be redrawn or not after the initial strain beams are sketched. If omitted redraw is true. If you want to sketch flagged initial strain beams several times and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo sketch all initial strain beams flagged with flag in model m: StrainBeam.SketchFlagged(m, flag);
|
Total(Model[Model], exists (optional)[boolean]) [static]DescriptionReturns the total number of initial strain beams in the model. |
Model to get total for
true if only existing initial strain beams should be counted. If false or omitted referenced but undefined initial strain beams will also be included in the total.
Returnsnumber of initial strain beams Return typeNumber |
ExampleTo get the total number of initial strain beams in model m: var total = StrainBeam.Total(m);
|
UnflagAll(Model[Model], flag[Flag]) [static]DescriptionUnsets a defined flag on all of the initial strain beams in the model. |
Model that the defined flag for all initial strain beams will be unset in
Flag to unset on the initial strain beams
ReturnsNo return value |
ExampleTo unset the flag f on all the initial strain beams in model m: StrainBeam.UnflagAll(m, f);
|
Unsketch(redraw (optional)[boolean])DescriptionUnsketches the initial strain beam. |
If model should be redrawn or not after the initial strain beam is unsketched. If omitted redraw is true. If you want to unsketch several initial strain beams and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo unsketch initial strain beam ieb: ieb.Unsketch();
|
UnsketchAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionUnsketches all initial strain beams. |
Model that all initial strain beams will be unblanked in
If model should be redrawn or not after the initial strain beams 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 initial strain beams in model m: StrainBeam.UnsketchAll(m);
|
UnsketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionUnsketches all flagged initial strain beams in the model. |
Model that all initial strain beams will be unsketched in
Flag set on the initial strain beams that you want to unsketch
If model should be redrawn or not after the initial strain beams 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 initial strain beams flagged with flag in model m: StrainBeam.UnsketchAll(m, flag);
|
No arguments
ReturnsStrainBeam object. Return typeStrainBeam |
ExampleTo check if StrainBeam property ieb.example is a parameter by using the StrainBeam.GetParameter() method: if (ieb.ViewParameters().GetParameter(ieb.example) ) do_something...
|
Warning(message[string], details (optional)[string])DescriptionAdds a warning for initial strain beam. 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 initial strain beam ieb: ieb.Warning("My custom warning");
|
Xrefs()DescriptionReturns the cross references for this initial strain beam. |
No arguments
ReturnsXrefs object. Return typeXrefs |
ExampleTo get the cross references for initial strain beam ieb: var xrefs = ieb.Xrefs();
|
toString()DescriptionCreates a string containing the initial strain beam data in keyword format. Note that this contains the keyword header and the keyword cards. See also StrainBeam.Keyword() and StrainBeam.KeywordCards(). |
No arguments
Returnsstring Return typeString |
ExampleTo get data for strain_beam i in keyword format var s = i.toString();
|