Oasys.PRIMER.Slipring class

Properties

property Slipring.colour: Colour

The colour of the slipring

property Slipring.dc: float

Optional decay constant to allow a smooth transition between the static and dynamic friction coefficients

property Slipring.direct: integer

Direction of belt movement

property Slipring.exists(read only): boolean

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

property Slipring.fc: float

Coulomb dynamic friction coefficient

property Slipring.fcs: float

Coulomb static friction coefficient

property Slipring.funcid: integer

Function ID to determine friction coefficient

property Slipring.include: integer

The Include file number that the slipring is in

property Slipring.k: float

Optional coefficient for determining the Coulomb friction coefficient related to angle alpha

property Slipring.label: integer

Slipring number. Also see the sbsrid property which is an alternative name for this

property Slipring.lcnffd: integer

Loadcurve for Coulomb dynamic friction

property Slipring.lcnffs: integer

Loadcurve for Coulomb static friction

property Slipring.ltime: float

Slipring lockup time

property Slipring.model(read only): integer

The Model number that the slipring is in

property Slipring.onid: integer

Orientation Node number

property Slipring.sbid1: integer

Seatbelt number 1 (or Set Shell number if sbrnid is negative)

property Slipring.sbid2: integer

Seatbelt number 2 (or Set Shell number if sbrnid is negative)

property Slipring.sbrnid: integer

Node number (or Set Node number if negative)

property Slipring.sbsrid: integer

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

property Slipring.shell_seatbelt(read only): boolean

true if slipring is used for shell (2D) seatbelt elements

property Slipring.transparency: integer

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

Constructor

classmethod Slipring(model, sbsrid, sbid1, sbid2, sbrnid)

Create a new Seatbelt Slipring object

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

  • sbsrid (integer) – Slipring number

  • sbid1 (integer) – Seatbelt number 1

  • sbid2 (integer) – Seatbelt number 2

  • sbrnid (integer) – Slipring Node number

Returns:

Slipring object

Return type:

dict

Example

To create a new seatbelt slipring in model m with label 100, seatbelts 10, 11 and node 20:

a = Oasys.PRIMER.Slipring(m, 100, 10, 11, 20)

Static methods

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

Blanks all of the sliprings in the model

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

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

Blanks all of the flagged sliprings in the model

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

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

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

Starts an interactive editing panel to create a slipring

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

Slipring object (or None if not made)

Return type:

dict

Example

To start creating an slipring in model m:

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

Returns the first slipring in the model

Parameters:

model (Model) – Model to get first slipring in

Returns:

Slipring object (or None if there are no sliprings in the model)

Return type:

Slipring

Example

To get the first slipring in model m:

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

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

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

Slipring label

Return type:

int

Example

To get the first free slipring label in model m:

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

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

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

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

Returns:

No return value

Return type:

None

Example

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

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

Returns a list of Slipring objects for all of the sliprings in a model in PRIMER

Parameters:

model (Model) – Model to get sliprings from

Returns:

List of Slipring objects

Return type:

list

Example

To make a list of Slipring objects for all of the sliprings in model m

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

Returns a list of Slipring objects for all of the flagged sliprings in a model in PRIMER

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

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

Returns:

List of Slipring objects

Return type:

list

Example

To make a list of Slipring objects for all of the sliprings in model m flagged with f

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

Returns the Slipring object for a slipring ID

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

  • number (integer) – number of the slipring you want the Slipring object for

Returns:

Slipring object (or None if slipring does not exist)

Return type:

Slipring

Example

To get the Slipring object for slipring 100 in model m

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

Returns the last slipring in the model

Parameters:

model (Model) – Model to get last slipring in

Returns:

Slipring object (or None if there are no sliprings in the model)

Return type:

Slipring

Example

To get the last slipring in model m:

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

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

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

Slipring label

Return type:

int

Example

To get the last free slipring label in model m:

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

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

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

Slipring label

Return type:

int

Example

To get the next free slipring label in model m:

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

Allows the user to pick a slipring

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

