Oasys.PRIMER.Conx class¶
Constants¶
- Conx.ADHESIVE¶
Connection is adhesive
- Conx.ADHESIVE_PATCH¶
Connection adhesive type is a patch
- Conx.ADHESIVE_SOLID¶
Connection adhesive type is a solid line
- Conx.ASSEMBLY¶
If the connection refers to an assembly rather than individual layers, the assembly is defined by part tree assembly
- Conx.BAD¶
Connection is bad (e.g. necessary data is missing)
- Conx.BOLT¶
Connection is a bolt
- Conx.BOLT_MODULE¶
Library bolt
- Conx.BOLT_MRG_2PTS¶
2pt Patch Beam
- Conx.BOLT_MRG_2PTS_RB¶
2pt Patch (Rigid Beam)
- Conx.BOLT_MRG_2PTS_RJ¶
2pt Patch Revolute joint
- Conx.BOLT_MRG_CYL¶
Cylindrical Merge
- Conx.BOLT_MRG_CYL_BALL¶
Cylindrical Patch Ball joint
- Conx.BOLT_MRG_CYL_BEAM¶
Cylindrical Patch Beam
- Conx.BOLT_NRB_2PTS¶
2pt NRB Beam
- Conx.BOLT_NRB_CYL¶
Cylindrical NRB
- Conx.BOLT_NRB_CYL_BALL¶
Cylindrical NRB Ball joint
- Conx.BOLT_NRB_CYL_BEAM¶
Cylindrical NRB Beam
- Conx.BOLT_NRB_SPH¶
Spherical NRB
- Conx.BOLT_NRB_SPH_BALL¶
Spherical NRB Ball joint
- Conx.BOLT_NRB_SPH_DISC¶
Spherical NRB Discrete Beam
- Conx.DORMANT¶
Connection is dormant (not yet made)
- Conx.INVALID¶
Connection has been made but something is wrong (e.g. part moved)
- Conx.MADE¶
Connection has been made but status is unknown
- Conx.PART_SET¶
If the connection refers to an assembly rather than individual layers, the assembly is defined by part set
- Conx.REALIZED¶
Connection has been made and is OK (checks OK)
- Conx.RIVET¶
Connection is rivet
- Conx.SPOTWELD¶
Connection is a spotweld
- Conx.SPOTWELD_BEAM¶
Connection spotweld type is beam
- Conx.SPOTWELD_LINE¶
Connection is a spotweld line
- Conx.SPOTWELD_MIG¶
Connection spotweld type is (beam) MIG weld
- Conx.SPOTWELD_SOLID1¶
Connection spotweld type is one solid/spotweld layer
- Conx.SPOTWELD_SOLID12¶
Connection spotweld type is twelve solids/spotweld layer
- Conx.SPOTWELD_SOLID16¶
Connection spotweld type is sixteen solids/spotweld layer
- Conx.SPOTWELD_SOLID4¶
Connection spotweld type is four solids/spotweld layer
- Conx.SPOTWELD_SOLID8¶
Connection spotweld type is eight solids/spotweld layer
Properties¶
- property Conx.adhesive_esize: float¶
Element size along the length of the adhesive run
- property Conx.adhesive_nelem: integer¶
The number of elements across the width of the adhesive
- property Conx.adhesive_width: float¶
The width of the adhesive run
- property Conx.angtol: float¶
angle tolerance for bolt
- property Conx.angtol2: float¶
angle tolerance at end 2 for 2 point bolt
- property Conx.assembly: integer/string¶
Assembly used to specify panels connection together, rather than individual layers. Integer for a part set ID, string for a PRIMER assembly (name)
- property Conx.assembly_type: constant¶
The assembly type. Can be
Conx.PART_SET
orConx.ASSEMBLY
- property Conx.colour: Colour¶
The colour of the connection
- property Conx.diameter: float¶
Diameter of spotweld/rigid
- property Conx.diameter2: float¶
Diameter of rigid at end 2
- property Conx.edge_distance: float¶
Spotweld line edge distance
- property Conx.edge_lock: boolean¶
true if a spotweld line is locked to an edge, false if not
- property Conx.error(read only): string¶
Description of the error if the connection cannot be made
- property Conx.error_details(read only): string¶
Details of the error if the connection cannot be made
- property Conx.fit: integer¶
contact fitting method for library bolts
- property Conx.id: integer¶
Conx
number. Also see thelabel
property which is an alternative name for this
- property Conx.label: integer¶
Conx
number. Also see theid
property which is an alternative name for this
- property Conx.layers: integer¶
The number of layers the connection has
- property Conx.length: float¶
Length of 1 point bolt, max thickness for 2 point bolt
- property Conx.length2: float¶
max thickness at end 2 for 2 point bolt
- property Conx.material: integer¶
The ID of the
Material
used for ‘merge’ bolt connections. i.e.Conx.BOLT_MRG_CYL
,Conx.BOLT_MRG_CYL_BEAM
,
- property Conx.module: string¶
name of library module for bolt
- property Conx.part: integer¶
The ID of the
Part
used for adhesive or spotweld connections. Note that in v11.0 and above you are able to specify a different part IDs for elements in the connection between different layers. If you only have one part for the elements in the connection, then this is the value of this property. If there is more than one used, then the value of this property is the first part. If you set this property to a new value, then the all the elements in the connection will have this new part ID when it is realized. To set and retrieve information on parts used between different layers, the functions GetPidData() and SetPidData() should be used
- property Conx.patch_coords: integer¶
The number of patch coordinate points the connection has (Adhesive patch only)
- property Conx.patch_topol: integer¶
The number of patch topology entries the connection has (Adhesive patch only)
- property Conx.path: integer¶
The number of path points the connection has (Adhesive only). Note that these points do NOT include the start and end points for the adhesive run. These are defined using the properties
x
,y
,z
andx2
,y2
,z2
- property Conx.pitch: float¶
Spotweld line pitch
- property Conx.resize: integer¶
snap to points fitting method for library bolts
- property Conx.saved_settings: boolean¶
Whether settings are saved for a connection or not
- property Conx.shape: integer¶
shape for bolt attachment
- property Conx.shape2: integer¶
shape for bolt attachment at end 2 for 2 point bolt
- property Conx.spr2_id(read only): integer¶
Internal label of C_SPR2 which applied to this rivet connection
- property Conx.spr2_match: boolean¶
True to use matching C_SPR2 for this rivet. False to create new C_SPR2 for each rivet. IF unset, a new C_SPR2 will be created
True if C_SPR2 is unique for this rivet
- property Conx.status: constant¶
The status of the connection. Can be
Conx.DORMANT
,Conx.MADE
,Conx.INVALID
,Conx.REALIZED
orConx.BAD
- property Conx.subtype: constant¶
The connection subtype. For
SPOTWELD
andSPOTWELD_LINE
connections the subtype can be:Conx.SPOTWELD_BEAM
Conx.SPOTWELD_MIG
Conx.SPOTWELD_SOLID1
Conx.SPOTWELD_SOLID4
Conx.SPOTWELD_SOLID8
Conx.SPOTWELD_SOLID12
Conx.SPOTWELD_SOLID16
ForBOLT
connections the subtype can be:Conx.BOLT_MRG_CYL
Conx.BOLT_MRG_CYL_BEAM
Conx.BOLT_MRG_CYL_BALL
Conx.BOLT_MRG_2PTS
Conx.BOLT_MRG_2PTS_RB
Conx.BOLT_MRG_2PTS_RJ
Conx.BOLT_MRG_CYL
Conx.BOLT_NRB_CYL_BEAM
Conx.BOLT_NRB_CYL_BALL
Conx.BOLT_NRB_SPH
Conx.BOLT_NRB_SPH_BALL
Conx.BOLT_NRB_SPH_DISC
Conx.BOLT_NRB_2PTS
Conx.BOLT_MODULE
ForADHESIVE
connections the subtype can be:Conx.ADHESIVE_SOLID
.Conx.ADHESIVE_PATCH
- property Conx.title: string¶
Title for connection
- property Conx.transparency: integer¶
The transparency of the connection (0-100) 0% is opaque, 100% is transparent
- property Conx.type: constant¶
The connection type. Can be
Conx.SPOTWELD
,Conx.BOLT
orConx.RIVET
orConx.ADHESIVE
- property Conx.user_data: string¶
User data for connection
- property Conx.x: float¶
X coordinate
- property Conx.x2: float¶
X coordinate for second point (adhesive only)
- property Conx.y: float¶
Y coordinate
- property Conx.y2: float¶
Y coordinate for second point (adhesive only)
- property Conx.z: float¶
Z coordinate
- property Conx.z2: float¶
Z coordinate for second point (adhesive only)
Constructor¶
- classmethod Conx(model, x, y, z, type=Oasys.gRPC.defaultArg, subtype=Oasys.gRPC.defaultArg, title=Oasys.gRPC.defaultArg)¶
Create a new
Conx
object
- Parameters:
model (Model) –
Model
that connection will be created inx (float) – X coordinate
y (float) – Y coordinate
z (float) – Z coordinate
type (constant) – Optional. Type of connection. Can be
Conx.SPOTWELD
,Conx.BOLT
,Conx.ADHESIVE
Conx.SPOTWELD_LINE
orConx.RIVET
. If omitted type will be set toConx.SPOTWELD
subtype (constant) – Optional. Subtype of connection. See property
subtype
for valid values. If omitted subtype will be set to the default subtype for this type of connectiontitle (string) – Optional. Title for the connection
- Returns:
Conx object
- Return type:
dict
Example
To create a new connection in model m, at coordinates (20, 40, 10)
c = Oasys.PRIMER.Conx(m, 20, 40, 10)
Static methods¶
- classmethod Conx.BlankAll(model, redraw=Oasys.gRPC.defaultArg)¶
Blanks all of the connections in the model
- Parameters:
model (Model) –
Model
that all connections will be blanked inredraw (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 connections in model m:
Oasys.PRIMER.Conx.BlankAll(m)
- classmethod Conx.BlankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Blanks all of the flagged connections in the model
- Parameters:
model (Model) –
Model
that all the flagged connections will be blanked inflag (Flag) – Flag set on the connections 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 connections in model m flagged with f:
Oasys.PRIMER.Conx.BlankFlagged(m, f)
- classmethod Conx.First(model)¶
Returns the first connection in the model
- Parameters:
model (Model) –
Model
to get first connection in- Returns:
Conx object (or None if there are no connections in the model)
- Return type:
Conx
Example
To get the first connection in model m:
c = Oasys.PRIMER.Conx.First(m)
- classmethod Conx.FirstFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the first free connection label in the model. Also see
Conx.LastFreeLabel()
,Conx.NextFreeLabel()
andModel.FirstFreeItemLabel()
- Parameters:
- Returns:
Conx label
- Return type:
int
Example
To get the first free connection label in model m:
label = Oasys.PRIMER.Conx.FirstFreeLabel(m)
- classmethod Conx.FlagAll(model, flag)¶
Flags all of the connections in the model with a defined flag
- Parameters:
model (Model) –
Model
that all connections will be flagged inflag (Flag) – Flag to set on the connections
- Returns:
No return value
- Return type:
None
Example
To flag all of the connections with flag f in model m:
Oasys.PRIMER.Conx.FlagAll(m, f)
- classmethod Conx.GetAll(model)¶
Returns a list of Conx objects for all of the connections in a model in PRIMER
- Parameters:
model (Model) –
Model
to get connections from- Returns:
List of Conx objects
- Return type:
list
Example
To make a list of Conx objects for all of the connections in model m
c = Oasys.PRIMER.Conx.GetAll(m)
- classmethod Conx.GetFlagged(model, flag)¶
Returns a list of Conx objects for all of the flagged connections in a model in PRIMER
- Parameters:
model (Model) –
Model
to get connections fromflag (Flag) – Flag set on the connections that you want to retrieve
- Returns:
List of Conx objects
- Return type:
list
Example
To make a list of Conx objects for all of the connections in model m flagged with f
c = Oasys.PRIMER.Conx.GetFlagged(m, f)
- classmethod Conx.GetFromID(model, number)¶
Returns the Conx object for a connection ID
- Parameters:
model (Model) –
Model
to find the connection innumber (integer) – number of the connection you want the Conx object for
- Returns:
Conx object (or None if connection does not exist)
- Return type:
Conx
Example
To get the Conx object for connection 100 in model m
c = Oasys.PRIMER.Conx.GetFromID(m, 100)
- classmethod Conx.Last(model)¶
Returns the last connection in the model
- Parameters:
model (Model) –
Model
to get last connection in- Returns:
Conx object (or None if there are no connections in the model)
- Return type:
Conx
Example
To get the last connection in model m:
c = Oasys.PRIMER.Conx.Last(m)
- classmethod Conx.LastFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the last free connection label in the model. Also see
Conx.FirstFreeLabel()
,Conx.NextFreeLabel()
and seeModel.LastFreeItemLabel()
- Parameters:
- Returns:
Conx label
- Return type:
int
Example
To get the last free connection label in model m:
label = Oasys.PRIMER.Conx.LastFreeLabel(m)
- classmethod Conx.NextFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the next free (highest+1) connection label in the model. Also see
Conx.FirstFreeLabel()
,Conx.LastFreeLabel()
andModel.NextFreeItemLabel()
- Parameters:
- Returns:
Conx label
- Return type:
int
Example
To get the next free connection label in model m:
label = Oasys.PRIMER.Conx.NextFreeLabel(m)
- classmethod Conx.Pick(prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg, button_text=Oasys.gRPC.defaultArg)¶
Allows the user to pick a connection
- 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 connections from that model can be picked. If the argument is aFlag
then only connections that are flagged with limit can be selected. If omitted, or None, any connections from any model can be selected. from any modelmodal (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:
Conx object (or None if not picked)
- Return type:
dict
Example
To pick a connection from model m giving the prompt ‘Pick connection from screen’:
c = Oasys.PRIMER.Conx.Pick('Pick connection from screen', m)
- classmethod Conx.RealizeAll(model)¶
Realizes all of the connections in the model
- Parameters:
model (Model) –
Model
that all connections will be realized in- Returns:
No return value
- Return type:
None
Example
To realize all of the connections in model m:
Oasys.PRIMER.Conx.RealizeAll(m)
- classmethod Conx.RealizeFlagged(model, flag)¶
Realizes all of the flagged connections in the model
- Parameters:
model (Model) –
Model
that the flagged connections will be realized inflag (Flag) – Flag set on the connections that you want to realize
- Returns:
No return value
- Return type:
None
Example
To realize all of the connections in model m flagged with f:
Oasys.PRIMER.Conx.RealizeFlagged(m, f)
- classmethod Conx.ReloadConnectors()¶
Reload all modules from primer_library/connectors
- Returns:
No return value
- Return type:
None
Example
Oasys.PRIMER.Conx.ReloadConnectors()
- classmethod Conx.RenumberAll(model, start)¶
Renumbers all of the connections in the model
- Parameters:
model (Model) –
Model
that all connections will be renumbered instart (integer) – Start point for renumbering
- Returns:
No return value
- Return type:
None
Example
To renumber all of the connections in model m, from 1000000:
Oasys.PRIMER.Conx.RenumberAll(m, 1000000)
- classmethod Conx.RenumberFlagged(model, flag, start)¶
Renumbers all of the flagged connections in the model
- Parameters:
model (Model) –
Model
that all the flagged connections will be renumbered inflag (Flag) – Flag set on the connections that you want to renumber
start (integer) – Start point for renumbering
- Returns:
No return value
- Return type:
None
Example
To renumber all of the connections in model m flagged with f, from 1000000:
Oasys.PRIMER.Conx.RenumberFlagged(m, f, 1000000)
- classmethod Conx.Select(flag, prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg)¶
Allows the user to select connections using standard PRIMER object menus
- Parameters:
flag (Flag) – Flag to use when selecting connections
prompt (string) – Text to display as a prompt to the user
limit (Model or Flag) – Optional. If the argument is a
Model
then only connections from that model can be selected. If the argument is aFlag
then only connections that are flagged with limit can be selected (limit should be different to flag). If omitted, or None, any connections can be selected. from any modelmodal (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 connections selected or None if menu cancelled
- Return type:
int
Example
To select connections from model m, flagging those selected with flag f, giving the prompt ‘Select connections’:
Oasys.PRIMER.Conx.Select(f, 'Select connections', m)To select connections, flagging those selected with flag f but limiting selection to connections flagged with flag l, giving the prompt ‘Select connections’:
Oasys.PRIMER.Conx.Select(f, 'Select connections', l)
- classmethod Conx.SetRuleDiameter(diameter)¶
Set the diameter for a spotweld ring when running a rule. Note that this method can only be called when running a connection rule script. It will not have any effect if used in a ‘normal’ script
- Parameters:
diameter (integer) – The diameter to set for the ring
- Returns:
No return value
- Return type:
None
Example
To set the diameter for a ring to be 10.0:
Oasys.PRIMER.Conx.SetRuleDiameter(10.0)
- classmethod Conx.SetRuleFEPID(pid)¶
Set the PID for spotweld beam/solid elements or adhesive solids when running a rule. Note that this method can only be called when running a connection rule script. It will not have any effect if used in a ‘normal’ script
- Parameters:
pid (integer) – The PID to set for the spotweld or adhesive elements
- Returns:
No return value
- Return type:
None
Example
To set the PID for a spotweld to be 1000:
Oasys.PRIMER.Conx.SetRuleFEPID(1000)
- classmethod Conx.SetRulePID(pid)¶
Set the PID for a spotweld ring when running a rule. Note that this method can only be called when running a connection rule script. It will not have any effect if used in a ‘normal’ script
- Parameters:
pid (integer) – The PID to set for the ring
- Returns:
No return value
- Return type:
None
Example
To set the PID for a ring to be 1000:
Oasys.PRIMER.Conx.SetRulePID(1000)
- classmethod Conx.SketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Sketches all of the flagged connections in the model. The connections will be sketched until you either call
Conx.Unsketch()
,Conx.UnsketchFlagged()
,Model.UnsketchAll()
, or delete the model
- Parameters:
model (Model) –
Model
that all the flagged connections will be sketched inflag (Flag) – Flag set on the connections that you want to sketch
redraw (boolean) – Optional. If model should be redrawn or not after the connections are sketched. If omitted redraw is true. If you want to sketch flagged connections 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 connections flagged with flag in model m:
Oasys.PRIMER.Conx.SketchFlagged(m, flag)
- classmethod Conx.Total(model, exists=Oasys.gRPC.defaultArg)¶
Returns the total number of connections in the model
- Parameters:
model (Model) –
Model
to get total forexists (boolean) – Optional. true if only existing connections should be counted. If false or omitted referenced but undefined connections will also be included in the total
- Returns:
number of connections
- Return type:
int
Example
To get the total number of connections in model m:
total = Oasys.PRIMER.Conx.Total(m)
- classmethod Conx.UnblankAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unblanks all of the connections in the model
- Parameters:
model (Model) –
Model
that all connections will be unblanked inredraw (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 connections in model m:
Oasys.PRIMER.Conx.UnblankAll(m)
- classmethod Conx.UnblankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unblanks all of the flagged connections in the model
- Parameters:
model (Model) –
Model
that the flagged connections will be unblanked inflag (Flag) – Flag set on the connections 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 connections in model m flagged with f:
Oasys.PRIMER.Conx.UnblankFlagged(m, f)
- classmethod Conx.UnflagAll(model, flag)¶
Unsets a defined flag on all of the connections in the model
- Parameters:
model (Model) –
Model
that the defined flag for all connections will be unset inflag (Flag) – Flag to unset on the connections
- Returns:
No return value
- Return type:
None
Example
To unset the flag f on all the connections in model m:
Oasys.PRIMER.Conx.UnflagAll(m, f)
- classmethod Conx.UnsketchAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all connections
- Parameters:
model (Model) –
Model
that all connections will be unblanked inredraw (boolean) – Optional. If model should be redrawn or not after the connections 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 connections in model m:
Oasys.PRIMER.Conx.UnsketchAll(m)
- classmethod Conx.UnsketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all flagged connections in the model
- Parameters:
model (Model) –
Model
that all connections will be unsketched inflag (Flag) – Flag set on the connections that you want to unsketch
redraw (boolean) – Optional. If model should be redrawn or not after the connections 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 connections flagged with flag in model m:
Oasys.PRIMER.Conx.UnsketchAll(m, flag)
- classmethod Conx.UseParentLayer(option)¶
True (default) means put bolt FE into parent layer where possible
- Parameters:
option (boolean) – True (default) means put bolt FE into parent layer where possible
- Returns:
No return value
- Return type:
None
Example
To switch off use of parent layer (and use current layer)
Oasys.PRIMER.Conx.UseParentLayer(False)
- classmethod Conx.UseSPR2Pref(option)¶
True (default) means use the pref settings for C_SPR2 created when rivet realized
- Parameters:
option (boolean) – True (default) means use the pref settings for C_SPR2 created when rivet realized
- Returns:
No return value
- Return type:
None
Example
To ignore any pref settings and use zero for newly created C_SPR2 cards
Oasys.PRIMER.Conx.UseSPR2Pref(False)
Instance methods¶
- Conx.AssociateComment(comment)¶
Associates a comment with a connection
- Parameters:
comment (Comment) –
Comment
that will be attached to the connection- Returns:
No return value
- Return type:
None
Example
To associate comment c to the connection c:
c.AssociateComment(c)
- Conx.Blank()¶
Blanks the connection
- Returns:
No return value
- Return type:
None
Example
To blank connection c:
c.Blank()
- Conx.Blanked()¶
Checks if the connection is blanked or not
- Returns:
True if blanked, False if not
- Return type:
bool
Example
To check if connection c is blanked:
if c.Blanked(): do_something..
- Conx.ClearFlag(flag)¶
Clears a flag on the connection
- Parameters:
flag (Flag) – Flag to clear on the connection
- Returns:
No return value
- Return type:
None
Example
To clear flag f for connection c:
c.ClearFlag(f)
- Conx.Copy(range=Oasys.gRPC.defaultArg)¶
Copies the connection. The target include of the copied connection 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:
Conx object
- Return type:
Conx
Example
To copy connection c into connection z:
z = c.Copy()
- Conx.DetachComment(comment)¶
Detaches a comment from a connection
- Parameters:
comment (Comment) –
Comment
that will be detached from the connection- Returns:
No return value
- Return type:
None
Example
To detach comment c from the connection c:
c.DetachComment(c)
- Conx.EmptyPatch()¶
Empties the patch topology/coordinates data
- Returns:
No return value
- Return type:
None
Example
To empty the patch topology/coordinates data for connection c;
c.EmptyPatch()
- Conx.ExtractColour()¶
Extracts the actual colour used for connection.
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 connectioncolour
property will return the valueColour.PART
instead of the actual colour. This method will return the actual colour which is used for drawing the connection
- Returns:
colour value (integer)
- Return type:
int
Example
To return the colour used for drawing connection c:
colour = c.ExtractColour()
- Conx.Flagged(flag)¶
Checks if the connection is flagged or not
- Parameters:
flag (Flag) – Flag to test on the connection
- Returns:
True if flagged, False if not
- Return type:
bool
Example
To check if connection c has flag f set on it:
if c.Flagged(f): do_something..
- Conx.GetComments()¶
Extracts the comments associated to a connection
- 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 connection c:
comm_list = c.GetComments()
- Conx.GetElements()¶
Returns the beams/solids that are used in the connection weld
- Returns:
A list containing the element IDs (or None if no elements)
- Return type:
list
Example
To get the elements for connection c:
elems = c.GetElements()
- Conx.GetEntities(type)¶
Returns list of the entities of type that are used in the connection
- Parameters:
type (string) – The type of the item in the reference list (for a list of types see Appendix I of the PRIMER manual)
- Returns:
A list containing the item IDs (or None if none)
- Return type:
list
Example
To get list of nodes for connection c:
items = c.GetEntities("NODE")
- Conx.GetLayerData(layer)¶
Returns the data for a layer of the connection
- Parameters:
layer (integer) – The layer you want the data for. Note that layers start at 0, not 1
- Returns:
A list containing the layer data
- Return type:
list
Example
To get the data for the 3rd layer for connection c:
l_data = c.GetLayerData(2)
- Conx.GetLayerShells(layer)¶
Returns the attached shells for a layer of the connection
- Parameters:
layer (integer) – The layer you want the data for. Note that layers start at 0, not 1
- Returns:
List of Shell objects or None if not valid
- Return type:
list
Example
To get the attached shells for the 3rd layer for connection c:
shells = c.GetLayerShells(2)
- Conx.GetParameter(prop)¶
Checks if a Conx 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 theConx.ViewParameters()
method and ‘method chaining’ (see the examples below)
- Parameters:
prop (string) – connection property to get parameter for
- Returns:
Parameter object if property is a parameter, None if not
- Return type:
dict
Example
To check if Conx property c.example is a parameter:
Oasys.PRIMER.Options.property_parameter_names = True if c.GetParameter(c.example): do_something... Oasys.PRIMER.Options.property_parameter_names = FalseTo check if Conx property c.example is a parameter by using the GetParameter method:
if c.ViewParameters().GetParameter(c.example): do_something..
- Conx.GetPatchCoords(point)¶
Returns the data for a patch coordinate of an adhesive patch connection
- Parameters:
point (integer) – The point you want the data for. Note that points start at 0, not 1
- Returns:
A list containing the patch coordinate
- Return type:
list
Example
To get the data for the 3rd patch coordinate for connection c:
p_data = c.GetPatchCoords(2)
- Conx.GetPatchTopol(point)¶
Returns the topology for a patch quad/tria of an adhesive patch connection
- Parameters:
point (integer) – The patch quad/tria you want the data for. Note that points start at 0, not 1
- Returns:
List of numbers containing the patch topology information
- Return type:
int
Example
To get the data for the 3rd patch quad/tria for connection c:
p_data = c.GetPatchTopol(2)
- Conx.GetPathData(point)¶
Returns the data for a path point of an adhesive/spotweld line connection
- Parameters:
point (integer) – The point you want the data for. Note that points start at 0, not 1
- Returns:
A list containing the path data
- Return type:
list
Example
To get the data for the 3rd path point for connection c:
p_data = c.GetPathData(2)
- Conx.GetPidData()¶
Returns a list of Part objects for the connection FE entities. A connection can contain elements with different part ID’s between different layers. If one part ID is returned, that part is used for all elements in the connection. Not applicable for bolts
- Returns:
List of Part objects
- Return type:
list
Example
To make a list of Part objects for connection c
arr = Oasys.PRIMER.Conx.GetPidData()
- Conx.GetSettings()¶
Returns an object of settings stored with the connection
- Returns:
Dict with properties
- angle_tolerance:
(real) Angle tolerance
- bolt_adjust_mass:
(boolean) Adjust bolt mass when creating bolt entitites
- bolt_dth_beam:
(boolean) Add database history beam when bolt beam is created
- bolt_feature_line:
(boolean) Consider feature line for bolt holes
- bolt_nrb_min_mass:
(real) Bolt rigid NRB minimum mass
- bolt_part_min_mass:
(real) Bolt rigid part minimum mass
- clinch:
(boolean) Allow connections to join a clinch type connection
- consistent_weld_area:
(boolean) Turn on consistent weld area so multihex welds are pi*d*d/4
- edge_distance:
(real) Edge distance
- glue_break_angle:
(real) Glue break angle
- glue_hard_aspect:
(real) Glue hard aspect ratio
- glue_soft_aspect:
(real) Glue soft aspect ratio
- length_check:
(boolean) Check length
- max_length:
(real) Maximum length
- max_panels:
(integer) Maximum number of panels
- max_warpage:
(real) Maximum warpage
- min_length:
(real) Minimum length
- panel_check:
(boolean) Check for maximum number of panels
- patch_angle:
(real) Patch angle setting
- patch_angle_check:
(boolean) Turn on or off patch angle check
- same_part:
(boolean) Allow connections to join a part to itself
- solid_free_edges:
(boolean) Consider free edges when orienting single solid spotwelds
- spot_line_tol:
(real) Spotweld line search tolerance
- spot_thickness:
(real) Search thickness
- total_length:
(real) Total length
- use_pid:
(boolean) Use _PID for beam connections
- warpage_check:
(boolean) Check warpage value
- Return type:
dict
Example
To make an Oject containing the stored settings of connection c
o = Oasys.PRIMER.Conx.GetSettings()
- Conx.GetShellThickness(layer)¶
Returns a list containing a number of objects equal to the number of solid elements in the connection. Each object contains the corresponding solid element object, and shell element objects and their thicknesses. The argument allows the user to output only shells from all layers, or a particular layer. Note that a carriage return is not added
- Parameters:
layer (integer) – ID of the connection layer containing the shells from which the thicknesses will be extracted. If a value of zero or lower is input, all layers will be considered in the output data
- Returns:
An array containing a number of objects equal to the number of solid elements in the connection. Each object has the following properties
- shell*n*:
(
Shell
) Shell object in the specified layer in contact with the n*th node the solid adhesive element, where *n can be a value from 1 to 8. This corresponds to the maximum number of nodes in the solid element- solid:
(
Solid
) Solid object associated with the shells in the return object- sthk*n*:
(Double) Thickness of shell in the specified layer in contact with the n*th node of the solid adhesive element, where *n can be a value from 1 to 8
- Return type:
list
Example
To get the data for connection c layer 1:
sThkArr = c.GetShellThickness(1) #sThkArr is a list of objects containing shells and shell thicknesses in only layer 1 for each solid element in the connection. st0_1 = sThkArr[0]["sthk1"] #st0_1 is the shell thickness of the shell attached to node 1 in the first solid element (array index 0) in the sThkArr array. sh1_4 = sThkArr[1]["shell4"] #sth1_4 is the shell object corresponding to node 1 in the second solid element (array index 1) in the sThkArr array. so4 = sThkArr[4]["solid"] #so4 is the fifth solid element object (array index 4) in the sThkArr array
- Conx.Keyword()¶
Returns the keyword for this connection (*CONNECTION_START_SPOTWELD etc). Note that a carriage return is not added. See also
Conx.KeywordCards()
- Returns:
string containing the keyword
- Return type:
str
Example
To get the keyword for connection c:
key = c.Keyword()
- Conx.KeywordCards()¶
Returns the keyword cards for the connection. Note that a carriage return is not added. See also
Conx.Keyword()
- Returns:
string containing the cards
- Return type:
str
Example
To get the cards for connection c:
cards = c.KeywordCards()
- Conx.Next()¶
Returns the next connection in the model
- Returns:
Conx object (or None if there are no more connections in the model)
- Return type:
Conx
Example
To get the connection in model m after connection c:
c = c.Next()
- Conx.Previous()¶
Returns the previous connection in the model
- Returns:
Conx object (or None if there are no more connections in the model)
- Return type:
Conx
Example
To get the connection in model m before connection c:
c = c.Previous()
- Conx.RemovePatchTopol(layer)¶
Deletes the topology at a particular location for patch type adhesive
- Parameters:
layer (integer) – The topology location you want to remove. Note that layers start at 0, not 1
- Returns:
No return value
- Return type:
None
Example
To remove the 3rd topology data for connection c:
c.RemovePatchTopol(2)
- Conx.RemovePathData(layer)¶
Deletes a pathc point for a line adhesive connection
- Parameters:
layer (integer) – The point you want to remove. Note that layers start at 0, not 1
- Returns:
No return value
- Return type:
None
Example
To remove the 3rd point from connection c:
c.RemovePathData(2)
- Conx.SetFlag(flag)¶
Sets a flag on the connection
- Parameters:
flag (Flag) – Flag to set on the connection
- Returns:
No return value
- Return type:
None
Example
To set flag f for connection c:
c.SetFlag(f)
- Conx.SetLayerData(layer, item1, item2=Oasys.gRPC.defaultArg, _=Oasys.gRPC.defaultArg)¶
Sets the data for a layer of the connection
- Parameters:
layer (integer) – The layer you want to set the data for. Note that layers start at 0, not 1
item1 (integer/string) – The first item for the layer definition. As layer definitions can be part IDs, part names, CAD names, part set IDs, part set names or assemby names the following logic is used. If the item is an integer it is assumed to be a part ID. If the item is a string then it must be in the format ‘P<part ID>’, ‘P:<part name>’, ‘C:<CAD name>’, ‘S<set ID>’, ‘S:<set name>’
or ‘A:<assembly name>’item2 (integer/string) – Optional. The second item for the layer definition. This must be type same type as item1. e.g. if item1 is a part ID, item2 must be a part ID (it cannot be a part name etc).
_ (integer/string) – Optional. The nth item for the layer definition. This must be type same type as item1. e.g. if item1 is a part ID, this item must be a part ID (it cannot be a part name etc).
- Returns:
No return value
- Return type:
None
Example
To set the data for the 3rd layer for connection c, to be part IDs 10 and 20:
c.SetLayerData(2, 10, 20)or
a = [10, 20] c.SetLayerData(2, a)
- Conx.SetPatchCoords(point, x, y, z)¶
Sets a coordinate used by the adhesive patch connection type
- Parameters:
point (integer) – The point you want to set the data for. Note that points start at 0, not 1
x (float) – X coordinate of point
y (float) – Y coordinate of point
z (float) – Z coordinate of point
- Returns:
No return value
- Return type:
None
Example
To set the position for the 3rd patch point for connection c, to be (10, 20, 30);
c.SetPatchCoords(2, 10, 20, 30)
- Conx.SetPatchTopol(point, c1, c2, c3, c4=Oasys.gRPC.defaultArg)¶
Sets the topology used by the adhesive patch connection type
- Parameters:
point (integer) – The point you want to set the data for. Note that points start at 0, not 1
c1 (integer) – 1st coordinate location point
c2 (integer) – 2nd coordinate location point
c3 (integer) – 3rd coordinate location point
c4 (integer) – Optional. 4th coordinate location point
- Returns:
No return value
- Return type:
None
Example
To set the topology for the 3rd patch quad/tria for connection c, to be (1, 4, 3, 6);
c.SetPatchTopol(2, 1, 4, 3, 6)
- Conx.SetPathData(point, x, y, z)¶
Sets the data for a path point of the connection
- Parameters:
point (integer) – The point you want to set the data for. Note that points start at 0, not 1
x (float) – X coordinate of point
y (float) – Y coordinate of point
z (float) – Z coordinate of point
- Returns:
No return value
- Return type:
None
Example
To set the position for the 3rd path point for connection c, to be (10, 20, 30);
c.SetPathData(2, 10, 20, 30)
- Conx.SetPidData(item1, item2=Oasys.gRPC.defaultArg, _=Oasys.gRPC.defaultArg)¶
Sets the element part IDs for the connection. A different part can be defined for elements in the connection between different layers. Not applicable for bolts
- Parameters:
item1 (integer/string) – Part label of the first item in the PID layer list
item2 (integer/string) – Optional. The second item for the layer definition
_ (integer/string) – Optional. The nth item for the layer definition
- Returns:
No return value
- Return type:
None
Example
To set the part data for c, to be part IDs 10 and 20:
c.SetPidData(10, 20)or
a = [10, 20] c.SetPidData(a)
- Conx.SetSettings(data)¶
Sets the settings stored on a connection entity. Not applicable for bolts
- Parameters:
data (dict) –
Object containing the connection settings data. The properties can be:
- angle_tolerance (optional):
(real) Angle tolerance
- bolt_adjust_mass (optional):
(boolean) Adjust bolt mass when creating bolt entities
- bolt_dth_beam (optional):
(boolean) Add database history beam when bolt is created
- bolt_feature_line (optional):
(boolean) Consider feature line for bolt holes
- bolt_nrb_min_mass (optional):
(real) Bolt NRB minimum mass
- bolt_part_min_mass (optional):
(real) Bolt rigid part minimum mass
- clinch (optional):
(boolean) Allow connections to join a clinch type connection
- consistent_weld_area (optional):
(boolean) Use consistent area for multihex welds
- edge_distance (optional):
(real) Edge distance
- glue_break_angle (optional):
(real) Glue break angle
- glue_hard_aspect (optional):
(real) Glue hard aspect ratio
- glue_soft_aspect (optional):
(real) Glue soft aspect ratio
- length_check (optional):
(boolean) Check the connection length
- max_length (optional):
(real) Maximum length of connection
- max_panels (optional):
(integer) Maximum number of panels
- max_warpage (optional):
(real) Maximum warpage
- min_length (optional):
(real) Minimum length of connection
- panel_check (optional):
(boolean) Check for maximum number of panels
- patch_angle (optional):
(real) Patch angle
- patch_angle_check (optional):
(boolean) Check the patch angle
- same_part (optional):
(boolean) Allow connections to join a part to itself
- solid_free_edges (optional):
(boolean) Consider free edges when orienting single solid spotwelds
- spot_line_tol (optional):
(real) Spotweld line search tolerance
- spot_thickness (optional):
(real) Search thickness
- total_length (optional):
(real) Total length of connection
- use_pid (optional):
(boolean) Use _PID for beam connections
- warpage_check (optional):
(boolean) Check warpage value
- Returns:
No return value
- Return type:
None
Example
To set the various settings for a connection c:
data = { "length_check":True, "total_length":1.5, "warpage_check":False, "angle_tolerance":5.0 } c.SetSettings(data)
- Conx.Sketch(redraw=Oasys.gRPC.defaultArg)¶
Sketches the connection. The connection will be sketched until you either call
Conx.Unsketch()
,Conx.UnsketchAll()
,Model.UnsketchAll()
, or delete the model
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the connection is sketched. If omitted redraw is true. If you want to sketch several connections 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 connection c:
c.Sketch()
- Conx.Unblank()¶
Unblanks the connection
- Returns:
No return value
- Return type:
None
Example
To unblank connection c:
c.Unblank()
- Conx.Unsketch(redraw=Oasys.gRPC.defaultArg)¶
Unsketches the connection
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the connection is unsketched. If omitted redraw is true. If you want to unsketch several connections 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 connection c:
c.Unsketch()
- Conx.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:
Conx object
- Return type:
dict
Example
To check if Conx property c.example is a parameter by using the
Conx.GetParameter()
method:if c.ViewParameters().GetParameter(c.example): do_something..
- Conx.Xrefs()¶
Returns the cross references for this connection
- Returns:
Xrefs object
- Return type:
dict
Example
To get the cross references for connection c:
xrefs = c.Xrefs()