Oasys.PRIMER.Spotweld class

Properties

property Spotweld.colour: Colour

The colour of the spotweld

property Spotweld.ep: float

Effective plastic strain at failure

property Spotweld.exists(read only): boolean

true if constrained spotweld exists, false if referred to but not defined

property Spotweld.filtered_force: boolean

true if _FILTERED_FORCE option is set, false if not

property Spotweld.id: boolean

true if _ID option is set, false if not

property Spotweld.include: integer

The Include file number that the constrained spotweld is in

property Spotweld.label: integer

Constrained spotweld number

property Spotweld.m: float

Exponent for shear spotweld force

property Spotweld.model(read only): integer

The Model number that the spotweld is in

property Spotweld.n: float

Exponent for normal spotweld force

property Spotweld.n1: integer

Node ID

property Spotweld.n2: integer

Node ID

property Spotweld.nf: integer

Number of force vectors stored for filtering

property Spotweld.sn: float

Normal force at spotweld failure

property Spotweld.ss: float

Shear force at spotweld failure

property Spotweld.tf: float

Failure time for nodal constraint set

property Spotweld.tw: float

Time window for filtering

property Spotweld.wid: integer

Constrained spotweld number (identical to label)

Constructor

classmethod Spotweld(model, n1, n2, label=Oasys.gRPC.defaultArg)

Create a new Spotweld object

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

  • n1 (integer) – Node ID 1

  • n2 (integer) – Node ID 2

  • label (integer) – Optional. Constrained spotweld number

Returns:

Spotweld object

Return type:

dict

Example

To create a new constrained spotweld 500 in model m between nodes 10 and 11

s = Oasys.PRIMER.Spotweld(m, 10, 11, 500)

Static methods

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

Blanks all of the spotwelds in the model

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

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

Blanks all of the flagged spotwelds in the model

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

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

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

Starts an interactive editing panel to create a spotweld

Parameters:
  • model (Model) – Model that the spotweld 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:

Spotweld object (or None if not made)

Return type:

dict

Example

To start creating a spotweld in model s:

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

Returns the first spotweld in the model

Parameters:

model (Model) – Model to get first spotweld in

Returns:

Spotweld object (or None if there are no spotwelds in the model)

Return type:

Spotweld

Example

To get the first spotweld in model m:

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

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

Parameters:
  • model (Model) – Model to get first free spotweld 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:

Spotweld label

Return type:

int

Example

To get the first free spotweld label in model m:

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

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

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

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

Returns:

No return value

Return type:

None

Example

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

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

Returns a list of Spotweld objects for all of the spotwelds in a model in PRIMER

Parameters:

model (Model) – Model to get spotwelds from

Returns:

List of Spotweld objects

Return type:

list

Example

To make a list of Spotweld objects for all of the spotwelds in model m

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

Returns a list of Spotweld objects for all of the flagged spotwelds in a model in PRIMER

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

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

Returns:

List of Spotweld objects

Return type:

list

Example

To make a list of Spotweld objects for all of the spotwelds in model m flagged with f

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

Returns the Spotweld object for a spotweld ID

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

  • number (integer) – number of the spotweld you want the Spotweld object for

Returns:

Spotweld object (or None if spotweld does not exist)

Return type:

Spotweld

Example

To get the Spotweld object for spotweld 100 in model m

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

Returns the last spotweld in the model

Parameters:

model (Model) – Model to get last spotweld in

Returns:

Spotweld object (or None if there are no spotwelds in the model)

Return type:

Spotweld

Example

To get the last spotweld in model m:

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

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

Parameters:
  • model (Model) – Model to get last free spotweld 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:

Spotweld label

Return type:

int

Example

To get the last free spotweld label in model m:

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

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

Parameters:
  • model (Model) – Model to get next free spotweld 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:

Spotweld label

Return type:

int

Example

To get the next free spotweld label in model m:

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

Allows the user to pick a spotweld

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

Spotweld object (or None if not picked)

Return type:

dict

Example

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

s = Oasys.PRIMER.Spotweld.Pick('Pick spotweld from screen', m)
classmethod Spotweld.RenumberAll(model, start)

Renumbers all of the spotwelds in the model

Parameters:
  • model (Model) – Model that all spotwelds will be renumbered in

  • start (integer) – Start point for renumbering

Returns:

No return value

Return type:

None

Example

To renumber all of the spotwelds in model m, from 1000000:

Oasys.PRIMER.Spotweld.RenumberAll(m, 1000000)
classmethod Spotweld.RenumberFlagged(model, flag, start)

