Oasys.PRIMER.StressSection class¶
Properties¶
- property StressSection.csid: integer¶
Cross section ID
- property StressSection.exists(read only): boolean¶
true if stress section exists, false if referred to but not defined
- property StressSection.issid: integer¶
StressSection
number. Also see thelabel
property which is an alternative name for this
- property StressSection.istiff: integer¶
Load curve ID defining the artificial stress fraction versus time
- property StressSection.izshear: integer¶
Shear stress flag
- property StressSection.label: integer¶
StressSection
number. Also see theissid
property which is an alternative name for this
- property StressSection.lcid: integer¶
Load curve ID defining preload stress versus time
- property StressSection.psid: integer¶
Part set ID
- property StressSection.vid: integer¶
Vector ID defining the direction normal to the cross section
Constructor¶
- classmethod StressSection(model, issid, csid, lcid, psid, vid, izshear, istiff=Oasys.gRPC.defaultArg)¶
Create a new
StressSection
object
- Parameters:
model (Model) –
Model
that stress section will be created inissid (integer) –
StressSection
numbercsid (integer) – Cross section ID
lcid (integer) – Load curve ID defining preload stress versus time
psid (integer) – Part set ID
vid (integer) – Vector ID
izshear (integer) – Shear stress flag
istiff (integer) – Optional. Load curve ID defining artificial stress fraction versus time
- Returns:
StressSection object
- Return type:
dict
Example
To create a new stress section in model m with label 11, cross section 12, load curve 13, part set 14, vector 15 and shear stress flag 16:
iss = Oasys.PRIMER.StressSection(m, 11, 12, 13, 14, 15, 16)
Static methods¶
- classmethod StressSection.BlankAll(model, redraw=Oasys.gRPC.defaultArg)¶
Blanks all of the stress sections in the model
- Parameters:
model (Model) –
Model
that all stress sections will be blanked inredraw (boolean) – Optional. 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()
- Returns:
No return value
- Return type:
None
Example
To blank all of the stress sections in model m:
Oasys.PRIMER.StressSection.BlankAll(m)
- classmethod StressSection.BlankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Blanks all of the flagged stress sections in the model
- Parameters:
model (Model) –
Model
that all the flagged stress sections will be blanked inflag (Flag) – Flag set on the stress sections that you want to blank
redraw (boolean) – Optional. 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()
- Returns:
No return value
- Return type:
None
Example
To blank all of the stress sections in model m flagged with f:
Oasys.PRIMER.StressSection.BlankFlagged(m, f)
- classmethod StressSection.Create(model, modal=Oasys.gRPC.defaultArg)¶
Starts an interactive editing panel to create a initial stress section definition
- Parameters:
model (Model) –
Model
that the stress section will be created inmodal (boolean) – Optional. If this window is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the window will be modal
- Returns:
StressSection object (or None if not made)
- Return type:
dict
Example
To start creating a initial stress section definition in model m:
iss = Oasys.PRIMER.StressSection.Create(m)
- classmethod StressSection.First(model)¶
Returns the first stress section in the model
- Parameters:
model (Model) –
Model
to get first stress section in- Returns:
StressSection object (or None if there are no stress sections in the model)
- Return type:
StressSection
Example
To get the first stress section in model m:
iss = Oasys.PRIMER.StressSection.First(m)
- classmethod StressSection.FirstFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the first free stress section label in the model. Also see
StressSection.LastFreeLabel()
,StressSection.NextFreeLabel()
andModel.FirstFreeItemLabel()
- Parameters:
- Returns:
StressSection label
- Return type:
int
Example
To get the first free stress section label in model m:
label = Oasys.PRIMER.StressSection.FirstFreeLabel(m)
- classmethod StressSection.FlagAll(model, flag)¶
Flags all of the stress sections in the model with a defined flag
- Parameters:
model (Model) –
Model
that all stress sections will be flagged inflag (Flag) – Flag to set on the stress sections
- Returns:
No return value
- Return type:
None
Example
To flag all of the stress sections with flag f in model m:
Oasys.PRIMER.StressSection.FlagAll(m, f)
- classmethod StressSection.GetAll(model)¶
Returns a list of StressSection objects for all of the stress sections in a model in PRIMER
- Parameters:
model (Model) –
Model
to get stress sections from- Returns:
List of StressSection objects
- Return type:
list
Example
To make a list of StressSection objects for all of the stress sections in model m
iss = Oasys.PRIMER.StressSection.GetAll(m)
- classmethod StressSection.GetFlagged(model, flag)¶
Returns a list of StressSection objects for all of the flagged stress sections in a model in PRIMER
- Parameters:
model (Model) –
Model
to get stress sections fromflag (Flag) – Flag set on the stress sections that you want to retrieve
- Returns:
List of StressSection objects
- Return type:
list
Example
To make a list of StressSection objects for all of the stress sections in model m flagged with f
iss = Oasys.PRIMER.StressSection.GetFlagged(m, f)
- classmethod StressSection.GetFromID(model, number)¶
Returns the StressSection object for a stress section ID
- Parameters:
model (Model) –
Model
to find the stress section innumber (integer) – number of the stress section you want the StressSection object for
- Returns:
StressSection object (or None if stress section does not exist)
- Return type:
StressSection
Example
To get the StressSection object for stress section 100 in model m
iss = Oasys.PRIMER.StressSection.GetFromID(m, 100)
- classmethod StressSection.Last(model)¶
Returns the last stress section in the model
- Parameters:
model (Model) –
Model
to get last stress section in- Returns:
StressSection object (or None if there are no stress sections in the model)
- Return type:
StressSection
Example
To get the last stress section in model m:
iss = Oasys.PRIMER.StressSection.Last(m)
- classmethod StressSection.LastFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the last free stress section label in the model. Also see
StressSection.FirstFreeLabel()
,StressSection.NextFreeLabel()
and seeModel.LastFreeItemLabel()
- Parameters:
- Returns:
StressSection label
- Return type:
int
Example
To get the last free stress section label in model m:
label = Oasys.PRIMER.StressSection.LastFreeLabel(m)
- classmethod StressSection.NextFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the next free (highest+1) stress section label in the model. Also see
StressSection.FirstFreeLabel()
,StressSection.LastFreeLabel()
andModel.NextFreeItemLabel()
- Parameters:
- Returns:
StressSection label
- Return type:
int
Example
To get the next free stress section label in model m:
label = Oasys.PRIMER.StressSection.NextFreeLabel(m)
- classmethod StressSection.RenumberAll(model, start)¶
Renumbers all of the stress sections in the model
- Parameters:
model (Model) –
Model
that all stress sections will be renumbered instart (integer) – Start point for renumbering
- Returns:
No return value
- Return type:
None
Example
To renumber all of the stress sections in model m, from 1000000:
Oasys.PRIMER.StressSection.RenumberAll(m, 1000000)
- classmethod StressSection.RenumberFlagged(model, flag, start)¶
Renumbers all of the flagged stress sections in the model
- Parameters:
model (Model) –
Model
that all the flagged stress sections will be renumbered inflag (Flag) – Flag set on the stress sections that you want to renumber
start (integer) – Start point for renumbering
- Returns:
No return value
- Return type:
None
Example
To renumber all of the stress sections in model m flagged with f, from 1000000:
Oasys.PRIMER.StressSection.RenumberFlagged(m, f, 1000000)
- classmethod StressSection.Select(flag, prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg)¶
Allows the user to select stress sections using standard PRIMER object menus
- Parameters:
flag (Flag) – Flag to use when selecting stress sections
prompt (string) – Text to display as a prompt to the user
limit (Model or Flag) – Optional. If the argument is a
Model
then only stress sections from that model can be selected. If the argument is aFlag
then only stress sections that are flagged with limit can be selected (limit should be different to flag). If omitted, or None, any stress sections 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 stress sections selected or None if menu cancelled
- Return type:
int
Example
To select stress sections from model m, flagging those selected with flag f, giving the prompt ‘Select stress sections’:
Oasys.PRIMER.StressSection.Select(f, 'Select stress sections', m)To select stress sections, flagging those selected with flag f but limiting selection to stress sections flagged with flag l, giving the prompt ‘Select stress sections’:
Oasys.PRIMER.StressSection.Select(f, 'Select stress sections', l)
- classmethod StressSection.SketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Sketches all of the flagged stress sections in the model. The stress sections will be sketched until you either call
StressSection.Unsketch()
,StressSection.UnsketchFlagged()
,Model.UnsketchAll()
, or delete the model
- Parameters:
model (Model) –
Model
that all the flagged stress sections will be sketched inflag (Flag) – Flag set on the stress sections that you want to sketch
redraw (boolean) – Optional. If model should be redrawn or not after the stress sections are sketched. If omitted redraw is true. If you want to sketch flagged stress sections 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 stress sections flagged with flag in model m:
Oasys.PRIMER.StressSection.SketchFlagged(m, flag)
- classmethod StressSection.Total(model, exists=Oasys.gRPC.defaultArg)¶
Returns the total number of stress sections in the model
- Parameters:
model (Model) –
Model
to get total forexists (boolean) – Optional. true if only existing stress sections should be counted. If false or omitted referenced but undefined stress sections will also be included in the total
- Returns:
number of stress sections
- Return type:
int
Example
To get the total number of stress sections in model m:
total = Oasys.PRIMER.StressSection.Total(m)
- classmethod StressSection.UnblankAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unblanks all of the stress sections in the model
- Parameters:
model (Model) –
Model
that all stress sections will be unblanked inredraw (boolean) – Optional. 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()
- Returns:
No return value
- Return type:
None
Example
To unblank all of the stress sections in model m:
Oasys.PRIMER.StressSection.UnblankAll(m)
- classmethod StressSection.UnblankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unblanks all of the flagged stress sections in the model
- Parameters:
model (Model) –
Model
that the flagged stress sections will be unblanked inflag (Flag) – Flag set on the stress sections that you want to unblank
redraw (boolean) – Optional. 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()
- Returns:
No return value
- Return type:
None
Example
To unblank all of the stress sections in model m flagged with f:
Oasys.PRIMER.StressSection.UnblankFlagged(m, f)
- classmethod StressSection.UnflagAll(model, flag)¶
Unsets a defined flag on all of the stress sections in the model
- Parameters:
model (Model) –
Model
that the defined flag for all stress sections will be unset inflag (Flag) – Flag to unset on the stress sections
- Returns:
No return value
- Return type:
None
Example
To unset the flag f on all the stress sections in model m:
Oasys.PRIMER.StressSection.UnflagAll(m, f)
- classmethod StressSection.UnsketchAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all stress sections
- Parameters:
model (Model) –
Model
that all stress sections will be unblanked inredraw (boolean) – Optional. If model should be redrawn or not after the stress sections 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 stress sections in model m:
Oasys.PRIMER.StressSection.UnsketchAll(m)
- classmethod StressSection.UnsketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all flagged stress sections in the model
- Parameters:
model (Model) –
Model
that all stress sections will be unsketched inflag (Flag) – Flag set on the stress sections that you want to unsketch
redraw (boolean) – Optional. If model should be redrawn or not after the stress sections 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 stress sections flagged with flag in model m:
Oasys.PRIMER.StressSection.UnsketchAll(m, flag)
Instance methods¶
- StressSection.AssociateComment(comment)¶
Associates a comment with a stress section
- Parameters:
comment (Comment) –
Comment
that will be attached to the stress section- Returns:
No return value
- Return type:
None
Example
To associate comment c to the stress section iss:
iss.AssociateComment(c)
- StressSection.Blank()¶
Blanks the stress section
- Returns:
No return value
- Return type:
None
Example
To blank stress section iss:
iss.Blank()
- StressSection.Blanked()¶
Checks if the stress section is blanked or not
- Returns:
True if blanked, False if not
- Return type:
bool
Example
To check if stress section iss is blanked:
if iss.Blanked(): do_something..
- StressSection.Browse(modal=Oasys.gRPC.defaultArg)¶
Starts an edit panel in Browse mode
- Parameters:
modal (boolean) – Optional. If this window is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the window will be modal
- Returns:
no return value
- Return type:
None
Example
To Browse stress section iss:
iss.Browse()
- StressSection.ClearFlag(flag)¶
Clears a flag on the stress section
- Parameters:
flag (Flag) – Flag to clear on the stress section
- Returns:
No return value
- Return type:
None
Example
To clear flag f for stress section iss:
iss.ClearFlag(f)
- StressSection.Copy(range=Oasys.gRPC.defaultArg)¶
Copies the stress section. The target include of the copied stress section 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:
StressSection object
- Return type:
StressSection
Example
To copy stress section iss into stress section z:
z = iss.Copy()
- StressSection.DetachComment(comment)¶
Detaches a comment from a stress section
- Parameters:
comment (Comment) –
Comment
that will be detached from the stress section- Returns:
No return value
- Return type:
None
Example
To detach comment c from the stress section iss:
iss.DetachComment(c)
- StressSection.Edit(modal=Oasys.gRPC.defaultArg)¶
Starts an interactive editing panel
- Parameters:
modal (boolean) – Optional. If this window is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the window will be modal
- Returns:
no return value
- Return type:
None
Example
To Edit stress section iss:
iss.Edit()
- StressSection.Flagged(flag)¶
Checks if the stress section is flagged or not
- Parameters:
flag (Flag) – Flag to test on the stress section
- Returns:
True if flagged, False if not
- Return type:
bool
Example
To check if stress section iss has flag f set on it:
if iss.Flagged(f): do_something..
- StressSection.GetComments()¶
Extracts the comments associated to a stress section
- 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 stress section iss:
comm_list = iss.GetComments()
- StressSection.GetParameter(prop)¶
Checks if a StressSection 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 theStressSection.ViewParameters()
method and ‘method chaining’ (see the examples below)
- Parameters:
prop (string) – stress section property to get parameter for
- Returns:
Parameter object if property is a parameter, None if not
- Return type:
dict
Example
To check if StressSection 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 StressSection property iss.example is a parameter by using the GetParameter method:
if iss.ViewParameters().GetParameter(iss.example): do_something..
- StressSection.Keyword()¶
Returns the keyword for this stress section. Note that a carriage return is not added. See also
StressSection.KeywordCards()
- Returns:
string containing the keyword
- Return type:
str
Example
To get the keyword for stress section iss:
key = iss.Keyword()
- StressSection.KeywordCards()¶
Returns the keyword cards for the stress section. Note that a carriage return is not added. See also
StressSection.Keyword()
- Returns:
string containing the cards
- Return type:
str
Example
To get the cards for stress section iss:
cards = iss.KeywordCards()
- StressSection.Next()¶
Returns the next stress section in the model
- Returns:
StressSection object (or None if there are no more stress sections in the model)
- Return type:
StressSection
Example
To get the stress section in model m after stress section iss:
iss = iss.Next()
- StressSection.Previous()¶
Returns the previous stress section in the model
- Returns:
StressSection object (or None if there are no more stress sections in the model)
- Return type:
StressSection
Example
To get the stress section in model m before stress section iss:
iss = iss.Previous()
- StressSection.SetFlag(flag)¶
Sets a flag on the stress section
- Parameters:
flag (Flag) – Flag to set on the stress section
- Returns:
No return value
- Return type:
None
Example
To set flag f for stress section iss:
iss.SetFlag(f)
- StressSection.Sketch(redraw=Oasys.gRPC.defaultArg)¶
Sketches the stress section. The stress section will be sketched until you either call
StressSection.Unsketch()
,StressSection.UnsketchAll()
,Model.UnsketchAll()
, or delete the model
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the stress section is sketched. If omitted redraw is true. If you want to sketch several stress sections 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 stress section iss:
iss.Sketch()
- StressSection.Unblank()¶
Unblanks the stress section
- Returns:
No return value
- Return type:
None
Example
To unblank stress section iss:
iss.Unblank()
- StressSection.Unsketch(redraw=Oasys.gRPC.defaultArg)¶
Unsketches the stress section
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the stress section is unsketched. If omitted redraw is true. If you want to unsketch several stress sections 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 stress section iss:
iss.Unsketch()
- StressSection.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:
StressSection object
- Return type:
dict
Example
To check if StressSection property iss.example is a parameter by using the
StressSection.GetParameter()
method:if iss.ViewParameters().GetParameter(iss.example): do_something..
- StressSection.Xrefs()¶
Returns the cross references for this stress section
- Returns:
Xrefs object
- Return type:
dict
Example
To get the cross references for stress section iss:
xrefs = iss.Xrefs()