Oasys.PRIMER.Seatbelt2D class

Properties

property Seatbelt2D.colour: Colour

The colour of the seatbelt

property Seatbelt2D.eid: integer

Seatbelt2D number. Also see the label property which is an alternative name for this

property Seatbelt2D.exists(read only): boolean

true if seatbelt exists, false if referred to but not defined

property Seatbelt2D.include: integer

The Include file number that the seatbelt is in

property Seatbelt2D.label: integer

Seatbelt2D number. Also see the eid property which is an alternative name for this

property Seatbelt2D.model(read only): integer

The Model number that the seatbelt is in

property Seatbelt2D.n1: integer

Node 1 ID

property Seatbelt2D.n2: integer

Node 2 ID

property Seatbelt2D.n3: integer

Node 3 ID

property Seatbelt2D.n4: integer

Node 4 ID

property Seatbelt2D.pid: integer

Part ID

property Seatbelt2D.sbrid: integer

Retractor ID

property Seatbelt2D.slen: float

Initial slack length

property Seatbelt2D.transparency: integer

The transparency of the seatbelt (0-100) 0% is opaque, 100% is transparent

Constructor

classmethod Seatbelt2D(model, eid, pid, n1, n2, n3, n4)

Create a new Seatbelt2D object

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

  • eid (integer) – Seatbelt ID

  • pid (integer) – Part number

  • n1 (integer) – Node 1 ID

  • n2 (integer) – Node 2 ID

  • n3 (integer) – Node 3 ID

  • n4 (integer) – Node 4 ID

Returns:

Seatbelt2D object

Return type:

dict

Example

To create a new 4 noded element seatbelt in model m with label 100, part 10 and nodes 20, 21, 22, 23:

a = Oasys.PRIMER.Seatbelt2D(m, 100, 10, 20, 21, 22, 23)

Static methods

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

Blanks all of the seatbelts in the model

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

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

Blanks all of the flagged seatbelts in the model

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

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

Oasys.PRIMER.Seatbelt2D.BlankFlagged(m, f)
classmethod Seatbelt2D.Create(model, modal=Oasys.gRPC.defaultArg)

Starts an interactive editing panel to create a 2 noded seatbelt

Parameters:
  • model (Model) – Model that the seatbelt will be created in

  • modal (boolean) – Optional. If this window is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the window will be modal

Returns:

Seatbelt2D object (or None if not made)

Return type:

dict

Example

To start creating a seatbelt in model m:

s = Oasys.PRIMER.Seatbelt2D.Create(m)
classmethod Seatbelt2D.First(model)

Returns the first seatbelt in the model

Parameters:

model (Model) – Model to get first seatbelt in

Returns:

Seatbelt2D object (or None if there are no seatbelts in the model)

Return type:

Seatbelt2D

Example

To get the first seatbelt in model m:

s = Oasys.PRIMER.Seatbelt2D.First(m)
classmethod Seatbelt2D.FirstFreeLabel(model, layer=Oasys.gRPC.defaultArg)

Returns the first free seatbelt label in the model. Also see Seatbelt2D.LastFreeLabel(), Seatbelt2D.NextFreeLabel() and Model.FirstFreeItemLabel()

Parameters:
  • model (Model) – Model to get first free seatbelt label in

  • layer (Include number) – Optional. Include file (0 for the main file) to search for labels in (Equivalent to First free in layer in editing panels). If omitted the whole model will be used (Equivalent to First free in editing panels)

Returns:

Seatbelt2D label

Return type:

int

Example

To get the first free seatbelt label in model m:

label = Oasys.PRIMER.Seatbelt2D.FirstFreeLabel(m)
classmethod Seatbelt2D.FlagAll(model, flag)

Flags all of the seatbelts in the model with a defined flag

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

  • flag (Flag) – Flag to set on the seatbelts

Returns:

No return value

Return type:

None

Example

To flag all of the seatbelts with flag f in model m:

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

Returns a list of Seatbelt2D objects for all of the seatbelts in a model in PRIMER

Parameters:

model (Model) – Model to get seatbelts from

Returns:

List of Seatbelt2D objects

Return type:

list

Example

To make a list of Seatbelt2D objects for all of the seatbelts in model m

s = Oasys.PRIMER.Seatbelt2D.GetAll(m)
classmethod Seatbelt2D.GetFlagged(model, flag)

Returns a list of Seatbelt2D objects for all of the flagged seatbelts in a model in PRIMER

Parameters:
  • model (Model) – Model to get seatbelts from

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

Returns:

List of Seatbelt2D objects

Return type:

list

Example

To make a list of Seatbelt2D objects for all of the seatbelts in model m flagged with f