Renumbers all of the flagged spotwelds in the model

Parameters:
  • model (Model) – Model that all the flagged spotwelds will be renumbered in

  • flag (Flag) – Flag set on the spotwelds that you want to renumber

  • start (integer) – Start point for renumbering

Returns:

No return value

Return type:

None

Example

To renumber all of the spotwelds in model m flagged with f, from 1000000:

Oasys.PRIMER.Spotweld.RenumberFlagged(m, f, 1000000)
classmethod Spotweld.Select(flag, prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg)

Allows the user to select spotwelds using standard PRIMER object menus

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

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

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

Return type:

int

Example

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

Oasys.PRIMER.Spotweld.Select(f, 'Select spotwelds', m)

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

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

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

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

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

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

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

Returns the total number of spotwelds in the model

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

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

Returns:

number of spotwelds

Return type:

int

Example

To get the total number of spotwelds in model m:

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

Unblanks all of the spotwelds in the model

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

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

Unblanks all of the flagged spotwelds in the model

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

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

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

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

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

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

Returns:

No return value

Return type:

None

Example

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

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

Unsketches all spotwelds

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

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

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

Unsketches all flagged spotwelds in the model

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

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

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

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

Instance methods

Spotweld.AssociateComment(comment)

Associates a comment with a spotweld

Parameters:

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

Returns:

No return value

Return type:

None

Example

To associate comment c to the spotweld s:

s.AssociateComment(c)
Spotweld.Blank()

Blanks the spotweld

Returns:

No return value

Return type:

None

Example

To blank spotweld s:

s.Blank()
Spotweld.Blanked()

Checks if the spotweld is blanked or not

Returns:

True if blanked, False if not

Return type:

bool

Example

To check if spotweld s is blanked:

if s.Blanked():
    do_something..
Spotweld.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 spotweld s:

s.Browse()
Spotweld.ClearFlag(flag)

Clears a flag on the spotweld

Parameters:

flag (Flag) – Flag to clear on the spotweld

Returns:

No return value

Return type:

None

Example

To clear flag f for spotweld s:

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

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

Spotweld object

Return type:

Spotweld

Example

To copy spotweld s into spotweld z:

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

Detaches a comment from a spotweld

Parameters:

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

Returns:

No return value

Return type:

None

Example

To detach comment c from the spotweld s:

s.DetachComment(c)
Spotweld.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 spotweld s:

s.Edit()
Spotweld.ExtractColour()

Extracts the actual colour used for spotweld.
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 spotweld 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 spotweld

Returns:

colour value (integer)

Return type:

int

Example

To return the colour used for drawing spotweld s:

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

Checks if the spotweld is flagged or not

Parameters:

flag (Flag) – Flag to test on the spotweld

Returns:

True if flagged, False if not

Return type:

bool

Example

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

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

Extracts the comments associated to a spotweld

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

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

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

Parameters:

prop (string) – spotweld property to get parameter for

Returns:

Parameter object if property is a parameter, None if not

Return type:

dict

Example

To check if Spotweld 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 Spotweld property s.example is a parameter by using the GetParameter method:

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

Returns the keyword for this spotweld (*CONSTRAINED_SPOTWELD). Note that a carriage return is not added. See also Spotweld.KeywordCards()

Returns:

string containing the keyword

Return type:

str

Example

To get the keyword for spotweld s:

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

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

Returns:

string containing the cards

Return type:

str

Example

To get the cards for spotweld s:

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

Returns the next spotweld in the model

Returns:

Spotweld object (or None if there are no more spotwelds in the model)

Return type:

Spotweld

Example

To get the spotweld in model m after spotweld s:

s = s.Next()
Spotweld.Previous()

Returns the previous spotweld in the model

Returns:

Spotweld object (or None if there are no more spotwelds in the model)

Return type:

Spotweld

Example

To get the spotweld in model m before spotweld s:

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

Sets a flag on the spotweld

Parameters:

flag (Flag) – Flag to set on the spotweld

Returns:

No return value

Return type:

None

Example

To set flag f for spotweld s:

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

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

Parameters:

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

s.Sketch()
Spotweld.Unblank()

Unblanks the spotweld

Returns:

No return value

Return type:

None

Example

To unblank spotweld s:

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

Unsketches the spotweld

Parameters:

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

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

Spotweld object

Return type:

dict

Example

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

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

Returns the cross references for this spotweld

Returns:

Xrefs object

Return type:

dict

Example

To get the cross references for spotweld s:

xrefs = s.Xrefs()