Oasys.PRIMER.DampingRelative class

Properties

property DampingRelative.cdamp: float

Fraction of critical damping

property DampingRelative.dv2: float

Constant for velocity squared term

property DampingRelative.exists(read only): boolean

true if Damping Frequency Range exists, false if referred to but not defined

property DampingRelative.freq: float

Target frequency

property DampingRelative.include: integer

The Include file number that the damping_relative is in

property DampingRelative.lcid: integer

Fraction of cricitcal damping vs time

property DampingRelative.model(read only): integer

The Model number that the damping relative is in

property DampingRelative.pidrb: integer

Part Rigid body ID

property DampingRelative.psid: integer

Set Part set ID

Constructor

classmethod DampingRelative(model, pidrb, psid, cdamp=Oasys.gRPC.defaultArg, freq=Oasys.gRPC.defaultArg, dv2=Oasys.gRPC.defaultArg, lcid=Oasys.gRPC.defaultArg)

Create a new DampingRelative object for *DAMPING_RELATIVE

Parameters:
  • model (Model) – Model that damping relative will be created in

  • pidrb (integer) – Part Rigid body ID

  • psid (integer) – Set Part set ID

  • cdamp (float) – Optional. Fraction of critical damping

  • freq (float) – Optional. Target frequency

  • dv2 (float) – Optional. Constant for velocity squared term

  • lcid (integer) – Optional. Fraction of cricitcal damping vs time

Returns:

DampingRelative object

Return type:

dict

Example

To create a new damping relative (of no type) in model m with pidrb, psid, cdamp, freq, dv2, lcid set to 10, 20, 3.5, 4.5, 5.5, 60 respectively:

r = Oasys.PRIMER.DampingRelative(m, 10, 20, 3.5, 4.5, 5.5, 60)

Static methods

classmethod DampingRelative.BlankAll(model, redraw=Oasys.gRPC.defaultArg)

Blanks all of the damping relatives in the model

Parameters:
  • model (Model) – Model that all damping relatives will be blanked in

  • 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 relatives in model m:

Oasys.PRIMER.DampingRelative.BlankAll(m)
classmethod DampingRelative.BlankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)

Blanks all of the flagged damping relatives in the model

Parameters:
  • model (Model) – Model that all the flagged damping relatives will be blanked in

  • flag (Flag) – Flag set on the damping relatives 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 relatives in model m flagged with f:

Oasys.PRIMER.DampingRelative.BlankFlagged(m, f)
classmethod DampingRelative.First(model)

Returns the first damping relative in the model

Parameters:

model (Model) – Model to get first damping relative in

Returns:

DampingRelative object (or None if there are no damping relatives in the model)

Return type:

DampingRelative

Example

To get the first damping relative in model m:

r = Oasys.PRIMER.DampingRelative.First(m)
classmethod DampingRelative.FlagAll(model, flag)

Flags all of the damping relatives in the model with a defined flag

Parameters:
  • model (Model) – Model that all damping relatives will be flagged in

  • flag (Flag) – Flag to set on the damping relatives

Returns:

No return value

Return type:

None

Example

To flag all of the damping relatives with flag f in model m:

Oasys.PRIMER.DampingRelative.FlagAll(m, f)
classmethod DampingRelative.GetAll(model)

Returns a list of DampingRelative objects for all of the damping relatives in a model in PRIMER

Parameters:

model (Model) – Model to get damping relatives from

Returns:

List of DampingRelative objects

Return type:

list

Example

To make a list of DampingRelative objects for all of the damping relatives in model m

r = Oasys.PRIMER.DampingRelative.GetAll(m)
classmethod DampingRelative.GetFlagged(model, flag)

Returns a list of DampingRelative objects for all of the flagged damping relatives in a model in PRIMER

Parameters:
  • model (Model) – Model to get damping relatives from

  • flag (Flag) – Flag set on the damping relatives that you want to retrieve

Returns:

List of DampingRelative objects

Return type:

list

Example

To make a list of DampingRelative objects for all of the damping relatives in model m flagged with f

r = Oasys.PRIMER.DampingRelative.GetFlagged(m, f)
classmethod DampingRelative.GetFromID(model, number)

Returns the DampingRelative object for a damping relative ID

Parameters:
  • model (Model) – Model to find the damping relative in

  • number (integer) – number of the damping relative you want the DampingRelative object for

Returns:

DampingRelative object (or None if damping relative does not exist)

Return type:

DampingRelative

Example

To get the DampingRelative object for damping relative 100 in model m

r = Oasys.PRIMER.DampingRelative.GetFromID(m, 100)
classmethod DampingRelative.Last(model)

Returns the last damping relative in the model

Parameters:

model (Model) – Model to get last damping relative in

Returns:

DampingRelative object (or None if there are no damping relatives in the model)

Return type:

DampingRelative

Example

To get the last damping relative in model m:

