Oasys.PRIMER.LoadShell class¶
Constants¶
Properties¶
- property LoadShell.at: float¶
Arrival time for pressure
- property LoadShell.exists(read only): boolean¶
true if LoadShell exists, false if referred to but not defined
- property LoadShell.id: boolean¶
true if _ID option is set, false if not
- property LoadShell.sf: float¶
Curve scale factor
- property LoadShell.type: constant¶
The Load Node type. Can be
LoadShell.ELEMENT
orLoadShell.SET
Constructor¶
- classmethod LoadShell(model, type, eid, lcid, sf=Oasys.gRPC.defaultArg, at=Oasys.gRPC.defaultArg, lsid=Oasys.gRPC.defaultArg, heading=Oasys.gRPC.defaultArg)¶
Create a new
LoadShell
object
- Parameters:
model (Model) –
Model
that LoadShell will be created intype (constant) – Specify the type of LoadShell (Can be
LoadShell.ELEMENT
orLoadShell.SET
)eid (integer) –
Shell
ID or shell set IDlcid (integer) –
Curve
IDsf (float) – Optional. Curve scale factor
at (float) – Optional. Arrival time for pressure
lsid (integer) – Optional.
LoadShell
numberheading (string) – Optional. Title for the LoadShell
- Returns:
LoadShell object
- Return type:
dict
Example
To create a new load shell in model m, of type SET, with loadcurve 9 and a scale factor of 0.5
b = Oasys.PRIMER.LoadShell(m, Oasys.PRIMER.LoadShell.SET, 100, 2, 9, 0.5)
Static methods¶
- classmethod LoadShell.BlankAll(model, redraw=Oasys.gRPC.defaultArg)¶
Blanks all of the load shells in the model
- Parameters:
model (Model) –
Model
that all load shells 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 load shells in model m:
Oasys.PRIMER.LoadShell.BlankAll(m)
- classmethod LoadShell.BlankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Blanks all of the flagged load shells in the model
- Parameters:
model (Model) –
Model
that all the flagged load shells will be blanked inflag (Flag) – Flag set on the load shells 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 load shells in model m flagged with f:
Oasys.PRIMER.LoadShell.BlankFlagged(m, f)
- classmethod LoadShell.First(model)¶
Returns the first load shell in the model
- Parameters:
model (Model) –
Model
to get first load shell in- Returns:
LoadShell object (or None if there are no load shells in the model)
- Return type:
LoadShell
Example
To get the first load shell in model m:
ls = Oasys.PRIMER.LoadShell.First(m)
- classmethod LoadShell.FirstFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the first free load shell label in the model. Also see
LoadShell.LastFreeLabel()
,LoadShell.NextFreeLabel()
andModel.FirstFreeItemLabel()
- Parameters:
- Returns:
LoadShell label
- Return type:
int
Example
To get the first free load shell label in model m:
label = Oasys.PRIMER.LoadShell.FirstFreeLabel(m)
- classmethod LoadShell.FlagAll(model, flag)¶
Flags all of the load shells in the model with a defined flag
- Parameters:
model (Model) –
Model
that all load shells will be flagged inflag (Flag) – Flag to set on the load shells
- Returns:
No return value
- Return type:
None
Example
To flag all of the load shells with flag f in model m:
Oasys.PRIMER.LoadShell.FlagAll(m, f)
- classmethod LoadShell.GetAll(model)¶
Returns a list of LoadShell objects for all of the load shells in a model in PRIMER
- Parameters:
model (Model) –
Model
to get load shells from- Returns:
List of LoadShell objects
- Return type:
list
Example
To make a list of LoadShell objects for all of the load shells in model m
ls = Oasys.PRIMER.LoadShell.GetAll(m)
- classmethod LoadShell.GetFlagged(model, flag)¶
Returns a list of LoadShell objects for all of the flagged load shells in a model in PRIMER
- Parameters:
model (Model) –
Model
to get load shells fromflag (Flag) – Flag set on the load shells that you want to retrieve
- Returns:
List of LoadShell objects
- Return type:
list
Example
To make a list of LoadShell objects for all of the load shells in model m flagged with f
ls = Oasys.PRIMER.LoadShell.GetFlagged(m, f)
- classmethod LoadShell.GetFromID(model, number)¶
Returns the LoadShell object for a load shell ID
- Parameters:
model (Model) –
Model
to find the load shell innumber (integer) – number of the load shell you want the LoadShell object for
- Returns:
LoadShell object (or None if load shell does not exist)
- Return type:
LoadShell
Example
To get the LoadShell object for load shell 100 in model m
ls = Oasys.PRIMER.LoadShell.GetFromID(m, 100)
- classmethod LoadShell.Last(model)¶
Returns the last load shell in the model
- Parameters:
model (Model) –
Model
to get last load shell in- Returns:
LoadShell object (or None if there are no load shells in the model)
- Return type:
LoadShell
Example
To get the last load shell in model m:
ls = Oasys.PRIMER.LoadShell.Last(m)
- classmethod LoadShell.LastFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the last free load shell label in the model. Also see
LoadShell.FirstFreeLabel()
,LoadShell.NextFreeLabel()
and seeModel.LastFreeItemLabel()
- Parameters:
- Returns:
LoadShell label
- Return type:
int
Example
To get the last free load shell label in model m:
label = Oasys.PRIMER.LoadShell.LastFreeLabel(m)
- classmethod LoadShell.NextFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the next free (highest+1) load shell label in the model. Also see
LoadShell.FirstFreeLabel()
,LoadShell.LastFreeLabel()
andModel.NextFreeItemLabel()
- Parameters:
- Returns:
LoadShell label
- Return type:
int
Example
To get the next free load shell label in model m:
label = Oasys.PRIMER.LoadShell.NextFreeLabel(m)
- classmethod LoadShell.Pick(prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg, button_text=Oasys.gRPC.defaultArg)¶
Allows the user to pick a load 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 load shells from that model can be picked. If the argument is aFlag
then only load shells that are flagged with limit can be selected. If omitted, or None, any load 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:
LoadShell object (or None if not picked)
- Return type:
dict
Example
To pick a load shell from model m giving the prompt ‘Pick load shell from screen’:
ls = Oasys.PRIMER.LoadShell.Pick('Pick load shell from screen', m)
- classmethod LoadShell.RenumberAll(model, start)¶
Renumbers all of the load shells in the model
- Parameters:
model (Model) –
Model
that all load shells will be renumbered instart (integer) – Start point for renumbering
- Returns:
No return value
- Return type:
None
Example
To renumber all of the load shells in model m, from 1000000:
Oasys.PRIMER.LoadShell.RenumberAll(m, 1000000)
- classmethod LoadShell.RenumberFlagged(model, flag, start)¶
Renumbers all of the flagged load shells in the model
- Parameters:
model (Model) –
Model
that all the flagged load shells will be renumbered inflag (Flag) – Flag set on the load shells that you want to renumber
start (integer) – Start point for renumbering
- Returns:
No return value
- Return type:
None
Example
To renumber all of the load shells in model m flagged with f, from 1000000:
Oasys.PRIMER.LoadShell.RenumberFlagged(m, f, 1000000)
- classmethod LoadShell.Select(flag, prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg)¶
Allows the user to select load shells using standard PRIMER object menus
- Parameters:
flag (Flag) – Flag to use when selecting load 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 load shells from that model can be selected. If the argument is aFlag
then only load shells that are flagged with limit can be selected (limit should be different to flag). If omitted, or None, any load 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 load shells selected or None if menu cancelled
- Return type:
int
Example
To select load shells from model m, flagging those selected with flag f, giving the prompt ‘Select load shells’:
Oasys.PRIMER.LoadShell.Select(f, 'Select load shells', m)To select load shells, flagging those selected with flag f but limiting selection to load shells flagged with flag l, giving the prompt ‘Select load shells’:
Oasys.PRIMER.LoadShell.Select(f, 'Select load shells', l)
- classmethod LoadShell.SketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Sketches all of the flagged load shells in the model. The load shells will be sketched until you either call
LoadShell.Unsketch()
,LoadShell.UnsketchFlagged()
,Model.UnsketchAll()
, or delete the model
- Parameters:
model (Model) –
Model
that all the flagged load shells will be sketched inflag (Flag) – Flag set on the load shells that you want to sketch
redraw (boolean) – Optional. If model should be redrawn or not after the load shells are sketched. If omitted redraw is true. If you want to sketch flagged load 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 load shells flagged with flag in model m:
Oasys.PRIMER.LoadShell.SketchFlagged(m, flag)
- classmethod LoadShell.Total(model, exists=Oasys.gRPC.defaultArg)¶
Returns the total number of load shells in the model
- Parameters:
model (Model) –
Model
to get total forexists (boolean) – Optional. true if only existing load shells should be counted. If false or omitted referenced but undefined load shells will also be included in the total
- Returns:
number of load shells
- Return type:
int
Example
To get the total number of load shells in model m:
total = Oasys.PRIMER.LoadShell.Total(m)
- classmethod LoadShell.UnblankAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unblanks all of the load shells in the model
- Parameters:
model (Model) –
Model
that all load shells 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 load shells in model m:
Oasys.PRIMER.LoadShell.UnblankAll(m)
- classmethod LoadShell.UnblankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unblanks all of the flagged load shells in the model
- Parameters:
model (Model) –
Model
that the flagged load shells will be unblanked inflag (Flag) – Flag set on the load shells 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 load shells in model m flagged with f:
Oasys.PRIMER.LoadShell.UnblankFlagged(m, f)
- classmethod LoadShell.UnflagAll(model, flag)¶
Unsets a defined flag on all of the load shells in the model
- Parameters:
model (Model) –
Model
that the defined flag for all load shells will be unset inflag (Flag) – Flag to unset on the load shells
- Returns:
No return value
- Return type:
None
Example
To unset the flag f on all the load shells in model m:
Oasys.PRIMER.LoadShell.UnflagAll(m, f)
- classmethod LoadShell.UnsketchAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all load shells
- Parameters:
model (Model) –
Model
that all load shells will be unblanked inredraw (boolean) – Optional. If model should be redrawn or not after the load 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 load shells in model m:
Oasys.PRIMER.LoadShell.UnsketchAll(m)
- classmethod LoadShell.UnsketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all flagged load shells in the model
- Parameters:
model (Model) –
Model
that all load shells will be unsketched inflag (Flag) – Flag set on the load shells that you want to unsketch
redraw (boolean) – Optional. If model should be redrawn or not after the load 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 load shells flagged with flag in model m:
Oasys.PRIMER.LoadShell.UnsketchAll(m, flag)
Instance methods¶
- LoadShell.AssociateComment(comment)¶
Associates a comment with a load shell
- Parameters:
comment (Comment) –
Comment
that will be attached to the load shell- Returns:
No return value
- Return type:
None
Example
To associate comment c to the load shell ls:
ls.AssociateComment(c)
- LoadShell.Blank()¶
Blanks the load shell
- Returns:
No return value
- Return type:
None
Example
To blank load shell ls:
ls.Blank()
- LoadShell.Blanked()¶
Checks if the load shell is blanked or not
- Returns:
True if blanked, False if not
- Return type:
bool
Example
To check if load shell ls is blanked:
if ls.Blanked(): do_something..
- LoadShell.ClearFlag(flag)¶
Clears a flag on the load shell
- Parameters:
flag (Flag) – Flag to clear on the load shell
- Returns:
No return value
- Return type:
None
Example
To clear flag f for load shell ls:
ls.ClearFlag(f)
- LoadShell.Copy(range=Oasys.gRPC.defaultArg)¶
Copies the load shell. The target include of the copied load 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:
LoadShell object
- Return type:
LoadShell
Example
To copy load shell ls into load shell z:
z = ls.Copy()
- LoadShell.DetachComment(comment)¶
Detaches a comment from a load shell
- Parameters:
comment (Comment) –
Comment
that will be detached from the load shell- Returns:
No return value
- Return type:
None
Example
To detach comment c from the load shell ls:
ls.DetachComment(c)
- LoadShell.Flagged(flag)¶
Checks if the load shell is flagged or not
- Parameters:
flag (Flag) – Flag to test on the load shell
- Returns:
True if flagged, False if not
- Return type:
bool
Example
To check if load shell ls has flag f set on it:
if ls.Flagged(f): do_something..
- LoadShell.GetComments()¶
Extracts the comments associated to a load 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 load shell ls:
comm_list = ls.GetComments()
- LoadShell.GetParameter(prop)¶
Checks if a LoadShell 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 theLoadShell.ViewParameters()
method and ‘method chaining’ (see the examples below)
- Parameters:
prop (string) – load shell property to get parameter for
- Returns:
Parameter object if property is a parameter, None if not
- Return type:
dict
Example
To check if LoadShell property ls.example is a parameter:
Oasys.PRIMER.Options.property_parameter_names = True if ls.GetParameter(ls.example): do_something... Oasys.PRIMER.Options.property_parameter_names = FalseTo check if LoadShell property ls.example is a parameter by using the GetParameter method:
if ls.ViewParameters().GetParameter(ls.example): do_something..
- LoadShell.Keyword()¶
Returns the keyword for this LoadShell (*LOAD_SHELL_xxxx). Note that a carriage return is not added. See also
LoadShell.KeywordCards()
- Returns:
string containing the keyword
- Return type:
str
Example
To get the keyword for LoadShell m:
key = m.Keyword()
- LoadShell.KeywordCards()¶
Returns the keyword cards for the LoadShell. Note that a carriage return is not added. See also
LoadShell.Keyword()
- Returns:
string containing the cards
- Return type:
str
Example
To get the cards for LoadShell l:
cards = l.KeywordCards()
- LoadShell.Next()¶
Returns the next load shell in the model
- Returns:
LoadShell object (or None if there are no more load shells in the model)
- Return type:
LoadShell
Example
To get the load shell in model m after load shell ls:
ls = ls.Next()
- LoadShell.Previous()¶
Returns the previous load shell in the model
- Returns:
LoadShell object (or None if there are no more load shells in the model)
- Return type:
LoadShell
Example
To get the load shell in model m before load shell ls:
ls = ls.Previous()
- LoadShell.SetFlag(flag)¶
Sets a flag on the load shell
- Parameters:
flag (Flag) – Flag to set on the load shell
- Returns:
No return value
- Return type:
None
Example
To set flag f for load shell ls:
ls.SetFlag(f)
- LoadShell.Sketch(redraw=Oasys.gRPC.defaultArg)¶
Sketches the load shell. The load shell will be sketched until you either call
LoadShell.Unsketch()
,LoadShell.UnsketchAll()
,Model.UnsketchAll()
, or delete the model
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the load shell is sketched. If omitted redraw is true. If you want to sketch several load 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 load shell ls:
ls.Sketch()
- LoadShell.Unblank()¶
Unblanks the load shell
- Returns:
No return value
- Return type:
None
Example
To unblank load shell ls:
ls.Unblank()
- LoadShell.Unsketch(redraw=Oasys.gRPC.defaultArg)¶
Unsketches the load shell
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the load shell is unsketched. If omitted redraw is true. If you want to unsketch several load 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 load shell ls:
ls.Unsketch()
- LoadShell.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:
LoadShell object
- Return type:
dict
Example
To check if LoadShell property ls.example is a parameter by using the
LoadShell.GetParameter()
method:if ls.ViewParameters().GetParameter(ls.example): do_something..
- LoadShell.Xrefs()¶
Returns the cross references for this load shell
- Returns:
Xrefs object
- Return type:
dict
Example
To get the cross references for load shell ls:
xrefs = ls.Xrefs()