Oasys.PRIMER.Joint class

Constants

Joint.CONSTANT_VELOCITY

CONSTANT_VELOCITY is *CONSTRAINED_JOINT_CONSTANT_VELOCITY

Joint.CYLINDRICAL

CYLINDRICAL is *CONSTRAINED_JOINT_CYLINDRICAL

Joint.GEARS

GEARS is *CONSTRAINED_JOINT_GEARS

Joint.LOCKING

LOCKING is *CONSTRAINED_JOINT_LOCKING

Joint.PLANAR

PLANAR is *CONSTRAINED_JOINT_PLANAR

Joint.PULLEY

PULLEY is *CONSTRAINED_JOINT_PULLEY

Joint.RACK_AND_PINION

RACK_AND_PINION is *CONSTRAINED_JOINT_RACK_AND_PINION

Joint.REVOLUTE

REVOLUTE is *CONSTRAINED_JOINT_REVOLUTE

Joint.ROTATIONAL_MOTOR

ROTATIONAL_MOTOR is *CONSTRAINED_JOINT_ROTATIONAL_MOTOR

Joint.SCREW

SCREW is *CONSTRAINED_JOINT_SCREW

Joint.SPHERICAL

SPHERICAL is *CONSTRAINED_JOINT_SPHERICAL

Joint.TRANSLATIONAL

TRANSLATIONAL is *CONSTRAINED_JOINT_TRANSLATIONAL

Joint.TRANSLATIONAL_MOTOR

TRANSLATIONAL_MOTOR is *CONSTRAINED_JOINT_TRANSLATIONAL_MOTOR

Joint.UNIVERSAL

UNIVERSAL is *CONSTRAINED_JOINT_UNIVERSAL

Properties

property Joint.cid: integer

Coordinate system number

property Joint.colour: Colour

The colour of the joint

property Joint.coupl: float

Coupling between force and moment failure

property Joint.damp: float

Damping scale factor

property Joint.exists(read only): boolean

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

property Joint.failure: boolean

true if _FAILURE option is set, false if not

property Joint.h_angle: float

Helix angle for gears

property Joint.heading: string

Constrained joint heading

property Joint.id: boolean

true if _ID option is set, false if not

property Joint.include: integer

The Include file number that the constrained joint is in

property Joint.jid: integer

Constrained joint number (identical to label)

property Joint.label: integer

Constrained joint number

property Joint.lcid: integer

Loadcuve number

property Joint.local: boolean

true if _LOCAL option is set, false if not

property Joint.lst: integer

Local system type is accelerometer if lst is 1, rigid body if 0

property Joint.model(read only): integer

The Model number that the joint is in

property Joint.mxx: float

Torsional moment resultant at failure

property Joint.myy: float

Moment resultant at failure

property Joint.mzz: float

Moment resultant at failure

property Joint.n1: integer

Node number 1

property Joint.n2: integer

Node number 2

property Joint.n3: integer

Node number 3

property Joint.n4: integer

Node number 4

property Joint.n5: integer

Node number 5

property Joint.n6: integer

Node number 6

property Joint.nxx: float

Axial force resultant at failure

property Joint.nyy: float

Force resultant at failure

property Joint.nzz: float

Force resultant at failure

property Joint.option: constant

The Constrained Joint option. Can be: Joint.SPHERICAL, Joint.REVOLUTE, Joint.CYLINDRICAL, Joint.PLANAR, Joint.UNIVERSAL, Joint.TRANSLATIONAL, Joint.LOCKING, Joint.TRANSLATIONAL_MOTOR, Joint.ROTATIONAL_MOTOR, Joint.GEARS, Joint.RACK_AND_PINION, Joint.CONSTANT_VELOCITY, Joint.PULLEY or Joint.SCREW

property Joint.parm: float

Parameter for function

property Joint.r1: float

Gear and pulley radius

property Joint.raid: integer

Rigid body or accelerometer number

property Joint.rps: float

Relative penalty stiffness

property Joint.tfail: float

Time for joint failure

property Joint.type: integer

Flag for motor type

Constructor

classmethod Joint(model, options)

Create a new Joint object

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

  • options (dict) –

    Options for creating the joint

    heading (optional):

    (string) Constrained joint title

    id (optional):

    (integer) Constrained joint ID. If omitted, the joint will be created without the _ID option

    nodes:

    (array) List of Node IDs for the joint. At least 2 nodes must be given

    type:

    (constant) Constrained joint type (any)