Slipring object (or None if not picked)

Return type:

dict

Example

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

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

Renumbers all of the sliprings in the model

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

  • start (integer) – Start point for renumbering

Returns:

No return value

Return type:

None

Example

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

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

Renumbers all of the flagged sliprings in the model

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

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

  • start (integer) – Start point for renumbering

Returns:

No return value

Return type:

None

Example

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

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

Allows the user to select sliprings using standard PRIMER object menus

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

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

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

Return type:

int

Example

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

Oasys.PRIMER.Slipring.Select(f, 'Select sliprings', m)

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

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

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

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

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

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

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

Returns the total number of sliprings in the model

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

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

Returns:

number of sliprings

Return type:

int

Example

To get the total number of sliprings in model m:

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

Unblanks all of the sliprings in the model

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

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

Unblanks all of the flagged sliprings in the model

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

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

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

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

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

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

Returns:

No return value

Return type:

None

Example

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

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

Unsketches all sliprings

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

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

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

Unsketches all flagged sliprings in the model

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

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

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

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

Instance methods

Slipring.AssociateComment(comment)

Associates a comment with a slipring

Parameters:

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

Returns:

No return value

Return type:

None

Example

To associate comment c to the slipring s:

s.AssociateComment(c)
Slipring.Blank()

Blanks the slipring

Returns:

No return value

Return type:

None

Example

To blank slipring s:

s.Blank()
Slipring.Blanked()

Checks if the slipring is blanked or not

Returns:

True if blanked, False if not

Return type:

bool

Example

To check if slipring s is blanked:

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

s.Browse()
Slipring.ClearFlag(flag)

Clears a flag on the slipring

Parameters:

flag (Flag) – Flag to clear on the slipring

Returns:

No return value

Return type:

None

Example

To clear flag f for slipring s:

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

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

Slipring object

Return type:

Slipring

Example

To copy slipring s into slipring z:

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

Detaches a comment from a slipring

Parameters:

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

Returns:

No return value

Return type:

None

Example

To detach comment c from the slipring s:

s.DetachComment(c)
Slipring.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 slipring s:

s.Edit()
Slipring.ExtractColour()

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

Returns:

colour value (integer)

Return type:

int

Example

To return the colour used for drawing slipring s:

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

Checks if the slipring is flagged or not

Parameters:

flag (Flag) – Flag to test on the slipring

Returns:

True if flagged, False if not

Return type:

bool

Example

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

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

Extracts the comments associated to a slipring

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

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

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

Parameters:

prop (string) – slipring property to get parameter for

Returns:

Parameter object if property is a parameter, None if not

Return type:

dict

Example

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

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

Returns the keyword for this slipring (*ELEMENT_SEATBELT_SLIPEROMETER) Note that a carriage return is not added. See also Slipring.KeywordCards()

Returns:

string containing the keyword

Return type:

str

Example

To get the keyword for slipring s:

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

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

Returns:

string containing the cards

Return type:

str

Example

To get the cards for slipring s:

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

Returns the next slipring in the model

Returns:

Slipring object (or None if there are no more sliprings in the model)

Return type:

Slipring

Example

To get the slipring in model m after slipring s:

s = s.Next()
Slipring.Previous()

Returns the previous slipring in the model

Returns:

Slipring object (or None if there are no more sliprings in the model)

Return type:

Slipring

Example

To get the slipring in model m before slipring s:

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

Sets a flag on the slipring

Parameters:

flag (Flag) – Flag to set on the slipring

Returns:

No return value

Return type:

None

Example

To set flag f for slipring s:

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

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

Parameters:

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

s.Sketch()
Slipring.Unblank()

Unblanks the slipring

Returns:

No return value

Return type:

None

Example

To unblank slipring s:

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

Unsketches the slipring

Parameters:

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

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

Slipring object

Return type:

dict

Example

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

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

Returns the cross references for this slipring

Returns:

Xrefs object

Return type:

dict

Example

To get the cross references for slipring s:

xrefs = s.Xrefs()