Oasys.PRIMER.StrainShell class¶
Constants¶
Properties¶
- property StrainShell.exists(read only): boolean¶
true if strain_shell exists, false if referred to but not defined
- property StrainShell.ilocal: integer¶
Flag for coordinate system of strain components
- property StrainShell.large: boolean¶
true if large format, false otherwise
- property StrainShell.model(read only): integer¶
The
Model
number that the initial strain shell is in
- property StrainShell.nplane: integer¶
Number of in plane integration points being output (not read when the SET option is used)
- property StrainShell.nthick: integer¶
Number of integration points through the thickness (not read when the SET option is used)
- property StrainShell.type: constant¶
The Intial strain shell type. Can be
StrainShell.SHELL
orStrainShell.SET
Constructor¶
- classmethod StrainShell(model, type, eid, nplane, nthick, large, ilocal)¶
Create a new
StrainShell
object
- Parameters:
model (Model) –
Model
that strain_shell will be created intype (constant) – Specify the type of initial strain shell (Can be
StrainShell.SHELL
orStrainShell.SET
)eid (integer) –
Shell
Element ID or shell set IDnplane (integer) – Number of in plane integration points being output
nthick (integer) – Number of integration points through the thickness
large (integer) – Large format flag, set 0 to turn it off or 1 to enable it. It is optional and set to 0 by default
ilocal (integer) – Flag for coordinate system of strain components. Set to 0 for global or 1 to enable local. It is optional and set to 0 by default
- Returns:
StrainShell object
- Return type:
dict
Example
To create a new strain_shell in model m, of type SET
s = Oasys.PRIMER.StrainShell(m, Oasys.PRIMER.StrainShell.SET, 1, 2, 2)
Static methods¶
- classmethod StrainShell.First(model)¶
Returns the first initial strain shell in the model
- Parameters:
model (Model) –
Model
to get first initial strain shell in- Returns:
StrainShell object (or None if there are no initial strain shells in the model)
- Return type:
StrainShell
Example
To get the first initial strain shell in model m:
iss = Oasys.PRIMER.StrainShell.First(m)
- classmethod StrainShell.FlagAll(model, flag)¶
Flags all of the initial strain shells in the model with a defined flag
- Parameters:
model (Model) –
Model
that all initial strain shells will be flagged inflag (Flag) – Flag to set on the initial strain shells
- Returns:
No return value
- Return type:
None
Example
To flag all of the initial strain shells with flag f in model m:
Oasys.PRIMER.StrainShell.FlagAll(m, f)
- classmethod StrainShell.GetAll(model)¶
Returns a list of StrainShell objects for all of the initial strain shells in a model in PRIMER
- Parameters:
model (Model) –
Model
to get initial strain shells from- Returns:
List of StrainShell objects
- Return type:
list
Example
To make a list of StrainShell objects for all of the initial strain shells in model m
iss = Oasys.PRIMER.StrainShell.GetAll(m)
- classmethod StrainShell.GetFlagged(model, flag)¶
Returns a list of StrainShell objects for all of the flagged initial strain shells in a model in PRIMER
- Parameters:
model (Model) –
Model
to get initial strain shells fromflag (Flag) – Flag set on the initial strain shells that you want to retrieve
- Returns:
List of StrainShell objects
- Return type:
list
Example
To make a list of StrainShell objects for all of the initial strain shells in model m flagged with f
iss = Oasys.PRIMER.StrainShell.GetFlagged(m, f)
- classmethod StrainShell.GetFromID(model, number)¶
Returns the StrainShell object for a initial strain shell ID
- Parameters:
model (Model) –
Model
to find the initial strain shell innumber (integer) – number of the initial strain shell you want the StrainShell object for
- Returns:
StrainShell object (or None if initial strain shell does not exist)
- Return type:
StrainShell
Example
To get the StrainShell object for initial strain shell 100 in model m
iss = Oasys.PRIMER.StrainShell.GetFromID(m, 100)
- classmethod StrainShell.Last(model)¶
Returns the last initial strain shell in the model
- Parameters:
model (Model) –
Model
to get last initial strain shell in- Returns:
StrainShell object (or None if there are no initial strain shells in the model)
- Return type:
StrainShell
Example
To get the last initial strain shell in model m:
iss = Oasys.PRIMER.StrainShell.Last(m)
- classmethod StrainShell.Pick(prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg, button_text=Oasys.gRPC.defaultArg)¶
Allows the user to pick a initial strain shell
- 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 shells from that model can be picked. If the argument is aFlag
then only initial strain shells that are flagged with limit can be selected. If omitted, or None, any initial strain shells 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:
StrainShell object (or None if not picked)
- Return type:
dict
Example
To pick a initial strain shell from model m giving the prompt ‘Pick initial strain shell from screen’:
iss = Oasys.PRIMER.StrainShell.Pick('Pick initial strain shell from screen', m)
- classmethod StrainShell.Select(flag, prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg)¶
Allows the user to select initial strain shells using standard PRIMER object menus
- Parameters:
flag (Flag) – Flag to use when selecting initial strain shells
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 shells from that model can be selected. If the argument is aFlag
then only initial strain shells that are flagged with limit can be selected (limit should be different to flag). If omitted, or None, any initial strain shells 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 shells selected or None if menu cancelled
- Return type:
int
Example
To select initial strain shells from model m, flagging those selected with flag f, giving the prompt ‘Select initial strain shells’:
Oasys.PRIMER.StrainShell.Select(f, 'Select initial strain shells', m)To select initial strain shells, flagging those selected with flag f but limiting selection to initial strain shells flagged with flag l, giving the prompt ‘Select initial strain shells’:
Oasys.PRIMER.StrainShell.Select(f, 'Select initial strain shells', l)
- classmethod StrainShell.SketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Sketches all of the flagged initial strain shells in the model. The initial strain shells will be sketched until you either call
StrainShell.Unsketch()
,StrainShell.UnsketchFlagged()
,Model.UnsketchAll()
, or delete the model
- Parameters:
model (Model) –
Model
that all the flagged initial strain shells will be sketched inflag (Flag) – Flag set on the initial strain shells that you want to sketch
redraw (boolean) – Optional. If model should be redrawn or not after the initial strain shells are sketched. If omitted redraw is true. If you want to sketch flagged initial strain shells 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 shells flagged with flag in model m:
Oasys.PRIMER.StrainShell.SketchFlagged(m, flag)
- classmethod StrainShell.Total(model, exists=Oasys.gRPC.defaultArg)¶
Returns the total number of initial strain shells in the model
- Parameters:
model (Model) –
Model
to get total forexists (boolean) – Optional. true if only existing initial strain shells should be counted. If false or omitted referenced but undefined initial strain shells will also be included in the total
- Returns:
number of initial strain shells
- Return type:
int
Example
To get the total number of initial strain shells in model m:
total = Oasys.PRIMER.StrainShell.Total(m)
- classmethod StrainShell.UnflagAll(model, flag)¶
Unsets a defined flag on all of the initial strain shells in the model
- Parameters:
model (Model) –
Model
that the defined flag for all initial strain shells will be unset inflag (Flag) – Flag to unset on the initial strain shells
- Returns:
No return value
- Return type:
None
Example
To unset the flag f on all the initial strain shells in model m:
Oasys.PRIMER.StrainShell.UnflagAll(m, f)
- classmethod StrainShell.UnsketchAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all initial strain shells
- Parameters:
model (Model) –
Model
that all initial strain shells will be unblanked inredraw (boolean) – Optional. If model should be redrawn or not after the initial strain 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()
- Returns:
No return value
- Return type:
None
Example
To unsketch all initial strain shells in model m:
Oasys.PRIMER.StrainShell.UnsketchAll(m)
- classmethod StrainShell.UnsketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all flagged initial strain shells in the model
- Parameters:
model (Model) –
Model
that all initial strain shells will be unsketched inflag (Flag) – Flag set on the initial strain shells that you want to unsketch
redraw (boolean) – Optional. If model should be redrawn or not after the initial strain 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()
- Returns:
No return value
- Return type:
None
Example
To unsketch all initial strain shells flagged with flag in model m:
Oasys.PRIMER.StrainShell.UnsketchAll(m, flag)
Instance methods¶
- StrainShell.AssociateComment(comment)¶
Associates a comment with a initial strain shell
- Parameters:
comment (Comment) –
Comment
that will be attached to the initial strain shell- Returns:
No return value
- Return type:
None
Example
To associate comment c to the initial strain shell iss:
iss.AssociateComment(c)
- StrainShell.ClearFlag(flag)¶
Clears a flag on the initial strain shell
- Parameters:
flag (Flag) – Flag to clear on the initial strain shell
- Returns:
No return value
- Return type:
None
Example
To clear flag f for initial strain shell iss:
iss.ClearFlag(f)
- StrainShell.Copy(range=Oasys.gRPC.defaultArg)¶
Copies the initial strain shell. The target include of the copied initial strain shell 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:
StrainShell object
- Return type:
StrainShell
Example
To copy initial strain shell iss into initial strain shell z:
z = iss.Copy()
- StrainShell.DetachComment(comment)¶
Detaches a comment from a initial strain shell
- Parameters:
comment (Comment) –
Comment
that will be detached from the initial strain shell- Returns:
No return value
- Return type:
None
Example
To detach comment c from the initial strain shell iss:
iss.DetachComment(c)
- StrainShell.Flagged(flag)¶
Checks if the initial strain shell is flagged or not
- Parameters:
flag (Flag) – Flag to test on the initial strain shell
- Returns:
True if flagged, False if not
- Return type:
bool
Example
To check if initial strain shell iss has flag f set on it:
if iss.Flagged(f): do_something..
- StrainShell.GetComments()¶
Extracts the comments associated to a initial strain shell
- 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 shell iss:
comm_list = iss.GetComments()
- StrainShell.GetIntegrationPoint(index)¶
Returns the data for a specific integration point as a list. For each integration point there will be 7 strain component values. There are
nplane
xnthick
integration points
- Parameters:
index (integer) – Index you want the integration point data for. Note that indices start at 0
- Returns:
A list containing the integration point data
- Return type:
list
Example
To get the data for the 3rd integration point for initial strain shell iss:
data = iss.GetIntegrationPoint(2)
- StrainShell.GetParameter(prop)¶
Checks if a StrainShell 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 theStrainShell.ViewParameters()
method and ‘method chaining’ (see the examples below)
- Parameters:
prop (string) – initial strain shell property to get parameter for
- Returns:
Parameter object if property is a parameter, None if not
- Return type:
dict
Example
To check if StrainShell property iss.example is a parameter:
Oasys.PRIMER.Options.property_parameter_names = True if iss.GetParameter(iss.example): do_something... Oasys.PRIMER.Options.property_parameter_names = FalseTo check if StrainShell property iss.example is a parameter by using the GetParameter method:
if iss.ViewParameters().GetParameter(iss.example): do_something..
- StrainShell.Keyword()¶
Returns the keyword for this initial strain shell (*INITIAL_STRAIN_SHELL). Note that a carriage return is not added. See also
StrainShell.KeywordCards()
- Returns:
string containing the keyword
- Return type:
str
Example
To get the keyword for strain_shell i:
key = i.Keyword()
- StrainShell.KeywordCards()¶
Returns the keyword cards for the initial strain shell. Note that a carriage return is not added. See also
StrainShell.Keyword()
- Returns:
string containing the cards
- Return type:
str
Example
To get the cards for strain_shell i:
cards = i.KeywordCards()
- StrainShell.Next()¶
Returns the next initial strain shell in the model
- Returns:
StrainShell object (or None if there are no more initial strain shells in the model)
- Return type:
StrainShell
Example
To get the initial strain shell in model m after initial strain shell iss:
iss = iss.Next()
- StrainShell.Previous()¶
Returns the previous initial strain shell in the model
- Returns:
StrainShell object (or None if there are no more initial strain shells in the model)
- Return type:
StrainShell
Example
To get the initial strain shell in model m before initial strain shell iss:
iss = iss.Previous()
- StrainShell.SetFlag(flag)¶
Sets a flag on the initial strain shell
- Parameters:
flag (Flag) – Flag to set on the initial strain shell
- Returns:
No return value
- Return type:
None
Example
To set flag f for initial strain shell iss:
iss.SetFlag(f)
- StrainShell.SetIntegrationPoint(index, data)¶
Set the data for a specific integration point. For each integration point there will be 7 strain component values. There are
nplane
xnthick
integration points
- Parameters:
index (integer) – Index you want the integration point data for. Note that indices start at 0
data (List of data) – List containing the integration point data. The list length should be 7
- Returns:
No return value
- Return type:
None
Example
To set the 3rd integration point data for initial strain shell iss to the values in list adata:
iss.SetIntegrationPoint(2, adata)
- StrainShell.Sketch(redraw=Oasys.gRPC.defaultArg)¶
Sketches the initial strain shell. The initial strain shell will be sketched until you either call
StrainShell.Unsketch()
,StrainShell.UnsketchAll()
,Model.UnsketchAll()
, or delete the model
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the initial strain shell is sketched. If omitted redraw is true. If you want to sketch several initial strain shells 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 shell iss:
iss.Sketch()
- StrainShell.Unsketch(redraw=Oasys.gRPC.defaultArg)¶
Unsketches the initial strain shell
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the initial strain shell is unsketched. If omitted redraw is true. If you want to unsketch several initial strain shells 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 shell iss:
iss.Unsketch()
- StrainShell.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:
StrainShell object
- Return type:
dict
Example
To check if StrainShell property iss.example is a parameter by using the
StrainShell.GetParameter()
method:if iss.ViewParameters().GetParameter(iss.example): do_something..
- StrainShell.Xrefs()¶
Returns the cross references for this initial strain shell
- Returns:
Xrefs object
- Return type:
dict
Example
To get the cross references for initial strain shell iss:
xrefs = iss.Xrefs()