r = Oasys.PRIMER.DampingRelative.Last(m)
classmethod DampingRelative.Pick(prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg, button_text=Oasys.gRPC.defaultArg)

Allows the user to pick a damping relative

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 relatives from that model can be picked. If the argument is a Flag then only damping relatives that are flagged with limit can be selected. If omitted, or None, any damping relatives from any model can be selected. from any model

  • modal (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:

DampingRelative object (or None if not picked)

Return type:

dict

Example

To pick a damping relative from model m giving the prompt ‘Pick damping relative from screen’:

r = Oasys.PRIMER.DampingRelative.Pick('Pick damping relative from screen', m)
classmethod DampingRelative.Select(flag, prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg)

Allows the user to select damping relatives using standard PRIMER object menus

Parameters:
  • flag (Flag) – Flag to use when selecting damping relatives

  • 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 relatives from that model can be selected. If the argument is a Flag then only damping relatives that are flagged with limit can be selected (limit should be different to flag). If omitted, or None, any damping relatives can be selected. from any model

  • modal (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 relatives selected or None if menu cancelled

Return type:

int

Example

To select damping relatives from model m, flagging those selected with flag f, giving the prompt ‘Select damping relatives’:

Oasys.PRIMER.DampingRelative.Select(f, 'Select damping relatives', m)

To select damping relatives, flagging those selected with flag f but limiting selection to damping relatives flagged with flag l, giving the prompt ‘Select damping relatives’:

Oasys.PRIMER.DampingRelative.Select(f, 'Select damping relatives', l)
classmethod DampingRelative.SketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)

Sketches all of the flagged damping relatives in the model. The damping relatives will be sketched until you either call DampingRelative.Unsketch(), DampingRelative.UnsketchFlagged(), Model.UnsketchAll(), or delete the model

Parameters:
  • model (Model) – Model that all the flagged damping relatives will be sketched in

  • flag (Flag) – Flag set on the damping relatives that you want to sketch

  • redraw (boolean) – Optional. If model should be redrawn or not after the damping relatives are sketched. If omitted redraw is true. If you want to sketch flagged damping relatives 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 relatives flagged with flag in model m:

Oasys.PRIMER.DampingRelative.SketchFlagged(m, flag)
classmethod DampingRelative.Total(model, exists=Oasys.gRPC.defaultArg)

Returns the total number of damping relatives in the model

Parameters:
  • model (Model) – Model to get total for

  • exists (boolean) – Optional. true if only existing damping relatives should be counted. If false or omitted referenced but undefined damping relatives will also be included in the total

Returns:

number of damping relatives

Return type:

int

Example

To get the total number of damping relatives in model m:

total = Oasys.PRIMER.DampingRelative.Total(m)
classmethod DampingRelative.UnblankAll(model, redraw=Oasys.gRPC.defaultArg)

Unblanks all of the damping relatives in the model

Parameters:
  • model (Model) – Model that all damping relatives will be unblanked in

  • 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 relatives in model m:

Oasys.PRIMER.DampingRelative.UnblankAll(m)
classmethod DampingRelative.UnblankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)

Unblanks all of the flagged damping relatives in the model

Parameters:
  • model (Model) – Model that the flagged damping relatives will be unblanked in

  • flag (Flag) – Flag set on the damping relatives 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 relatives in model m flagged with f:

Oasys.PRIMER.DampingRelative.UnblankFlagged(m, f)
classmethod DampingRelative.UnflagAll(model, flag)

Unsets a defined flag on all of the damping relatives in the model

Parameters:
  • model (Model) – Model that the defined flag for all damping relatives will be unset in

  • flag (Flag) – Flag to unset on the damping relatives

Returns:

No return value

Return type:

None

Example

To unset the flag f on all the damping relatives in model m:

Oasys.PRIMER.DampingRelative.UnflagAll(m, f)
classmethod DampingRelative.UnsketchAll(model, redraw=Oasys.gRPC.defaultArg)

Unsketches all damping relatives

Parameters:
  • model (Model) – Model that all damping relatives will be unblanked in

  • redraw (boolean) – Optional. If model should be redrawn or not after the damping relatives 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 relatives in model m:

Oasys.PRIMER.DampingRelative.UnsketchAll(m)
classmethod DampingRelative.UnsketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)

Unsketches all flagged damping relatives in the model

Parameters:
  • model (Model) – Model that all damping relatives will be unsketched in

  • flag (Flag) – Flag set on the damping relatives that you want to unsketch

  • redraw (boolean) – Optional. If model should be redrawn or not after the damping relatives 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 relatives flagged with flag in model m:

Oasys.PRIMER.DampingRelative.UnsketchAll(m, flag)

Instance methods

DampingRelative.AssociateComment(comment)

Associates a comment with a damping relative

Parameters:

comment (Comment) – Comment that will be attached to the damping relative

Returns:

No return value

Return type:

None

Example

To associate comment c to the damping relative r:

