Oasys.PRIMER.StrainBeam class¶
Properties¶
- property StrainBeam.exists(read only): boolean¶
true if initial strain beam exists, false if referred to but not defined
- property StrainBeam.rdisp: float¶
The initial displacement along the local r-axis
- property StrainBeam.rrot: float¶
The initial rotation about the local r-axis
- property StrainBeam.sdisp: float¶
The initial displacement along the local s-axis
- property StrainBeam.srot: float¶
The initial rotation about the local s-axis
- property StrainBeam.tdisp: float¶
The initial displacement aling the local t-axis
- property StrainBeam.trot: float¶
The initial rotation about the local t-axis
Constructor¶
- classmethod StrainBeam(model, details)¶
Create a new
StrainBeamobject
- Parameters:
model (Model) –
Modelthat strain_beam will be created indetails (dict) –
Details for creating the
StrainBeam
- eid:
(integer)
BeamElement ID- rdisp (optional):
(float) The initial displacement along the local r-axis
- rrot (optional):
(float) The initial rotation about the local r-axis
- sdisp (optional):
(float) The initial displacement along the local s-axis
- srot (optional):
(float) The initial rotation about the local s-axis
- tdisp (optional):
(float) The initial displacement along the local t-axis
- trot (optional):
(float) The initial rotation about the local t-axis
- Returns:
StrainBeam object
- Return type:
StrainBeam
Example
To create a new strain_beam in model m, using eid 1, rdisp 2.2, sdisp 3.3, tdisp 4.4, rrot 5.5, srot 6.6 and trot 7.7:
s = Oasys.PRIMER.StrainBeam(m, {'eid': 1, 'rdisp': 2.2, 'sdisp': 3.3, 'tdisp': 4.4, 'rrot': 5.5, 'srot': 6.6, 'trot': 7.7})
Static methods¶
- classmethod StrainBeam.First(model)¶
Returns the first initial strain beam in the model
- Parameters:
model (Model) –
Modelto get first initial strain beam in- Returns:
StrainBeam object (or None if there are no initial strain beams in the model)
- Return type:
StrainBeam
Example
To get the first initial strain beam in model m:
ieb = Oasys.PRIMER.StrainBeam.First(m)
- classmethod StrainBeam.FlagAll(model, flag)¶
Flags all of the initial strain beams in the model with a defined flag
- Parameters:
model (Model) –
Modelthat all initial strain beams will be flagged inflag (Flag) – Flag to set on the initial strain beams
- Returns:
No return value
- Return type:
None
Example
To flag all of the initial strain beams with flag f in model m:
Oasys.PRIMER.StrainBeam.FlagAll(m, f)
- classmethod StrainBeam.GetAll(model, property=Oasys.gRPC.defaultArg)¶
Returns a list 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 a list of StrainBeam objects is returned. If the property argument is given, that property value for each initial strain beam is returned in the list instead of a StrainBeam object
- Parameters:
model (Model) –
Modelto get initial strain beams fromproperty (string) – Optional. Name for property to get for all initial strain beams in the model
- Returns:
List of StrainBeam objects or properties
- Return type:
list
Example
To make a list of StrainBeam objects for all of the initial strain beams in model m:
a = Oasys.PRIMER.StrainBeam.GetAll(m)To return a list containing the value of property ‘foo’ (for example ‘x’ for a node) for each initial strain beam in model m:
a = Oasys.PRIMER.StrainBeam.GetAll(m, 'foo')
- classmethod StrainBeam.GetFlagged(model, flag, property=Oasys.gRPC.defaultArg)¶
Returns a list 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 a list of StrainBeam objects is returned. If the property argument is given, then that property value for each initial strain beam is returned in the list instead of a StrainBeam object
- Parameters:
model (Model) –
Modelto get initial strain beams fromflag (Flag) – Flag set on the initial strain beams that you want to retrieve
property (string) – Optional. Name for property to get for all flagged initial strain beams in the model
- Returns:
List of StrainBeam objects or properties
- Return type:
list
Example
To make a list of StrainBeam objects for all of the initial strain beams in model m flagged with f:
ieb = Oasys.PRIMER.StrainBeam.GetFlagged(m, f)To return a list containing the value of property ‘foo’ (for example ‘x’ for a node) for all of the initial strain beams in model m flagged with f:
a = Oasys.PRIMER.StrainBeam.GetFlagged(m, f, 'foo')
- classmethod StrainBeam.GetFromID(model, number)¶
Returns the StrainBeam object for a initial strain beam ID
- Parameters:
model (Model) –
Modelto find the initial strain beam innumber (integer) – number of the initial strain beam you want the StrainBeam object for
- Returns:
StrainBeam object (or None if initial strain beam does not exist)
- Return type:
StrainBeam
Example
To get the StrainBeam object for initial strain beam 100 in model m
ieb = Oasys.PRIMER.StrainBeam.GetFromID(m, 100)
- classmethod StrainBeam.Last(model)¶
Returns the last initial strain beam in the model
- Parameters:
model (Model) –
Modelto get last initial strain beam in- Returns:
StrainBeam object (or None if there are no initial strain beams in the model)
- Return type:
StrainBeam
Example
To get the last initial strain beam in model m:
ieb = Oasys.PRIMER.StrainBeam.Last(m)
- classmethod StrainBeam.Pick(prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg, button_text=Oasys.gRPC.defaultArg)¶
Allows the user to pick a initial strain beam
- Parameters:
prompt (string) – Text to display as a prompt to the user
limit (Model or Flag) – Optional. If the argument is a
Modelthen only initial strain beams from that model can be picked. If the argument is aFlagthen only initial strain beams that are flagged with limit can be selected. If omitted, or None, any initial strain beams from any model can be selected. from any modelmodal (boolean) – Optional. 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
button_text (string) – Optional. By default the window with the prompt will have a button labelled ‘Cancel’ which if pressed will cancel the pick and return None. If you want to change the text on the button use this argument. If omitted ‘Cancel’ will be used
- Returns:
StrainBeam object (or None if not picked)
- Return type:
StrainBeam
Example
To pick a initial strain beam from model m giving the prompt ‘Pick initial strain beam from screen’:
ieb = Oasys.PRIMER.StrainBeam.Pick('Pick initial strain beam from screen', m)
- classmethod StrainBeam.Select(flag, prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg)¶
Allows the user to select initial strain beams using standard PRIMER object menus
- Parameters:
flag (Flag) – Flag to use when selecting initial strain beams
prompt (string) – Text to display as a prompt to the user
limit (Model or Flag) – Optional. If the argument is a
Modelthen only initial strain beams from that model can be selected. If the argument is aFlagthen only initial strain beams that are flagged with limit can be selected (limit should be different to flag). If omitted, or None, any initial strain beams can be selected. from any modelmodal (boolean) – Optional. 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
- Returns:
Number of initial strain beams selected or None if menu cancelled
- Return type:
int
Example
To select initial strain beams from model m, flagging those selected with flag f, giving the prompt ‘Select initial strain beams’:
Oasys.PRIMER.StrainBeam.Select(f, 'Select initial strain beams', m)To select initial strain beams, flagging those selected with flag f but limiting selection to initial strain beams flagged with flag l, giving the prompt ‘Select initial strain beams’:
Oasys.PRIMER.StrainBeam.Select(f, 'Select initial strain beams', l)
- classmethod StrainBeam.SketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Sketches 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
- Parameters:
model (Model) –
Modelthat all the flagged initial strain beams will be sketched inflag (Flag) – Flag set on the initial strain beams that you want to sketch
redraw (boolean) – Optional. 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()- Returns:
No return value
- Return type:
None
Example
To sketch all initial strain beams flagged with flag in model m:
Oasys.PRIMER.StrainBeam.SketchFlagged(m, flag)
- classmethod StrainBeam.Total(model, exists=Oasys.gRPC.defaultArg)¶
Returns the total number of initial strain beams in the model
- Parameters:
model (Model) –
Modelto get total forexists (boolean) – Optional. 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
- Returns:
number of initial strain beams
- Return type:
int
Example
To get the total number of initial strain beams in model m:
total = Oasys.PRIMER.StrainBeam.Total(m)
- classmethod StrainBeam.UnflagAll(model, flag)¶
Unsets a defined flag on all of the initial strain beams in the model
- Parameters:
model (Model) –
Modelthat the defined flag for all initial strain beams will be unset inflag (Flag) – Flag to unset on the initial strain beams
- Returns:
No return value
- Return type:
None
Example
To unset the flag f on all the initial strain beams in model m:
Oasys.PRIMER.StrainBeam.UnflagAll(m, f)
- classmethod StrainBeam.UnsketchAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all initial strain beams
- Parameters:
model (Model) –
Modelthat all initial strain beams will be unblanked inredraw (boolean) – Optional. 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()- Returns:
No return value
- Return type:
None
Example
To unsketch all initial strain beams in model m:
Oasys.PRIMER.StrainBeam.UnsketchAll(m)
- classmethod StrainBeam.UnsketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all flagged initial strain beams in the model
- Parameters:
model (Model) –
Modelthat all initial strain beams will be unsketched inflag (Flag) – Flag set on the initial strain beams that you want to unsketch
redraw (boolean) – Optional. 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()- Returns:
No return value
- Return type:
None
Example
To unsketch all initial strain beams flagged with flag in model m:
Oasys.PRIMER.StrainBeam.UnsketchAll(m, flag)
Instance methods¶
- StrainBeam.AssociateComment(comment)¶
Associates a comment with a initial strain beam
- Parameters:
comment (Comment) –
Commentthat will be attached to the initial strain beam- Returns:
No return value
- Return type:
None
Example
To associate comment c to the initial strain beam ieb:
ieb.AssociateComment(c)
- StrainBeam.ClearFlag(flag)¶
Clears a flag on the initial strain beam
- Parameters:
flag (Flag) – Flag to clear on the initial strain beam
- Returns:
No return value
- Return type:
None
Example
To clear flag f for initial strain beam ieb:
ieb.ClearFlag(f)
- StrainBeam.Copy(range=Oasys.gRPC.defaultArg)¶
Copies the initial strain beam. The target include of the copied initial strain beam can be set using
Options.copy_target_include
- Parameters:
range (boolean) – Optional. 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()- Returns:
StrainBeam object
- Return type:
StrainBeam
Example
To copy initial strain beam ieb into initial strain beam z:
z = ieb.Copy()
- StrainBeam.DetachComment(comment)¶
Detaches a comment from a initial strain beam
- Parameters:
comment (Comment) –
Commentthat will be detached from the initial strain beam- Returns:
No return value
- Return type:
None
Example
To detach comment c from the initial strain beam ieb:
ieb.DetachComment(c)
- StrainBeam.Flagged(flag)¶
Checks if the initial strain beam is flagged or not
- Parameters:
flag (Flag) – Flag to test on the initial strain beam
- Returns:
True if flagged, False if not
- Return type:
bool
Example
To check if initial strain beam ieb has flag f set on it:
if ieb.Flagged(f): do_something..
- StrainBeam.GetComments()¶
Extracts the comments associated to a initial strain beam
- Returns:
List of Comment objects (or None if there are no comments associated to the node)
- Return type:
list
Example
To get the list of comments associated to the initial strain beam ieb:
comm_list = ieb.GetComments()
- StrainBeam.GetParameter(prop)¶
Checks 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_namesoption to true before calling the function and then resetting it to false afterwards.. This behaviour can also temporarily be switched by using theStrainBeam.ViewParameters()method and ‘method chaining’ (see the examples below)
- Parameters:
prop (string) – initial strain beam property to get parameter for
- Returns:
Parameter object if property is a parameter, None if not
- Return type:
Parameter
Example
To check if StrainBeam property ieb.example is a parameter:
Oasys.PRIMER.Options.property_parameter_names = True if ieb.GetParameter(ieb.example): do_something... Oasys.PRIMER.Options.property_parameter_names = FalseTo check if StrainBeam property ieb.example is a parameter by using the GetParameter method:
if ieb.ViewParameters().GetParameter(ieb.example): do_something..
- StrainBeam.Keyword()¶
Returns the keyword for this initial strain beam (*INITIAL_STRAIN_SHELL). Note that a carriage return is not added. See also
StrainBeam.KeywordCards()
- Returns:
string containing the keyword
- Return type:
str
Example
To get the keyword for strain_beam i:
key = i.Keyword()
- StrainBeam.KeywordCards()¶
Returns the keyword cards for the initial strain beam. Note that a carriage return is not added. See also
StrainBeam.Keyword()
- Returns:
string containing the cards
- Return type:
str
Example
To get the cards for strain_beam i:
cards = i.KeywordCards()
- StrainBeam.Next()¶
Returns the next initial strain beam in the model
- Returns:
StrainBeam object (or None if there are no more initial strain beams in the model)
- Return type:
StrainBeam
Example
To get the initial strain beam in model m after initial strain beam ieb:
ieb = ieb.Next()
- StrainBeam.Previous()¶
Returns the previous initial strain beam in the model
- Returns:
StrainBeam object (or None if there are no more initial strain beams in the model)
- Return type:
StrainBeam
Example
To get the initial strain beam in model m before initial strain beam ieb:
ieb = ieb.Previous()
- StrainBeam.SetFlag(flag)¶
Sets a flag on the initial strain beam
- Parameters:
flag (Flag) – Flag to set on the initial strain beam
- Returns:
No return value
- Return type:
None
Example
To set flag f for initial strain beam ieb:
ieb.SetFlag(f)
- StrainBeam.Sketch(redraw=Oasys.gRPC.defaultArg)¶
Sketches 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
- Parameters:
redraw (boolean) – Optional. 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()- Returns:
No return value
- Return type:
None
Example
To sketch initial strain beam ieb:
ieb.Sketch()
- StrainBeam.Unsketch(redraw=Oasys.gRPC.defaultArg)¶
Unsketches the initial strain beam
- Parameters:
redraw (boolean) – Optional. 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()- Returns:
No return value
- Return type:
None
Example
To unsketch initial strain beam ieb:
ieb.Unsketch()
- StrainBeam.ViewParameters()¶
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. This function temporarily changes the behaviour so that if a property is a parameter the parameter name is returned instead. This can be used with ‘method chaining’ (see the example below) to make sure a property argument is correct
- Returns:
StrainBeam object
- Return type:
StrainBeam
Example
To check if StrainBeam property ieb.example is a parameter by using the
StrainBeam.GetParameter()method:if ieb.ViewParameters().GetParameter(ieb.example): do_something..
- StrainBeam.Xrefs()¶
Returns the cross references for this initial strain beam
- Returns:
Xrefs object
- Return type:
Xrefs
Example
To get the cross references for initial strain beam ieb:
xrefs = ieb.Xrefs()