Oasys.PRIMER.NodalForceGroup class¶
Properties¶
- property NodalForceGroup.cid: integer¶
- property NodalForceGroup.exists(read only): boolean¶
true if Nodal Force Group exists, false if referred to but not defined
- property NodalForceGroup.id: integer¶
Database Nodal Force Group number (identical to label)
- property NodalForceGroup.label: integer¶
Database Nodal Force Group number
Constructor¶
- classmethod NodalForceGroup(model, nsid, cid=Oasys.gRPC.defaultArg)¶
Create a new
NodalForceGroup
object
- Parameters:
model (Model) –
Model
that nodal force group will be created innsid (integer) –
Set
Node Set IDcid (integer) – Optional.
Coordinate System
ID- Returns:
NodalForceGroup object
- Return type:
dict
Example
To create a new nodal force group in model m with nsid 100:
nfg = Oasys.PRIMER.NodalForceGroup(m, 100)
Static methods¶
- classmethod NodalForceGroup.BlankAll(model, redraw=Oasys.gRPC.defaultArg)¶
Blanks all of the nodal force groups in the model
- Parameters:
model (Model) –
Model
that all nodal force groups 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 nodal force groups in model m:
Oasys.PRIMER.NodalForceGroup.BlankAll(m)
- classmethod NodalForceGroup.BlankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Blanks all of the flagged nodal force groups in the model
- Parameters:
model (Model) –
Model
that all the flagged nodal force groups will be blanked inflag (Flag) – Flag set on the nodal force groups 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 nodal force groups in model m flagged with f:
Oasys.PRIMER.NodalForceGroup.BlankFlagged(m, f)
- classmethod NodalForceGroup.First(model)¶
Returns the first nodal force group in the model
- Parameters:
model (Model) –
Model
to get first nodal force group in- Returns:
NodalForceGroup object (or None if there are no nodal force groups in the model)
- Return type:
NodalForceGroup
Example
To get the first nodal force group in model m:
nfg = Oasys.PRIMER.NodalForceGroup.First(m)
- classmethod NodalForceGroup.FlagAll(model, flag)¶
Flags all of the nodal force groups in the model with a defined flag
- Parameters:
model (Model) –
Model
that all nodal force groups will be flagged inflag (Flag) – Flag to set on the nodal force groups
- Returns:
No return value
- Return type:
None
Example
To flag all of the nodal force groups with flag f in model m:
Oasys.PRIMER.NodalForceGroup.FlagAll(m, f)
- classmethod NodalForceGroup.GetAll(model)¶
Returns a list of NodalForceGroup objects for all of the nodal force groups in a model in PRIMER
- Parameters:
model (Model) –
Model
to get nodal force groups from- Returns:
List of NodalForceGroup objects
- Return type:
list
Example
To make a list of NodalForceGroup objects for all of the nodal force groups in model m
nfg = Oasys.PRIMER.NodalForceGroup.GetAll(m)
- classmethod NodalForceGroup.GetFlagged(model, flag)¶
Returns a list of NodalForceGroup objects for all of the flagged nodal force groups in a model in PRIMER
- Parameters:
model (Model) –
Model
to get nodal force groups fromflag (Flag) – Flag set on the nodal force groups that you want to retrieve
- Returns:
List of NodalForceGroup objects
- Return type:
list
Example
To make a list of NodalForceGroup objects for all of the nodal force groups in model m flagged with f
nfg = Oasys.PRIMER.NodalForceGroup.GetFlagged(m, f)
- classmethod NodalForceGroup.GetFromID(model, number)¶
Returns the NodalForceGroup object for a nodal force group ID
- Parameters:
model (Model) –
Model
to find the nodal force group innumber (integer) – number of the nodal force group you want the NodalForceGroup object for
- Returns:
NodalForceGroup object (or None if nodal force group does not exist)
- Return type:
NodalForceGroup
Example
To get the NodalForceGroup object for nodal force group 100 in model m
nfg = Oasys.PRIMER.NodalForceGroup.GetFromID(m, 100)
- classmethod NodalForceGroup.Last(model)¶
Returns the last nodal force group in the model
- Parameters:
model (Model) –
Model
to get last nodal force group in- Returns:
NodalForceGroup object (or None if there are no nodal force groups in the model)
- Return type:
NodalForceGroup
Example
To get the last nodal force group in model m:
nfg = Oasys.PRIMER.NodalForceGroup.Last(m)
- classmethod NodalForceGroup.Pick(prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg, button_text=Oasys.gRPC.defaultArg)¶
Allows the user to pick a nodal force group
- 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 nodal force groups from that model can be picked. If the argument is aFlag
then only nodal force groups that are flagged with limit can be selected. If omitted, or None, any nodal force groups 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:
NodalForceGroup object (or None if not picked)
- Return type:
dict
Example
To pick a nodal force group from model m giving the prompt ‘Pick nodal force group from screen’:
nfg = Oasys.PRIMER.NodalForceGroup.Pick('Pick nodal force group from screen', m)
- classmethod NodalForceGroup.Select(flag, prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg)¶
Allows the user to select nodal force groups using standard PRIMER object menus
- Parameters:
flag (Flag) – Flag to use when selecting nodal force groups
prompt (string) – Text to display as a prompt to the user
limit (Model or Flag) – Optional. If the argument is a
Model
then only nodal force groups from that model can be selected. If the argument is aFlag
then only nodal force groups that are flagged with limit can be selected (limit should be different to flag). If omitted, or None, any nodal force groups 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 nodal force groups selected or None if menu cancelled
- Return type:
int
Example
To select nodal force groups from model m, flagging those selected with flag f, giving the prompt ‘Select nodal force groups’:
Oasys.PRIMER.NodalForceGroup.Select(f, 'Select nodal force groups', m)To select nodal force groups, flagging those selected with flag f but limiting selection to nodal force groups flagged with flag l, giving the prompt ‘Select nodal force groups’:
Oasys.PRIMER.NodalForceGroup.Select(f, 'Select nodal force groups', l)
- classmethod NodalForceGroup.SketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Sketches all of the flagged nodal force groups in the model. The nodal force groups will be sketched until you either call
NodalForceGroup.Unsketch()
,NodalForceGroup.UnsketchFlagged()
,Model.UnsketchAll()
, or delete the model
- Parameters:
model (Model) –
Model
that all the flagged nodal force groups will be sketched inflag (Flag) – Flag set on the nodal force groups that you want to sketch
redraw (boolean) – Optional. If model should be redrawn or not after the nodal force groups are sketched. If omitted redraw is true. If you want to sketch flagged nodal force groups 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 nodal force groups flagged with flag in model m:
Oasys.PRIMER.NodalForceGroup.SketchFlagged(m, flag)
- classmethod NodalForceGroup.Total(model, exists=Oasys.gRPC.defaultArg)¶
Returns the total number of nodal force groups in the model
- Parameters:
model (Model) –
Model
to get total forexists (boolean) – Optional. true if only existing nodal force groups should be counted. If false or omitted referenced but undefined nodal force groups will also be included in the total
- Returns:
number of nodal force groups
- Return type:
int
Example
To get the total number of nodal force groups in model m:
total = Oasys.PRIMER.NodalForceGroup.Total(m)
- classmethod NodalForceGroup.UnblankAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unblanks all of the nodal force groups in the model
- Parameters:
model (Model) –
Model
that all nodal force groups 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 nodal force groups in model m:
Oasys.PRIMER.NodalForceGroup.UnblankAll(m)
- classmethod NodalForceGroup.UnblankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unblanks all of the flagged nodal force groups in the model
- Parameters:
model (Model) –
Model
that the flagged nodal force groups will be unblanked inflag (Flag) – Flag set on the nodal force groups 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 nodal force groups in model m flagged with f:
Oasys.PRIMER.NodalForceGroup.UnblankFlagged(m, f)
- classmethod NodalForceGroup.UnflagAll(model, flag)¶
Unsets a defined flag on all of the nodal force groups in the model
- Parameters:
model (Model) –
Model
that the defined flag for all nodal force groups will be unset inflag (Flag) – Flag to unset on the nodal force groups
- Returns:
No return value
- Return type:
None
Example
To unset the flag f on all the nodal force groups in model m:
Oasys.PRIMER.NodalForceGroup.UnflagAll(m, f)
- classmethod NodalForceGroup.UnsketchAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all nodal force groups
- Parameters:
model (Model) –
Model
that all nodal force groups will be unblanked inredraw (boolean) – Optional. If model should be redrawn or not after the nodal force groups 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 nodal force groups in model m:
Oasys.PRIMER.NodalForceGroup.UnsketchAll(m)
- classmethod NodalForceGroup.UnsketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all flagged nodal force groups in the model
- Parameters:
model (Model) –
Model
that all nodal force groups will be unsketched inflag (Flag) – Flag set on the nodal force groups that you want to unsketch
redraw (boolean) – Optional. If model should be redrawn or not after the nodal force groups 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 nodal force groups flagged with flag in model m:
Oasys.PRIMER.NodalForceGroup.UnsketchAll(m, flag)
Instance methods¶
- NodalForceGroup.AssociateComment(comment)¶
Associates a comment with a nodal force group
- Parameters:
comment (Comment) –
Comment
that will be attached to the nodal force group- Returns:
No return value
- Return type:
None
Example
To associate comment c to the nodal force group nfg:
nfg.AssociateComment(c)
- NodalForceGroup.Blank()¶
Blanks the nodal force group
- Returns:
No return value
- Return type:
None
Example
To blank nodal force group nfg:
nfg.Blank()
- NodalForceGroup.Blanked()¶
Checks if the nodal force group is blanked or not
- Returns:
True if blanked, False if not
- Return type:
bool
Example
To check if nodal force group nfg is blanked:
if nfg.Blanked(): do_something..
- NodalForceGroup.ClearFlag(flag)¶
Clears a flag on the nodal force group
- Parameters:
flag (Flag) – Flag to clear on the nodal force group
- Returns:
No return value
- Return type:
None
Example
To clear flag f for nodal force group nfg:
nfg.ClearFlag(f)
- NodalForceGroup.Copy(range=Oasys.gRPC.defaultArg)¶
Copies the nodal force group. The target include of the copied nodal force group 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:
NodalForceGroup object
- Return type:
NodalForceGroup
Example
To copy nodal force group nfg into nodal force group z:
z = nfg.Copy()
- NodalForceGroup.DetachComment(comment)¶
Detaches a comment from a nodal force group
- Parameters:
comment (Comment) –
Comment
that will be detached from the nodal force group- Returns:
No return value
- Return type:
None
Example
To detach comment c from the nodal force group nfg:
nfg.DetachComment(c)
- NodalForceGroup.Flagged(flag)¶
Checks if the nodal force group is flagged or not
- Parameters:
flag (Flag) – Flag to test on the nodal force group
- Returns:
True if flagged, False if not
- Return type:
bool
Example
To check if nodal force group nfg has flag f set on it:
if nfg.Flagged(f): do_something..
- NodalForceGroup.GetComments()¶
Extracts the comments associated to a nodal force group
- 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 nodal force group nfg:
comm_list = nfg.GetComments()
- NodalForceGroup.GetParameter(prop)¶
Checks if a NodalForceGroup 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 theNodalForceGroup.ViewParameters()
method and ‘method chaining’ (see the examples below)
- Parameters:
prop (string) – nodal force group property to get parameter for
- Returns:
Parameter object if property is a parameter, None if not
- Return type:
dict
Example
To check if NodalForceGroup property nfg.example is a parameter:
Oasys.PRIMER.Options.property_parameter_names = True if nfg.GetParameter(nfg.example): do_something... Oasys.PRIMER.Options.property_parameter_names = FalseTo check if NodalForceGroup property nfg.example is a parameter by using the GetParameter method:
if nfg.ViewParameters().GetParameter(nfg.example): do_something..
- NodalForceGroup.Keyword()¶
Returns the keyword for this nodal force group. Note that a carriage return is not added. See also
NodalForceGroup.KeywordCards()
- Returns:
string containing the keyword
- Return type:
str
Example
To get the keyword for nodal force group nfg:
key = nfg.Keyword()
- NodalForceGroup.KeywordCards()¶
Returns the keyword cards for the nodal force group. Note that a carriage return is not added. See also
NodalForceGroup.Keyword()
- Returns:
string containing the cards
- Return type:
str
Example
To get the cards for nodal force group nfg:
cards = nfg.KeywordCards()
- NodalForceGroup.Next()¶
Returns the next nodal force group in the model
- Returns:
NodalForceGroup object (or None if there are no more nodal force groups in the model)
- Return type:
NodalForceGroup
Example
To get the nodal force group in model m after nodal force group nfg:
nfg = nfg.Next()
- NodalForceGroup.Previous()¶
Returns the previous nodal force group in the model
- Returns:
NodalForceGroup object (or None if there are no more nodal force groups in the model)
- Return type:
NodalForceGroup
Example
To get the nodal force group in model m before nodal force group nfg:
nfg = nfg.Previous()
- NodalForceGroup.SetFlag(flag)¶
Sets a flag on the nodal force group
- Parameters:
flag (Flag) – Flag to set on the nodal force group
- Returns:
No return value
- Return type:
None
Example
To set flag f for nodal force group nfg:
nfg.SetFlag(f)
- NodalForceGroup.Sketch(redraw=Oasys.gRPC.defaultArg)¶
Sketches the nodal force group. The nodal force group will be sketched until you either call
NodalForceGroup.Unsketch()
,NodalForceGroup.UnsketchAll()
,Model.UnsketchAll()
, or delete the model
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the nodal force group is sketched. If omitted redraw is true. If you want to sketch several nodal force groups 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 nodal force group nfg:
nfg.Sketch()
- NodalForceGroup.Unblank()¶
Unblanks the nodal force group
- Returns:
No return value
- Return type:
None
Example
To unblank nodal force group nfg:
nfg.Unblank()
- NodalForceGroup.Unsketch(redraw=Oasys.gRPC.defaultArg)¶
Unsketches the nodal force group
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the nodal force group is unsketched. If omitted redraw is true. If you want to unsketch several nodal force groups 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 nodal force group nfg:
nfg.Unsketch()
- NodalForceGroup.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:
NodalForceGroup object
- Return type:
dict
Example
To check if NodalForceGroup property nfg.example is a parameter by using the
NodalForceGroup.GetParameter()
method:if nfg.ViewParameters().GetParameter(nfg.example): do_something..
- NodalForceGroup.Xrefs()¶
Returns the cross references for this nodal force group
- Returns:
Xrefs object
- Return type:
dict
Example
To get the cross references for nodal force group nfg:
xrefs = nfg.Xrefs()