Returns:

Joint object

Return type:

dict

Example

To create a new constrained joint 500 called “test spherical joint” of type _SPHERICAL in model m with nodes 50 and 150

j = Oasys.PRIMER.Joint(m, { 'type': Oasys.PRIMER.Joint.SPHERICAL, 'nodes': [50, 150], 'id': 500, 'heading': 'test spherical joint' } )

To create a new constrained joint 500 called “test revolute joint” of type _REVOLUTE in model m with nodes 50, 100, 150 and 200

j = Oasys.PRIMER.Joint(m, { 'type': Oasys.PRIMER.Joint.REVOLUTE, 'nodes': [50, 100, 150, 200], 'id': 500, 'heading': 'test revolute joint' } )

To create a new constrained joint 500 called “test translational joint” of type _TRANSLATIONAL in model m with nodes 50, 100, 150, 200, 250 and 300

j = Oasys.PRIMER.Joint(m, { 'type': Oasys.PRIMER.Joint.TRANSLATIONAL, 'nodes': [50, 100, 150, 200, 250, 300], 'id': 500, 'heading': 'test translational joint' } )

Static methods

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

Blanks all of the joints in the model

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

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

Blanks all of the flagged joints in the model

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

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

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

Starts an interactive editing panel to create a joint

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

Joint object (or None if not made)

Return type:

dict

Example

To start creating a joint in model n:

j = Oasys.PRIMER.Joint.Create(m)
classmethod Joint.First(model)

Returns the first joint in the model

Parameters:

model (Model) – Model to get first joint in

Returns:

Joint object (or None if there are no joints in the model)

Return type:

Joint

Example

To get the first joint in model m:

j = Oasys.PRIMER.Joint.First(m)
classmethod Joint.FirstFreeLabel(model, layer=Oasys.gRPC.defaultArg)

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

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

Joint label

Return type:

int

Example

To get the first free joint label in model m:

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

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

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

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

Returns:

No return value

Return type:

None

Example

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

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

Returns a list of Joint objects for all of the joints in a model in PRIMER

Parameters:

model (Model) – Model to get joints from

Returns:

List of Joint objects

Return type:

list

Example

To make a list of Joint objects for all of the joints in model m

j = Oasys.PRIMER.Joint.GetAll(m)
classmethod Joint.GetFlagged(model, flag)

Returns a list of Joint objects for all of the flagged joints in a model in PRIMER

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

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

Returns:

List of Joint objects

Return type:

list

Example

To make a list of Joint objects for all of the joints in model m flagged with f

j = Oasys.PRIMER.Joint.GetFlagged(m, f)
classmethod Joint.GetFromID(model, number)

Returns the Joint object for a joint ID

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

  • number (integer) – number of the joint you want the Joint object for

Returns:

Joint object (or None if joint does not exist)

Return type:

Joint

Example

To get the Joint object for joint 100 in model m

j = Oasys.PRIMER.Joint.GetFromID(m, 100)
classmethod Joint.Last(model)

Returns the last joint in the model

Parameters:

model (Model) – Model to get last joint in

Returns:

Joint object (or None if there are no joints in the model)

Return type:

Joint

Example

To get the last joint in model m:

j = Oasys.PRIMER.Joint.Last(m)
classmethod Joint.LastFreeLabel(model, layer=Oasys.gRPC.defaultArg)

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

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

Joint label

Return type:

int

Example

To get the last free joint label in model m:

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

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

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

Joint label

Return type:

int

Example

To get the next free joint label in model m:

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

Allows the user to pick a joint

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

Joint object (or None if not picked)

Return type:

dict

Example

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

j = Oasys.PRIMER.Joint.Pick('Pick joint from screen', m)
classmethod Joint.RenumberAll(model, start)

Renumbers all of the joints in the model

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

  • start (integer) – Start point for renumbering

Returns:

No return value

Return type:

None

Example

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

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

Renumbers all of the flagged joints in the model

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

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

  • start (integer) – Start point for renumbering

Returns:

No return value

Return type:

None

Example

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

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

Allows the user to select joints using standard PRIMER object menus

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

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

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

Return type:

int

Example

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

Oasys.PRIMER.Joint.Select(f, 'Select joints', m)

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

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

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

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

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

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

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

