Oasys.PRIMER.StrainSolid class¶
Constants¶
Properties¶
- property StrainSolid.epsxx: float¶
Define the xxth strain component in the global cartesian system
- property StrainSolid.epsxy: float¶
Define the xyth strain component in the global cartesian system
- property StrainSolid.epsyy: float¶
Define the yyth strain component in the global cartesian system
- property StrainSolid.epsyz: float¶
Define the yzth strain component in the global cartesian system
- property StrainSolid.epszx: float¶
Define the zxth strain component in the global cartesian system
- property StrainSolid.epszz: float¶
Define the zzth strain component in the global cartesian system
- property StrainSolid.exists(read only): boolean¶
true if strain_solid exists, false if referred to but not defined
- property StrainSolid.model(read only): integer¶
The
Model
number that the initial strain solid is in
- property StrainSolid.type: constant¶
The Intial strain solid type. Can be
StrainSolid.SOLID
orStrainSolid.SET
Constructor¶
- classmethod StrainSolid(model, type, eid, epsxx, epsyy, epszz, epsxy, epsyz, epszx)¶
Create a new
StrainSolid
object
- Parameters:
model (Model) –
Model
that strain_solid will be created intype (constant) – Specify the type of initial strain solid (Can be
StrainSolid.SOLID
orStrainSolid.SET
)eid (integer) –
Solid
Element ID or solid set IDepsxx (real) – The xxth strain component in the global cartesian system
epsyy (real) – The yyth strain component in the global cartesian system
epszz (real) – The zzth strain component in the global cartesian system
epsxy (real) – The xyth strain component in the global cartesian system
epsyz (real) – The yzth strain component in the global cartesian system
epszx (real) – The zxth strain component in the global cartesian system
- Returns:
StrainSolid object
- Return type:
dict
Example
To create a new strain_solid in model m, of type SET with SOLID_SET id as 1, strain components as 10, 20, 30, 40, 50, 60
s = Oasys.PRIMER.StrainSolid(m, Oasys.PRIMER.StrainSolid.SET, 1, 10, 20, 30, 40, 50, 60)
Static methods¶
- classmethod StrainSolid.First(model)¶
Returns the first initial strain solid in the model
- Parameters:
model (Model) –
Model
to get first initial strain solid in- Returns:
StrainSolid object (or None if there are no initial strain solids in the model)
- Return type:
StrainSolid
Example
To get the first initial strain solid in model m:
iso = Oasys.PRIMER.StrainSolid.First(m)
- classmethod StrainSolid.FlagAll(model, flag)¶
Flags all of the initial strain solids in the model with a defined flag
- Parameters:
model (Model) –
Model
that all initial strain solids will be flagged inflag (Flag) – Flag to set on the initial strain solids
- Returns:
No return value
- Return type:
None
Example
To flag all of the initial strain solids with flag f in model m:
Oasys.PRIMER.StrainSolid.FlagAll(m, f)
- classmethod StrainSolid.GetAll(model)¶
Returns a list of StrainSolid objects for all of the initial strain solids in a model in PRIMER
- Parameters:
model (Model) –
Model
to get initial strain solids from- Returns:
List of StrainSolid objects
- Return type:
list
Example
To make a list of StrainSolid objects for all of the initial strain solids in model m
iso = Oasys.PRIMER.StrainSolid.GetAll(m)
- classmethod StrainSolid.GetFlagged(model, flag)¶
Returns a list of StrainSolid objects for all of the flagged initial strain solids in a model in PRIMER
- Parameters:
model (Model) –
Model
to get initial strain solids fromflag (Flag) – Flag set on the initial strain solids that you want to retrieve
- Returns:
List of StrainSolid objects
- Return type:
list
Example
To make a list of StrainSolid objects for all of the initial strain solids in model m flagged with f
iso = Oasys.PRIMER.StrainSolid.GetFlagged(m, f)
- classmethod StrainSolid.GetFromID(model, number)¶
Returns the StrainSolid object for a initial strain solid ID
- Parameters:
model (Model) –
Model
to find the initial strain solid innumber (integer) – number of the initial strain solid you want the StrainSolid object for
- Returns:
StrainSolid object (or None if initial strain solid does not exist)
- Return type:
StrainSolid
Example
To get the StrainSolid object for initial strain solid 100 in model m
iso = Oasys.PRIMER.StrainSolid.GetFromID(m, 100)
- classmethod StrainSolid.Last(model)¶
Returns the last initial strain solid in the model
- Parameters:
model (Model) –
Model
to get last initial strain solid in- Returns:
StrainSolid object (or None if there are no initial strain solids in the model)
- Return type:
StrainSolid
Example
To get the last initial strain solid in model m:
iso = Oasys.PRIMER.StrainSolid.Last(m)
- classmethod StrainSolid.Pick(prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg, button_text=Oasys.gRPC.defaultArg)¶
Allows the user to pick a initial strain solid
- Parameters:
prompt (string) – Text to display as a prompt to the user
limit (Model or Flag) – Optional. If the argument is a
Model
then only initial strain solids from that model can be picked. If the argument is aFlag
then only initial strain solids that are flagged with limit can be selected. If omitted, or None, any initial strain solids 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:
StrainSolid object (or None if not picked)
- Return type:
dict
Example
To pick a initial strain solid from model m giving the prompt ‘Pick initial strain solid from screen’:
iso = Oasys.PRIMER.StrainSolid.Pick('Pick initial strain solid from screen', m)
- classmethod StrainSolid.Select(flag, prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg)¶
Allows the user to select initial strain solids using standard PRIMER object menus
- Parameters:
flag (Flag) – Flag to use when selecting initial strain solids
prompt (string) – Text to display as a prompt to the user
limit (Model or Flag) – Optional. If the argument is a
Model
then only initial strain solids from that model can be selected. If the argument is aFlag
then only initial strain solids that are flagged with limit can be selected (limit should be different to flag). If omitted, or None, any initial strain solids 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 solids selected or None if menu cancelled
- Return type:
int
Example
To select initial strain solids from model m, flagging those selected with flag f, giving the prompt ‘Select initial strain solids’:
Oasys.PRIMER.StrainSolid.Select(f, 'Select initial strain solids', m)To select initial strain solids, flagging those selected with flag f but limiting selection to initial strain solids flagged with flag l, giving the prompt ‘Select initial strain solids’:
Oasys.PRIMER.StrainSolid.Select(f, 'Select initial strain solids', l)
- classmethod StrainSolid.SketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Sketches all of the flagged initial strain solids in the model. The initial strain solids will be sketched until you either call
StrainSolid.Unsketch()
,StrainSolid.UnsketchFlagged()
,Model.UnsketchAll()
, or delete the model
- Parameters:
model (Model) –
Model
that all the flagged initial strain solids will be sketched inflag (Flag) – Flag set on the initial strain solids that you want to sketch
redraw (boolean) – Optional. If model should be redrawn or not after the initial strain solids are sketched. If omitted redraw is true. If you want to sketch flagged initial strain solids 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 solids flagged with flag in model m:
Oasys.PRIMER.StrainSolid.SketchFlagged(m, flag)
- classmethod StrainSolid.Total(model, exists=Oasys.gRPC.defaultArg)¶
Returns the total number of initial strain solids in the model
- Parameters:
model (Model) –
Model
to get total forexists (boolean) – Optional. true if only existing initial strain solids should be counted. If false or omitted referenced but undefined initial strain solids will also be included in the total
- Returns:
number of initial strain solids
- Return type:
int
Example
To get the total number of initial strain solids in model m:
total = Oasys.PRIMER.StrainSolid.Total(m)
- classmethod StrainSolid.UnflagAll(model, flag)¶
Unsets a defined flag on all of the initial strain solids in the model
- Parameters:
model (Model) –
Model
that the defined flag for all initial strain solids will be unset inflag (Flag) – Flag to unset on the initial strain solids
- Returns:
No return value
- Return type:
None
Example
To unset the flag f on all the initial strain solids in model m:
Oasys.PRIMER.StrainSolid.UnflagAll(m, f)
- classmethod StrainSolid.UnsketchAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all initial strain solids
- Parameters:
model (Model) –
Model
that all initial strain solids will be unblanked inredraw (boolean) – Optional. If model should be redrawn or not after the initial strain solids 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 solids in model m:
Oasys.PRIMER.StrainSolid.UnsketchAll(m)
- classmethod StrainSolid.UnsketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all flagged initial strain solids in the model
- Parameters:
model (Model) –
Model
that all initial strain solids will be unsketched inflag (Flag) – Flag set on the initial strain solids that you want to unsketch
redraw (boolean) – Optional. If model should be redrawn or not after the initial strain solids 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 solids flagged with flag in model m:
Oasys.PRIMER.StrainSolid.UnsketchAll(m, flag)
Instance methods¶
- StrainSolid.AssociateComment(comment)¶
Associates a comment with a initial strain solid
- Parameters:
comment (Comment) –
Comment
that will be attached to the initial strain solid- Returns:
No return value
- Return type:
None
Example
To associate comment c to the initial strain solid iso:
iso.AssociateComment(c)
- StrainSolid.ClearFlag(flag)¶
Clears a flag on the initial strain solid
- Parameters:
flag (Flag) – Flag to clear on the initial strain solid
- Returns:
No return value
- Return type:
None
Example
To clear flag f for initial strain solid iso:
iso.ClearFlag(f)
- StrainSolid.Copy(range=Oasys.gRPC.defaultArg)¶
Copies the initial strain solid. The target include of the copied initial strain solid 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:
StrainSolid object
- Return type:
StrainSolid
Example
To copy initial strain solid iso into initial strain solid z:
z = iso.Copy()
- StrainSolid.DetachComment(comment)¶
Detaches a comment from a initial strain solid
- Parameters:
comment (Comment) –
Comment
that will be detached from the initial strain solid- Returns:
No return value
- Return type:
None
Example
To detach comment c from the initial strain solid iso:
iso.DetachComment(c)
- StrainSolid.Flagged(flag)¶
Checks if the initial strain solid is flagged or not
- Parameters:
flag (Flag) – Flag to test on the initial strain solid
- Returns:
True if flagged, False if not
- Return type:
bool
Example
To check if initial strain solid iso has flag f set on it:
if iso.Flagged(f): do_something..
- StrainSolid.GetComments()¶
Extracts the comments associated to a initial strain solid
- 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 solid iso:
comm_list = iso.GetComments()
- StrainSolid.GetParameter(prop)¶
Checks if a StrainSolid 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 theStrainSolid.ViewParameters()
method and ‘method chaining’ (see the examples below)
- Parameters:
prop (string) – initial strain solid property to get parameter for
- Returns:
Parameter object if property is a parameter, None if not
- Return type:
dict
Example
To check if StrainSolid property iso.example is a parameter:
Oasys.PRIMER.Options.property_parameter_names = True if iso.GetParameter(iso.example): do_something... Oasys.PRIMER.Options.property_parameter_names = FalseTo check if StrainSolid property iso.example is a parameter by using the GetParameter method:
if iso.ViewParameters().GetParameter(iso.example): do_something..
- StrainSolid.Keyword()¶
Returns the keyword for this initial strain solid (*INITIAL_STRESS_SOLID). Note that a carriage return is not added. See also
StrainSolid.KeywordCards()
- Returns:
string containing the keyword
- Return type:
str
Example
To get the keyword for strain_solid i:
key = i.Keyword()
- StrainSolid.KeywordCards()¶
Returns the keyword cards for the initial strain solid. Note that a carriage return is not added. See also
StrainSolid.Keyword()
- Returns:
string containing the cards
- Return type:
str
Example
To get the cards for strain_solid i:
cards = i.KeywordCards()
- StrainSolid.Next()¶
Returns the next initial strain solid in the model
- Returns:
StrainSolid object (or None if there are no more initial strain solids in the model)
- Return type:
StrainSolid
Example
To get the initial strain solid in model m after initial strain solid iso:
iso = iso.Next()
- StrainSolid.Previous()¶
Returns the previous initial strain solid in the model
- Returns:
StrainSolid object (or None if there are no more initial strain solids in the model)
- Return type:
StrainSolid
Example
To get the initial strain solid in model m before initial strain solid iso:
iso = iso.Previous()
- StrainSolid.SetFlag(flag)¶
Sets a flag on the initial strain solid
- Parameters:
flag (Flag) – Flag to set on the initial strain solid
- Returns:
No return value
- Return type:
None
Example
To set flag f for initial strain solid iso:
iso.SetFlag(f)
- StrainSolid.Sketch(redraw=Oasys.gRPC.defaultArg)¶
Sketches the initial strain solid. The initial strain solid will be sketched until you either call
StrainSolid.Unsketch()
,StrainSolid.UnsketchAll()
,Model.UnsketchAll()
, or delete the model
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the initial strain solid is sketched. If omitted redraw is true. If you want to sketch several initial strain solids 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 solid iso:
iso.Sketch()
- StrainSolid.Unsketch(redraw=Oasys.gRPC.defaultArg)¶
Unsketches the initial strain solid
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the initial strain solid is unsketched. If omitted redraw is true. If you want to unsketch several initial strain solids 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 solid iso:
iso.Unsketch()
- StrainSolid.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:
StrainSolid object
- Return type:
dict
Example
To check if StrainSolid property iso.example is a parameter by using the
StrainSolid.GetParameter()
method:if iso.ViewParameters().GetParameter(iso.example): do_something..
- StrainSolid.Xrefs()¶
Returns the cross references for this initial strain solid
- Returns:
Xrefs object
- Return type:
dict
Example
To get the cross references for initial strain solid iso:
xrefs = iso.Xrefs()