Oasys.PRIMER.LoadRigidBody class

Properties

property LoadRigidBody.cid: integer

Coordinate system ID

property LoadRigidBody.dof: integer

Applicable degrees-of-freedom

property LoadRigidBody.exists(read only): boolean

true if load rigidbody exists, false if referred to but not defined

property LoadRigidBody.include: integer

The Include file number that the load rigidbody is in

property LoadRigidBody.lcid: integer

Curve ID

property LoadRigidBody.m1: integer

Node 1 ID

property LoadRigidBody.m2: integer

Node 2 ID

property LoadRigidBody.m3: integer

Node 3 ID

property LoadRigidBody.model(read only): integer

The Model number that the load rigidbody is in

property LoadRigidBody.pid: integer

Part ID

property LoadRigidBody.sf: float

Curve scale factor

Constructor

classmethod LoadRigidBody(model, pid, dof, lcid, sf=Oasys.gRPC.defaultArg, cid=Oasys.gRPC.defaultArg, m1=Oasys.gRPC.defaultArg, m2=Oasys.gRPC.defaultArg, m3=Oasys.gRPC.defaultArg)

Create a new LoadRigidBody object

Parameters:
  • model (Model) – Model that load rigidbody will be created in

  • pid (integer) – Part ID

  • dof (integer) – Applicable degrees-of-freedom

  • lcid (integer) – Curve ID

  • sf (float) – Optional. Curve scale factor

  • cid (integer) – Optional. Coordinate system ID

  • m1 (integer) – Optional. Node 1 ID

  • m2 (integer) – Optional. Node 2 ID

  • m3 (integer) – Optional. Node 3 ID

Returns:

LoadRigidBody object

Return type:

dict

Example

To create a new load rigidbody in model m, for part 100, with loadcurve 9 and a scale factor of 0.5

lrb = Oasys.PRIMER.LoadRigidBody(m, 100, 2, 9, 0.5)

Static methods

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

Blanks all of the load rigidbodys in the model

Parameters:
  • model (Model) – Model that all load rigidbodys 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 load rigidbodys in model m:

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

Blanks all of the flagged load rigidbodys in the model

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

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

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

Returns the first load rigidbody in the model

Parameters:

model (Model) – Model to get first load rigidbody in

Returns:

LoadRigidBody object (or None if there are no load rigidbodys in the model)

Return type:

LoadRigidBody

Example

To get the first load rigidbody in model m:

lrb = Oasys.PRIMER.LoadRigidBody.First(m)
classmethod LoadRigidBody.FlagAll(model, flag)

Flags all of the load rigidbodys in the model with a defined flag

Parameters:
  • model (Model) – Model that all load rigidbodys will be flagged in

  • flag (Flag) – Flag to set on the load rigidbodys

Returns:

No return value

Return type:

None

Example

To flag all of the load rigidbodys with flag f in model m:

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

Returns a list of LoadRigidBody objects for all of the load rigidbodys in a model in PRIMER

Parameters:

model (Model) – Model to get load rigidbodys from

Returns:

List of LoadRigidBody objects

Return type:

list

Example

To make a list of LoadRigidBody objects for all of the load rigidbodys in model m

lrb = Oasys.PRIMER.LoadRigidBody.GetAll(m)
classmethod LoadRigidBody.GetFlagged(model, flag)

Returns a list of LoadRigidBody objects for all of the flagged load rigidbodys in a model in PRIMER

Parameters:
  • model (Model) – Model to get load rigidbodys from

  • flag (Flag) – Flag set on the load rigidbodys that you want to retrieve

Returns:

List of LoadRigidBody objects

Return type:

list

Example

To make a list of LoadRigidBody objects for all of the load rigidbodys in model m flagged with f

lrb = Oasys.PRIMER.LoadRigidBody.GetFlagged(m, f)
classmethod LoadRigidBody.GetFromID(model, number)