s = Oasys.PRIMER.Seatbelt2D.GetFlagged(m, f)
classmethod Seatbelt2D.GetFromID(model, number)

Returns the Seatbelt2D object for a seatbelt ID

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

  • number (integer) – number of the seatbelt you want the Seatbelt2D object for

Returns:

Seatbelt2D object (or None if seatbelt does not exist)

Return type:

Seatbelt2D

Example

To get the Seatbelt2D object for seatbelt 100 in model m

s = Oasys.PRIMER.Seatbelt2D.GetFromID(m, 100)
classmethod Seatbelt2D.Last(model)

Returns the last seatbelt in the model

Parameters:

model (Model) – Model to get last seatbelt in

Returns:

Seatbelt2D object (or None if there are no seatbelts in the model)

Return type:

Seatbelt2D

Example

To get the last seatbelt in model m:

s = Oasys.PRIMER.Seatbelt2D.Last(m)
classmethod Seatbelt2D.LastFreeLabel(model, layer=Oasys.gRPC.defaultArg)

Returns the last free seatbelt label in the model. Also see Seatbelt2D.FirstFreeLabel(), Seatbelt2D.NextFreeLabel() and see Model.LastFreeItemLabel()

Parameters:
  • model (Model) – Model to get last free seatbelt label in

  • layer (Include number) – Optional. Include file (0 for the main file) to search for labels in (Equivalent to Highest free in layer in editing panels). If omitted the whole model will be used

Returns:

Seatbelt2D label

Return type:

int

Example

To get the last free seatbelt label in model m:

label = Oasys.PRIMER.Seatbelt2D.LastFreeLabel(m)
classmethod Seatbelt2D.NextFreeLabel(model, layer=Oasys.gRPC.defaultArg)

Returns the next free (highest+1) seatbelt label in the model. Also see Seatbelt2D.FirstFreeLabel(), Seatbelt2D.LastFreeLabel() and Model.NextFreeItemLabel()

Parameters:
  • model (Model) – Model to get next free seatbelt label in

  • layer (Include number) – Optional. Include file (0 for the main file) to search for labels in (Equivalent to Highest+1 in layer in editing panels). If omitted the whole model will be used (Equivalent to Highest+1 in editing panels)

Returns:

Seatbelt2D label

Return type:

int

Example

To get the next free seatbelt label in model m:

label = Oasys.PRIMER.Seatbelt2D.NextFreeLabel(m)
classmethod Seatbelt2D.Pick(prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg, button_text=Oasys.gRPC.defaultArg)

Allows the user to pick a seatbelt

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

Seatbelt2D object (or None if not picked)

Return type:

dict

Example

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

s = Oasys.PRIMER.Seatbelt2D.Pick('Pick seatbelt from screen', m)
classmethod Seatbelt2D.Select(flag, prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg)

Allows the user to select seatbelts using standard PRIMER object menus

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

  • prompt (string) – Text to display as a prompt to the user

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

Return type:

int

Example

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

Oasys.PRIMER.Seatbelt2D.Select(f, 'Select seatbelts', m)

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

Oasys.PRIMER.Seatbelt2D.Select(f, 'Select seatbelts', l)
classmethod Seatbelt2D.SketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)

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

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

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

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

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

Returns the total number of seatbelts in the model

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

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

Returns:

number of seatbelts

Return type:

int

Example

To get the total number of seatbelts in model m:

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

Unblanks all of the seatbelts in the model

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

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

Unblanks all of the flagged seatbelts in the model

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

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

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

Unsets a defined flag on all of the seatbelts in the model

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

  • flag (Flag) – Flag to unset on the seatbelts

Returns:

No return value

Return type:

None

Example

To unset the flag f on all the seatbelts in model m:

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

Unsketches all seatbelts

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

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

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

Unsketches all flagged seatbelts in the model

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

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

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

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

Instance methods

Seatbelt2D.AssociateComment(comment)

Associates a comment with a seatbelt

Parameters:

comment (Comment) – Comment that will be attached to the seatbelt

Returns:

No return value

Return type:

None

Example

To associate comment c to the seatbelt s:

s.AssociateComment(c)
Seatbelt2D.Blank()

Blanks the seatbelt

Returns:

No return value

Return type:

None

Example

To blank seatbelt s:

s.Blank()
Seatbelt2D.Blanked()

Checks if the seatbelt is blanked or not

Returns:

True if blanked, False if not

Return type:

bool

Example

To check if seatbelt s is blanked:

if s.Blanked():
    do_something..
Seatbelt2D.Browse(modal=Oasys.gRPC.defaultArg)

Starts an edit panel in Browse mode

Parameters:

modal (boolean) – Optional. If this window is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the window will be modal

Returns:

no return value

