Oasys.PRIMER.LoadBodyGeneralized class¶
Constants¶
Properties¶
- property LoadBodyGeneralized.angtyp: string¶
Type of body loads
- property LoadBodyGeneralized.ax: float¶
Scale factor for acceleration in x-direction
- property LoadBodyGeneralized.ay: float¶
Scale factor for acceleration in y-direction
- property LoadBodyGeneralized.az: float¶
Scale factor for acceleration in z-direction
- property LoadBodyGeneralized.cid: integer¶
Coordinate system ID to define acceleration
- property LoadBodyGeneralized.exists(read only): boolean¶
true if load body generalized exists, false if referred to but not defined
- property LoadBodyGeneralized.include: integer¶
The
Include
file number that the load body generalized is in
- property LoadBodyGeneralized.model(read only): integer¶
The
Model
number that the load body generalized is in
- property LoadBodyGeneralized.n1: integer¶
Beginning
Node
ID for body force load or the node orPart
set ID
- property LoadBodyGeneralized.n2: integer¶
Ending
Node
ID for body force load. Set to zero if a set ID is defined
- property LoadBodyGeneralized.omx: float¶
Scale factor for x-angular velocity or acceleration
- property LoadBodyGeneralized.omy: float¶
Scale factor for y-angular velocity or acceleration
- property LoadBodyGeneralized.omz: float¶
Scale factor for z-angular velocity or acceleration
- property LoadBodyGeneralized.type: constant¶
The Load Node type, can be
LoadBodyGeneralized.NODE
orLoadBodyGeneralized.SET_NODE
orLoadBodyGeneralized.SET_PART
- property LoadBodyGeneralized.xc: float¶
X-center of rotation
- property LoadBodyGeneralized.yc: float¶
Y-center of rotation
- property LoadBodyGeneralized.zc: float¶
Z-center of rotation
Constructor¶
- classmethod LoadBodyGeneralized(model, type, n1, n2, lcid, drlcid=Oasys.gRPC.defaultArg, xc=Oasys.gRPC.defaultArg, yc=Oasys.gRPC.defaultArg, zc=Oasys.gRPC.defaultArg, ax=Oasys.gRPC.defaultArg, ay=Oasys.gRPC.defaultArg, az=Oasys.gRPC.defaultArg, omx=Oasys.gRPC.defaultArg, omy=Oasys.gRPC.defaultArg, omz=Oasys.gRPC.defaultArg, cid=Oasys.gRPC.defaultArg, angtyp=Oasys.gRPC.defaultArg)¶
Create a new
LoadBodyGeneralized
object
- Parameters:
model (Model) –
Model
that load body generalized will be created intype (constant) – Specify the type of load body generalized (Can be
LoadBodyGeneralized.NODE
orLoadBodyGeneralized.SET_NODE
orLoadBodyGeneralized.SET_PART
)n1 (integer) – Beginning
Node
ID for body force load or the node orPart
set IDn2 (integer) – Ending
Node
ID for body force load. Set to zero if a set ID is definedlcid (integer) –
Curve
IDdrlcid (integer) – Optional.
Curve
ID for dynamic relaxation phasexc (float) – Optional. X-center of rotation
yc (float) – Optional. Y-center of rotation
zc (float) – Optional. Z-center of rotation
ax (float) – Optional. Scale factor for acceleration in x-direction
ay (float) – Optional. Scale factor for acceleration in y-direction
az (float) – Optional. Scale factor for acceleration in z-direction
omx (float) – Optional. Scale factor for x-angular velocity or acceleration
omy (float) – Optional. Scale factor for y-angular velocity or acceleration
omz (float) – Optional. Scale factor for z-angular velocity or acceleration
cid (integer) – Optional. Coordinate system ID to define acceleration
angtyp (string) – Optional. Type of body loads
- Returns:
LoadBodyGeneralized object
- Return type:
dict
Example
To create a new load body generalized in model m, of type SET_NODE, with LCID 9 and N2 is 2
b = Oasys.PRIMER.LoadBodyGeneralized(m, Oasys.PRIMER.LoadBodyGeneralized.SET_NODE, 100, 2, 9)
Static methods¶
- classmethod LoadBodyGeneralized.BlankAll(model, redraw=Oasys.gRPC.defaultArg)¶
Blanks all of the load body generalizeds in the model
- Parameters:
model (Model) –
Model
that all load body generalizeds 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 body generalizeds in model m:
Oasys.PRIMER.LoadBodyGeneralized.BlankAll(m)
- classmethod LoadBodyGeneralized.BlankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Blanks all of the flagged load body generalizeds in the model
- Parameters:
model (Model) –
Model
that all the flagged load body generalizeds will be blanked inflag (Flag) – Flag set on the load body generalizeds 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 body generalizeds in model m flagged with f:
Oasys.PRIMER.LoadBodyGeneralized.BlankFlagged(m, f)
- classmethod LoadBodyGeneralized.First(model)¶
Returns the first load body generalized in the model
- Parameters:
model (Model) –
Model
to get first load body generalized in- Returns:
LoadBodyGeneralized object (or None if there are no load body generalizeds in the model)
- Return type:
LoadBodyGeneralized
Example
To get the first load body generalized in model m:
lbg = Oasys.PRIMER.LoadBodyGeneralized.First(m)
- classmethod LoadBodyGeneralized.FlagAll(model, flag)¶
Flags all of the load body generalizeds in the model with a defined flag
- Parameters:
model (Model) –
Model
that all load body generalizeds will be flagged inflag (Flag) – Flag to set on the load body generalizeds
- Returns:
No return value
- Return type:
None
Example
To flag all of the load body generalizeds with flag f in model m:
Oasys.PRIMER.LoadBodyGeneralized.FlagAll(m, f)
- classmethod LoadBodyGeneralized.GetAll(model)¶
Returns a list of LoadBodyGeneralized objects for all of the load body generalizeds in a model in PRIMER
- Parameters:
model (Model) –
Model
to get load body generalizeds from- Returns:
List of LoadBodyGeneralized objects
- Return type:
list
Example
To make a list of LoadBodyGeneralized objects for all of the load body generalizeds in model m
lbg = Oasys.PRIMER.LoadBodyGeneralized.GetAll(m)
- classmethod LoadBodyGeneralized.GetFlagged(model, flag)¶
Returns a list of LoadBodyGeneralized objects for all of the flagged load body generalizeds in a model in PRIMER
- Parameters:
model (Model) –
Model
to get load body generalizeds fromflag (Flag) – Flag set on the load body generalizeds that you want to retrieve
- Returns:
List of LoadBodyGeneralized objects
- Return type:
list
Example
To make a list of LoadBodyGeneralized objects for all of the load body generalizeds in model m flagged with f
lbg = Oasys.PRIMER.LoadBodyGeneralized.GetFlagged(m, f)
- classmethod LoadBodyGeneralized.GetFromID(model, number)¶
Returns the LoadBodyGeneralized object for a load body generalized ID
- Parameters:
model (Model) –
Model
to find the load body generalized innumber (integer) – number of the load body generalized you want the LoadBodyGeneralized object for
- Returns:
LoadBodyGeneralized object (or None if load body generalized does not exist)
- Return type:
LoadBodyGeneralized
Example
To get the LoadBodyGeneralized object for load body generalized 100 in model m
lbg = Oasys.PRIMER.LoadBodyGeneralized.GetFromID(m, 100)
- classmethod LoadBodyGeneralized.Last(model)¶
Returns the last load body generalized in the model
- Parameters:
model (Model) –
Model
to get last load body generalized in- Returns:
LoadBodyGeneralized object (or None if there are no load body generalizeds in the model)
- Return type:
LoadBodyGeneralized
Example
To get the last load body generalized in model m:
lbg = Oasys.PRIMER.LoadBodyGeneralized.Last(m)
- classmethod LoadBodyGeneralized.Pick(prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg, button_text=Oasys.gRPC.defaultArg)¶
Allows the user to pick a load body generalized
- 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 body generalizeds from that model can be picked. If the argument is aFlag
then only load body generalizeds that are flagged with limit can be selected. If omitted, or None, any load body generalizeds 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:
LoadBodyGeneralized object (or None if not picked)
- Return type:
dict
Example
To pick a load body generalized from model m giving the prompt ‘Pick load body generalized from screen’:
lbg = Oasys.PRIMER.LoadBodyGeneralized.Pick('Pick load body generalized from screen', m)
- classmethod LoadBodyGeneralized.Select(flag, prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg)¶
Allows the user to select load body generalizeds using standard PRIMER object menus
- Parameters:
flag (Flag) – Flag to use when selecting load body generalizeds
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 body generalizeds from that model can be selected. If the argument is aFlag
then only load body generalizeds that are flagged with limit can be selected (limit should be different to flag). If omitted, or None, any load body generalizeds 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 body generalizeds selected or None if menu cancelled
- Return type:
int
Example
To select load body generalizeds from model m, flagging those selected with flag f, giving the prompt ‘Select load body generalizeds’:
Oasys.PRIMER.LoadBodyGeneralized.Select(f, 'Select load body generalizeds', m)To select load body generalizeds, flagging those selected with flag f but limiting selection to load body generalizeds flagged with flag l, giving the prompt ‘Select load body generalizeds’:
Oasys.PRIMER.LoadBodyGeneralized.Select(f, 'Select load body generalizeds', l)
- classmethod LoadBodyGeneralized.SketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Sketches all of the flagged load body generalizeds in the model. The load body generalizeds will be sketched until you either call
LoadBodyGeneralized.Unsketch()
,LoadBodyGeneralized.UnsketchFlagged()
,Model.UnsketchAll()
, or delete the model
- Parameters:
model (Model) –
Model
that all the flagged load body generalizeds will be sketched inflag (Flag) – Flag set on the load body generalizeds that you want to sketch
redraw (boolean) – Optional. If model should be redrawn or not after the load body generalizeds are sketched. If omitted redraw is true. If you want to sketch flagged load body generalizeds 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 body generalizeds flagged with flag in model m:
Oasys.PRIMER.LoadBodyGeneralized.SketchFlagged(m, flag)
- classmethod LoadBodyGeneralized.Total(model, exists=Oasys.gRPC.defaultArg)¶
Returns the total number of load body generalizeds in the model
- Parameters:
model (Model) –
Model
to get total forexists (boolean) – Optional. true if only existing load body generalizeds should be counted. If false or omitted referenced but undefined load body generalizeds will also be included in the total
- Returns:
number of load body generalizeds
- Return type:
int
Example
To get the total number of load body generalizeds in model m:
total = Oasys.PRIMER.LoadBodyGeneralized.Total(m)
- classmethod LoadBodyGeneralized.UnblankAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unblanks all of the load body generalizeds in the model
- Parameters:
model (Model) –
Model
that all load body generalizeds 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 body generalizeds in model m:
Oasys.PRIMER.LoadBodyGeneralized.UnblankAll(m)
- classmethod LoadBodyGeneralized.UnblankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unblanks all of the flagged load body generalizeds in the model
- Parameters:
model (Model) –
Model
that the flagged load body generalizeds will be unblanked inflag (Flag) – Flag set on the load body generalizeds 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 body generalizeds in model m flagged with f:
Oasys.PRIMER.LoadBodyGeneralized.UnblankFlagged(m, f)
- classmethod LoadBodyGeneralized.UnflagAll(model, flag)¶
Unsets a defined flag on all of the load body generalizeds in the model
- Parameters:
model (Model) –
Model
that the defined flag for all load body generalizeds will be unset inflag (Flag) – Flag to unset on the load body generalizeds
- Returns:
No return value
- Return type:
None
Example
To unset the flag f on all the load body generalizeds in model m:
Oasys.PRIMER.LoadBodyGeneralized.UnflagAll(m, f)
- classmethod LoadBodyGeneralized.UnsketchAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all load body generalizeds
- Parameters:
model (Model) –
Model
that all load body generalizeds will be unblanked inredraw (boolean) – Optional. If model should be redrawn or not after the load body generalizeds 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 body generalizeds in model m:
Oasys.PRIMER.LoadBodyGeneralized.UnsketchAll(m)
- classmethod LoadBodyGeneralized.UnsketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all flagged load body generalizeds in the model
- Parameters:
model (Model) –
Model
that all load body generalizeds will be unsketched inflag (Flag) – Flag set on the load body generalizeds that you want to unsketch
redraw (boolean) – Optional. If model should be redrawn or not after the load body generalizeds 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 body generalizeds flagged with flag in model m:
Oasys.PRIMER.LoadBodyGeneralized.UnsketchAll(m, flag)
Instance methods¶
- LoadBodyGeneralized.AssociateComment(comment)¶
Associates a comment with a load body generalized
- Parameters:
comment (Comment) –
Comment
that will be attached to the load body generalized- Returns:
No return value
- Return type:
None
Example
To associate comment c to the load body generalized lbg:
lbg.AssociateComment(c)
- LoadBodyGeneralized.Blank()¶
Blanks the load body generalized
- Returns:
No return value
- Return type:
None
Example
To blank load body generalized lbg:
lbg.Blank()
- LoadBodyGeneralized.Blanked()¶
Checks if the load body generalized is blanked or not
- Returns:
True if blanked, False if not
- Return type:
bool
Example
To check if load body generalized lbg is blanked:
if lbg.Blanked(): do_something..
- LoadBodyGeneralized.ClearFlag(flag)¶
Clears a flag on the load body generalized
- Parameters:
flag (Flag) – Flag to clear on the load body generalized
- Returns:
No return value
- Return type:
None
Example
To clear flag f for load body generalized lbg:
lbg.ClearFlag(f)
- LoadBodyGeneralized.Copy(range=Oasys.gRPC.defaultArg)¶
Copies the load body generalized. The target include of the copied load body generalized 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:
LoadBodyGeneralized object
- Return type:
LoadBodyGeneralized
Example
To copy load body generalized lbg into load body generalized z:
z = lbg.Copy()
- LoadBodyGeneralized.DetachComment(comment)¶
Detaches a comment from a load body generalized
- Parameters:
comment (Comment) –
Comment
that will be detached from the load body generalized- Returns:
No return value
- Return type:
None
Example
To detach comment c from the load body generalized lbg:
lbg.DetachComment(c)
- LoadBodyGeneralized.Flagged(flag)¶
Checks if the load body generalized is flagged or not
- Parameters:
flag (Flag) – Flag to test on the load body generalized
- Returns:
True if flagged, False if not
- Return type:
bool
Example
To check if load body generalized lbg has flag f set on it:
if lbg.Flagged(f): do_something..
- LoadBodyGeneralized.GetComments()¶
Extracts the comments associated to a load body generalized
- 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 body generalized lbg:
comm_list = lbg.GetComments()
- LoadBodyGeneralized.GetParameter(prop)¶
Checks if a LoadBodyGeneralized 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 theLoadBodyGeneralized.ViewParameters()
method and ‘method chaining’ (see the examples below)
- Parameters:
prop (string) – load body generalized property to get parameter for
- Returns:
Parameter object if property is a parameter, None if not
- Return type:
dict
Example
To check if LoadBodyGeneralized property lbg.example is a parameter:
Oasys.PRIMER.Options.property_parameter_names = True if lbg.GetParameter(lbg.example): do_something... Oasys.PRIMER.Options.property_parameter_names = FalseTo check if LoadBodyGeneralized property lbg.example is a parameter by using the GetParameter method:
if lbg.ViewParameters().GetParameter(lbg.example): do_something..
- LoadBodyGeneralized.Keyword()¶
Returns the keyword for this load body generalized (*LOAD_NODE_xxxx). Note that a carriage return is not added. See also
LoadBodyGeneralized.KeywordCards()
- Returns:
string containing the keyword
- Return type:
str
Example
To get the keyword for load body generalized m:
key = m.Keyword()
- LoadBodyGeneralized.KeywordCards()¶
Returns the keyword cards for the load body generalized. Note that a carriage return is not added. See also
LoadBodyGeneralized.Keyword()
- Returns:
string containing the cards
- Return type:
str
Example
To get the cards for load body generalized l:
cards = l.KeywordCards()
- LoadBodyGeneralized.Next()¶
Returns the next load body generalized in the model
- Returns:
LoadBodyGeneralized object (or None if there are no more load body generalizeds in the model)
- Return type:
LoadBodyGeneralized
Example
To get the load body generalized in model m after load body generalized lbg:
lbg = lbg.Next()
- LoadBodyGeneralized.Previous()¶
Returns the previous load body generalized in the model
- Returns:
LoadBodyGeneralized object (or None if there are no more load body generalizeds in the model)
- Return type:
LoadBodyGeneralized
Example
To get the load body generalized in model m before load body generalized lbg:
lbg = lbg.Previous()
- LoadBodyGeneralized.SetFlag(flag)¶
Sets a flag on the load body generalized
- Parameters:
flag (Flag) – Flag to set on the load body generalized
- Returns:
No return value
- Return type:
None
Example
To set flag f for load body generalized lbg:
lbg.SetFlag(f)
- LoadBodyGeneralized.Sketch(redraw=Oasys.gRPC.defaultArg)¶
Sketches the load body generalized. The load body generalized will be sketched until you either call
LoadBodyGeneralized.Unsketch()
,LoadBodyGeneralized.UnsketchAll()
,Model.UnsketchAll()
, or delete the model
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the load body generalized is sketched. If omitted redraw is true. If you want to sketch several load body generalizeds 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 body generalized lbg:
lbg.Sketch()
- LoadBodyGeneralized.Unblank()¶
Unblanks the load body generalized
- Returns:
No return value
- Return type:
None
Example
To unblank load body generalized lbg:
lbg.Unblank()
- LoadBodyGeneralized.Unsketch(redraw=Oasys.gRPC.defaultArg)¶
Unsketches the load body generalized
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the load body generalized is unsketched. If omitted redraw is true. If you want to unsketch several load body generalizeds 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 body generalized lbg:
lbg.Unsketch()
- LoadBodyGeneralized.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:
LoadBodyGeneralized object
- Return type:
dict
Example
To check if LoadBodyGeneralized property lbg.example is a parameter by using the
LoadBodyGeneralized.GetParameter()
method:if lbg.ViewParameters().GetParameter(lbg.example): do_something..
- LoadBodyGeneralized.Xrefs()¶
Returns the cross references for this load body generalized
- Returns:
Xrefs object
- Return type:
dict
Example
To get the cross references for load body generalized lbg:
xrefs = lbg.Xrefs()