Returns the LoadRigidBody object for a load rigidbody ID

Parameters:
  • model (Model) – Model to find the load rigidbody in

  • number (integer) – number of the load rigidbody you want the LoadRigidBody object for

Returns:

LoadRigidBody object (or None if load rigidbody does not exist)

Return type:

LoadRigidBody

Example

To get the LoadRigidBody object for load rigidbody 100 in model m

lrb = Oasys.PRIMER.LoadRigidBody.GetFromID(m, 100)
classmethod LoadRigidBody.Last(model)

Returns the last load rigidbody in the model

Parameters:

model (Model) – Model to get last load rigidbody in

Returns:

LoadRigidBody object (or None if there are no load rigidbodys in the model)

Return type:

LoadRigidBody

Example

To get the last load rigidbody in model m:

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

Allows the user to pick a load rigidbody

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

LoadRigidBody object (or None if not picked)

Return type:

dict

Example

To pick a load rigidbody from model m giving the prompt ‘Pick load rigidbody from screen’:

lrb = Oasys.PRIMER.LoadRigidBody.Pick('Pick load rigidbody from screen', m)
classmethod LoadRigidBody.Select(flag, prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg)

Allows the user to select load rigidbodys using standard PRIMER object menus

Parameters:
  • flag (Flag) – Flag to use when selecting load rigidbodys

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

Return type:

int

Example

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

Oasys.PRIMER.LoadRigidBody.Select(f, 'Select load rigidbodys', m)

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

Oasys.PRIMER.LoadRigidBody.Select(f, 'Select load rigidbodys', l)
classmethod LoadRigidBody.SketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)

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

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

  • flag (Flag) – Flag set on the load rigidbodys that you want to sketch

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

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

Returns the total number of load rigidbodys in the model

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

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

Returns:

number of load rigidbodys

Return type:

int

Example

To get the total number of load rigidbodys in model m:

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

Unblanks all of the load rigidbodys in the model

Parameters:
  • model (Model) – Model that all load rigidbodys 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 load rigidbodys in model m:

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

Unblanks all of the flagged load rigidbodys in the model

Parameters:
  • model (Model) – Model that the flagged load rigidbodys will be unblanked in

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

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

Unsets a defined flag on all of the load rigidbodys in the model

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

  • flag (Flag) – Flag to unset on the load rigidbodys

Returns:

No return value

Return type:

None

Example

To unset the flag f on all the load rigidbodys in model m:

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

Unsketches all load rigidbodys

Parameters:
  • model (Model) – Model that all load rigidbodys will be unblanked in

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

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

Unsketches all flagged load rigidbodys in the model

Parameters:
  • model (Model) – Model that all load rigidbodys will be unsketched in

  • flag (Flag) – Flag set on the load rigidbodys that you want to unsketch

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

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

Instance methods

LoadRigidBody.AssociateComment(comment)

Associates a comment with a load rigidbody

Parameters:

comment (Comment) – Comment that will be attached to the load rigidbody

Returns:

No return value

Return type:

None

Example

To associate comment c to the load rigidbody lrb:

lrb.AssociateComment(c)
LoadRigidBody.Blank()

Blanks the load rigidbody

Returns:

No return value

Return type:

None

Example

To blank load rigidbody lrb:

lrb.Blank()
LoadRigidBody.Blanked()

Checks if the load rigidbody is blanked or not

Returns:

True if blanked, False if not

Return type:

bool

Example

To check if load rigidbody lrb is blanked:

if lrb.Blanked():
    do_something..
LoadRigidBody.ClearFlag(flag)

Clears a flag on the load rigidbody

Parameters:

flag (Flag) – Flag to clear on the load rigidbody

Returns:

No return value

Return type:

None

Example

To clear flag f for load rigidbody lrb:

lrb.ClearFlag(f)
LoadRigidBody.Copy(range=Oasys.gRPC.defaultArg)

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

LoadRigidBody object