Returns the total number of joints in the model

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

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

Returns:

number of joints

Return type:

int

Example

To get the total number of joints in model m:

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

Unblanks all of the joints in the model

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

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

Unblanks all of the flagged joints in the model

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

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

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

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

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

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

Returns:

No return value

Return type:

None

Example

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

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

Unsketches all joints

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

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

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

Unsketches all flagged joints in the model

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

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

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

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

Instance methods

Joint.AssociateComment(comment)

Associates a comment with a joint

Parameters:

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

Returns:

No return value

Return type:

None

Example

To associate comment c to the joint j:

j.AssociateComment(c)
Joint.Blank()

Blanks the joint

Returns:

No return value

Return type:

None

Example

To blank joint j:

j.Blank()
Joint.Blanked()

Checks if the joint is blanked or not

Returns:

True if blanked, False if not

Return type:

bool

Example

To check if joint j is blanked:

if j.Blanked():
    do_something..
Joint.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 joint j:

j.Browse()
Joint.ClearFlag(flag)

Clears a flag on the joint

Parameters:

flag (Flag) – Flag to clear on the joint

Returns:

No return value

Return type:

None

Example

To clear flag f for joint j:

j.ClearFlag(f)
Joint.Copy(range=Oasys.gRPC.defaultArg)

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

Joint object

Return type:

Joint

Example

To copy joint j into joint z:

z = j.Copy()
Joint.DetachComment(comment)

Detaches a comment from a joint

Parameters:

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

Returns:

No return value

Return type:

None

Example

To detach comment c from the joint j:

j.DetachComment(c)
Joint.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 joint j:

j.Edit()
Joint.ExtractColour()

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

Returns:

colour value (integer)

Return type:

int

Example

To return the colour used for drawing joint j:

colour = j.ExtractColour()
Joint.Flagged(flag)

Checks if the joint is flagged or not

Parameters:

flag (Flag) – Flag to test on the joint

Returns:

True if flagged, False if not

Return type:

bool

Example

To check if joint j has flag f set on it:

if j.Flagged(f):
    do_something..
Joint.GetComments()

Extracts the comments associated to a joint

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 joint j:

comm_list = j.GetComments()
Joint.GetParameter(prop)

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

Parameters:

prop (string) – joint property to get parameter for

Returns:

Parameter object if property is a parameter, None if not

Return type:

dict

Example

To check if Joint property j.example is a parameter:

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

To check if Joint property j.example is a parameter by using the GetParameter method:

if j.ViewParameters().GetParameter(j.example):
    do_something..
Joint.Keyword()

Returns the keyword for this joint (*CONSTRAINED_JOINT). Note that a carriage return is not added. See also Joint.KeywordCards()

Returns:

string containing the keyword

Return type:

str

Example

To get the keyword for joint j:

key = j.Keyword()
Joint.KeywordCards()

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

Returns:

string containing the cards

Return type:

str

Example

To get the cards for joint j:

cards = j.KeywordCards()
Joint.Next()

Returns the next joint in the model

Returns:

Joint object (or None if there are no more joints in the model)

Return type:

Joint

Example

To get the joint in model m after joint j:

j = j.Next()
Joint.Previous()

Returns the previous joint in the model

Returns:

Joint object (or None if there are no more joints in the model)

Return type:

Joint

Example

To get the joint in model m before joint j:

j = j.Previous()
Joint.SetFlag(flag)

Sets a flag on the joint

Parameters:

flag (Flag) – Flag to set on the joint

Returns:

No return value

Return type:

None

Example

To set flag f for joint j:

j.SetFlag(f)
Joint.Sketch(redraw=Oasys.gRPC.defaultArg)

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

Parameters:

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

j.Sketch()
Joint.Unblank()

Unblanks the joint

Returns:

No return value

Return type:

None

Example

To unblank joint j:

j.Unblank()
Joint.Unsketch(redraw=Oasys.gRPC.defaultArg)

Unsketches the joint

Parameters:

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

j.Unsketch()
Joint.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:

Joint object

Return type:

dict

Example

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

if j.ViewParameters().GetParameter(j.example):
    do_something..
Joint.Xrefs()

Returns the cross references for this joint

Returns:

Xrefs object

Return type:

dict

Example

To get the cross references for joint j:

xrefs = j.Xrefs()