r.AssociateComment(c)
DampingRelative.Blank()

Blanks the damping relative

Returns:

No return value

Return type:

None

Example

To blank damping relative r:

r.Blank()
DampingRelative.Blanked()

Checks if the damping relative is blanked or not

Returns:

True if blanked, False if not

Return type:

bool

Example

To check if damping relative r is blanked:

if r.Blanked():
    do_something..
DampingRelative.ClearFlag(flag)

Clears a flag on the damping relative

Parameters:

flag (Flag) – Flag to clear on the damping relative

Returns:

No return value

Return type:

None

Example

To clear flag f for damping relative r:

r.ClearFlag(f)
DampingRelative.Copy(range=Oasys.gRPC.defaultArg)

Copies the damping relative. The target include of the copied damping relative 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:

DampingRelative object

Return type:

DampingRelative

Example

To copy damping relative r into damping relative z:

z = r.Copy()
DampingRelative.DetachComment(comment)

Detaches a comment from a damping relative

Parameters:

comment (Comment) – Comment that will be detached from the damping relative

Returns:

No return value

Return type:

None

Example

To detach comment c from the damping relative r:

r.DetachComment(c)
DampingRelative.Flagged(flag)

Checks if the damping relative is flagged or not

Parameters:

flag (Flag) – Flag to test on the damping relative

Returns:

True if flagged, False if not

Return type:

bool

Example

To check if damping relative r has flag f set on it:

if r.Flagged(f):
    do_something..
DampingRelative.GetComments()

Extracts the comments associated to a damping relative

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 relative r:

comm_list = r.GetComments()
DampingRelative.GetParameter(prop)

Checks if a DampingRelative 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 the DampingRelative.ViewParameters() method and ‘method chaining’ (see the examples below)

Parameters:

prop (string) – damping relative property to get parameter for

Returns:

Parameter object if property is a parameter, None if not

Return type:

dict

Example

To check if DampingRelative property r.example is a parameter:

Oasys.PRIMER.Options.property_parameter_names = True
if r.GetParameter(r.example):
    do_something...
Oasys.PRIMER.Options.property_parameter_names = False

To check if DampingRelative property r.example is a parameter by using the GetParameter method:

if r.ViewParameters().GetParameter(r.example):
    do_something..
DampingRelative.Keyword()

Returns the keyword for this damping relative (*DAMPING_RELATIVE). Note that a carriage return is not added. See also DampingRelative.KeywordCards()

Returns:

string containing the keyword

Return type:

str

Example

To get the keyword for damping relative m:

key = r.Keyword()
DampingRelative.KeywordCards()

Returns the keyword cards for the damping relative. Note that a carriage return is not added. See also DampingRelative.Keyword()

Returns:

string containing the cards

Return type:

str

Example

To get the cards for damping relative fr:

cards = r.KeywordCards()
DampingRelative.Next()

Returns the next damping relative in the model

Returns:

DampingRelative object (or None if there are no more damping relatives in the model)

Return type:

DampingRelative

Example

To get the damping relative in model m after damping relative r:

r = r.Next()
DampingRelative.Previous()

Returns the previous damping relative in the model

Returns:

DampingRelative object (or None if there are no more damping relatives in the model)

Return type:

DampingRelative

Example

To get the damping relative in model m before damping relative r:

r = r.Previous()
DampingRelative.SetFlag(flag)

Sets a flag on the damping relative

Parameters:

flag (Flag) – Flag to set on the damping relative

Returns:

No return value

Return type:

None

Example

To set flag f for damping relative r:

r.SetFlag(f)
DampingRelative.Sketch(redraw=Oasys.gRPC.defaultArg)

Sketches the damping relative. The damping relative will be sketched until you either call DampingRelative.Unsketch(), DampingRelative.UnsketchAll(), Model.UnsketchAll(), or delete the model

Parameters:

redraw (boolean) – Optional. If model should be redrawn or not after the damping relative is sketched. If omitted redraw is true. If you want to sketch several damping relatives 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 relative r:

r.Sketch()
DampingRelative.Unblank()

Unblanks the damping relative

Returns:

No return value

Return type:

None

Example

To unblank damping relative r:

r.Unblank()
DampingRelative.Unsketch(redraw=Oasys.gRPC.defaultArg)

Unsketches the damping relative

Parameters:

redraw (boolean) – Optional. If model should be redrawn or not after the damping relative is unsketched. If omitted redraw is true. If you want to unsketch several damping relatives 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 relative r:

r.Unsketch()
DampingRelative.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:

DampingRelative object

Return type:

dict

Example

To check if DampingRelative property r.example is a parameter by using the DampingRelative.GetParameter() method:

if r.ViewParameters().GetParameter(r.example):
    do_something..
DampingRelative.Xrefs()

Returns the cross references for this damping relative

Returns:

Xrefs object

Return type:

dict

Example

To get the cross references for damping relative r:

xrefs = r.Xrefs()