Return type:

LoadRigidBody

Example

To copy load rigidbody lrb into load rigidbody z:

z = lrb.Copy()
LoadRigidBody.DetachComment(comment)

Detaches a comment from a load rigidbody

Parameters:

comment (Comment) – Comment that will be detached from the load rigidbody

Returns:

No return value

Return type:

None

Example

To detach comment c from the load rigidbody lrb:

lrb.DetachComment(c)
LoadRigidBody.Flagged(flag)

Checks if the load rigidbody is flagged or not

Parameters:

flag (Flag) – Flag to test on the load rigidbody

Returns:

True if flagged, False if not

Return type:

bool

Example

To check if load rigidbody lrb has flag f set on it:

if lrb.Flagged(f):
    do_something..
LoadRigidBody.GetComments()

Extracts the comments associated to a load rigidbody

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 rigidbody lrb:

comm_list = lrb.GetComments()
LoadRigidBody.GetParameter(prop)

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

Parameters:

prop (string) – load rigidbody property to get parameter for

Returns:

Parameter object if property is a parameter, None if not

Return type:

dict

Example

To check if LoadRigidBody property lrb.example is a parameter:

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

To check if LoadRigidBody property lrb.example is a parameter by using the GetParameter method:

if lrb.ViewParameters().GetParameter(lrb.example):
    do_something..
LoadRigidBody.Keyword()

Returns the keyword for this load rigidbody (*LOAD_RIGIDBODY). Note that a carriage return is not added. See also LoadRigidBody.KeywordCards()

Returns:

string containing the keyword

Return type:

str

Example

To get the keyword for load rigidbody lrb:

key = lrb.Keyword()
LoadRigidBody.KeywordCards()

Returns the keyword cards for the load rigidbody. Note that a carriage return is not added. See also LoadRigidBody.Keyword()

Returns:

string containing the cards

Return type:

str

Example

To get the cards for load rigidbody lrb:

cards = lrb.KeywordCards()
LoadRigidBody.Next()

Returns the next load rigidbody in the model

Returns:

LoadRigidBody object (or None if there are no more load rigidbodys in the model)

Return type:

LoadRigidBody

Example

To get the load rigidbody in model m after load rigidbody lrb:

lrb = lrb.Next()
LoadRigidBody.Previous()

Returns the previous load rigidbody in the model

Returns:

LoadRigidBody object (or None if there are no more load rigidbodys in the model)

Return type:

LoadRigidBody

Example

To get the load rigidbody in model m before load rigidbody lrb:

lrb = lrb.Previous()
LoadRigidBody.SetFlag(flag)

Sets a flag on the load rigidbody

Parameters:

flag (Flag) – Flag to set on the load rigidbody

Returns:

No return value

Return type:

None

Example

To set flag f for load rigidbody lrb:

lrb.SetFlag(f)
LoadRigidBody.Sketch(redraw=Oasys.gRPC.defaultArg)

Sketches the load rigidbody. The load rigidbody will be sketched until you either call LoadRigidBody.Unsketch(), LoadRigidBody.UnsketchAll(), Model.UnsketchAll(), or delete the model

Parameters:

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

lrb.Sketch()
LoadRigidBody.Unblank()

Unblanks the load rigidbody

Returns:

No return value

Return type:

None

Example

To unblank load rigidbody lrb:

lrb.Unblank()
LoadRigidBody.Unsketch(redraw=Oasys.gRPC.defaultArg)

Unsketches the load rigidbody

Parameters:

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

lrb.Unsketch()
LoadRigidBody.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:

LoadRigidBody object

Return type:

dict

Example

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

if lrb.ViewParameters().GetParameter(lrb.example):
    do_something..
LoadRigidBody.Xrefs()

Returns the cross references for this load rigidbody

Returns:

Xrefs object

Return type:

dict

Example

To get the cross references for load rigidbody lrb:

xrefs = lrb.Xrefs()