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