Return type:

None

Example

To Browse seatbelt s:

s.Browse()
Seatbelt2D.ClearFlag(flag)

Clears a flag on the seatbelt

Parameters:

flag (Flag) – Flag to clear on the seatbelt

Returns:

No return value

Return type:

None

Example

To clear flag f for seatbelt s:

s.ClearFlag(f)
Seatbelt2D.Copy(range=Oasys.gRPC.defaultArg)

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

Seatbelt2D object

Return type:

Seatbelt2D

Example

To copy seatbelt s into seatbelt z:

z = s.Copy()
Seatbelt2D.DetachComment(comment)

Detaches a comment from a seatbelt

Parameters:

comment (Comment) – Comment that will be detached from the seatbelt

Returns:

No return value

Return type:

None

Example

To detach comment c from the seatbelt s:

s.DetachComment(c)
Seatbelt2D.Edit(modal=Oasys.gRPC.defaultArg)

Starts an interactive editing panel

Parameters:

modal (boolean) – Optional. If this window is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the window will be modal

Returns:

no return value

Return type:

None

Example

To Edit seatbelt s:

s.Edit()
Seatbelt2D.ExtractColour()

Extracts the actual colour used for seatbelt.
By default in PRIMER many entities such as elements get their colour automatically from the part that they are in. PRIMER cycles through 13 default colours based on the label of the entity. In this case the seatbelt colour property will return the value Colour.PART instead of the actual colour. This method will return the actual colour which is used for drawing the seatbelt

Returns:

colour value (integer)

Return type:

int

Example

To return the colour used for drawing seatbelt s:

colour = s.ExtractColour()
Seatbelt2D.Flagged(flag)

Checks if the seatbelt is flagged or not

Parameters:

flag (Flag) – Flag to test on the seatbelt

Returns:

True if flagged, False if not

Return type:

bool

Example

To check if seatbelt s has flag f set on it:

if s.Flagged(f):
    do_something..
Seatbelt2D.GetComments()

Extracts the comments associated to a seatbelt

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 seatbelt s:

comm_list = s.GetComments()
Seatbelt2D.GetParameter(prop)

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

Parameters:

prop (string) – seatbelt property to get parameter for

Returns:

Parameter object if property is a parameter, None if not

Return type:

dict

Example

To check if Seatbelt2D property s.example is a parameter:

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

To check if Seatbelt2D property s.example is a parameter by using the GetParameter method:

if s.ViewParameters().GetParameter(s.example):
    do_something..
Seatbelt2D.Keyword()

Returns the keyword for this seatbelt (*ELEMENT_SEATBELT) Note that a carriage return is not added. See also Seatbelt2D.KeywordCards()

Returns:

string containing the keyword

Return type:

str

Example

To get the keyword for seatbelt s:

key = s.Keyword()
Seatbelt2D.KeywordCards()

Returns the keyword cards for the seatbelt. Note that a carriage return is not added. See also Seatbelt2D.Keyword()

Returns:

string containing the cards

Return type:

str

Example

To get the cards for seatbelt s:

cards = s.KeywordCards()
Seatbelt2D.Next()

Returns the next seatbelt in the model

Returns:

Seatbelt2D object (or None if there are no more seatbelts in the model)

Return type:

Seatbelt2D

Example

To get the seatbelt in model m after seatbelt s:

s = s.Next()
Seatbelt2D.Previous()

Returns the previous seatbelt in the model

Returns:

Seatbelt2D object (or None if there are no more seatbelts in the model)

Return type:

Seatbelt2D

Example

To get the seatbelt in model m before seatbelt s:

s = s.Previous()
Seatbelt2D.SetFlag(flag)

Sets a flag on the seatbelt

Parameters:

flag (Flag) – Flag to set on the seatbelt

Returns:

No return value

Return type:

None

Example

To set flag f for seatbelt s:

s.SetFlag(f)
Seatbelt2D.Sketch(redraw=Oasys.gRPC.defaultArg)

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

Parameters:

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

s.Sketch()
Seatbelt2D.Unblank()

Unblanks the seatbelt

Returns:

No return value

Return type:

None

Example

To unblank seatbelt s:

s.Unblank()
Seatbelt2D.Unsketch(redraw=Oasys.gRPC.defaultArg)

Unsketches the seatbelt

Parameters:

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

s.Unsketch()
Seatbelt2D.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:

Seatbelt2D object

Return type:

dict

Example

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

if s.ViewParameters().GetParameter(s.example):
    do_something..
Seatbelt2D.Xrefs()

Returns the cross references for this seatbelt

Returns:

Xrefs object

Return type:

dict

Example

To get the cross references for seatbelt s:

xrefs = s.Xrefs()