Conx class

The Conx class gives you access to connections in PRIMER. More...

The PRIMER JavaScript API provides many class constants, properties and methods. For Arup to be able to extend and enhance the API in the future any constant, property or method names beginning with a lowercase or uppercase letter are reserved.
If you need to add your own properties or methods to one of the existing classes then to avoid any potential future conflict you should ensure that the name begins with either an underscore (_) or a dollar sign ($) or the name is prefixed with your own unique identifier.
For example if company 'ABC' need to add a property called 'example' then to avoid any potential future conflict use one of:

Class functions

Member functions

Conx constants

Name Description
Conx.ASSEMBLY If the connection refers to an assembly rather than individual layers, the assembly is defined by part tree assembly.
Conx.PART_SET If the connection refers to an assembly rather than individual layers, the assembly is defined by part set.

Constants for adhesive connections

Name Description
Conx.ADHESIVE_PATCH Connection adhesive type is a patch.
Conx.ADHESIVE_SOLID Connection adhesive type is a solid line.

Constants for bolt connections

Name Description
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.RIGID_MERGE This constant is deprecated in version 10.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Please use Conx.BOLT_MRG_CYL instead.  [deprecated]
Conx.RIGID_NRB This constant is deprecated in version 10.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Please use Conx.BOLT_NRB_CYL instead.  [deprecated]

Constants for connection status

Name Description
Conx.BAD Connection is bad (e.g. necessary data is missing).
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.REALIZED Connection has been made and is OK (checks OK).

Constants for connection type

Name Description
Conx.ADHESIVE Connection is adhesive.
Conx.BOLT Connection is a bolt.
Conx.RIGID This constant is deprecated in version 10.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Please use Conx.BOLT instead.  [deprecated]
Conx.RIVET Connection is rivet.
Conx.SPOTWELD Connection is a spotweld.
Conx.SPOTWELD_LINE Connection is a spotweld line.

Constants for spotweld connections

Name Description
Conx.SPOTWELD_BEAM Connection spotweld type is beam.
Conx.SPOTWELD_HEXA1 Connection spotweld type is one hexa solid/spotweld layer.
Conx.SPOTWELD_HEXA12 Connection spotweld type is twelve hexa solids/spotweld layer.
Conx.SPOTWELD_HEXA16 Connection spotweld type is sixteen hexa solids/spotweld layer.
Conx.SPOTWELD_HEXA2 Connection spotweld type is two hexa solids/spotweld layer.
Conx.SPOTWELD_HEXA3 Connection spotweld type is three hexa solids/spotweld layer.
Conx.SPOTWELD_HEXA4 Connection spotweld type is four hexa solids/spotweld layer.
Conx.SPOTWELD_HEXA8 Connection spotweld type is eight hexa solids/spotweld layer.
Conx.SPOTWELD_MIG Connection spotweld type is (beam) MIG weld.
Conx.SPOTWELD_SOLID1 This constant is deprecated in version 22.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Connection spotweld type is one hexa solid/spotweld layer. Use Conx.SPOTWELD_HEXA1 instead.  [deprecated]
Conx.SPOTWELD_SOLID12 This constant is deprecated in version 22.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Connection spotweld type is twelve hexa solids/spotweld layer. Use Conx.SPOTWELD_HEXA12 instead.  [deprecated]
Conx.SPOTWELD_SOLID16 This constant is deprecated in version 22.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Connection spotweld type is sixteen hexa solids/spotweld layer. Use Conx.SPOTWELD_HEXA16 instead.  [deprecated]
Conx.SPOTWELD_SOLID4 This constant is deprecated in version 22.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Connection spotweld type is four hexa solids/spotweld layer. Use Conx.SPOTWELD_HEXA4 instead.  [deprecated]
Conx.SPOTWELD_SOLID8 This constant is deprecated in version 22.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Connection spotweld type is eight hexa solids/spotweld layer. Use Conx.SPOTWELD_HEXA8 instead.  [deprecated]

Conx properties

Name Type Description
adhesive_esize real Element size along the length of the adhesive run
adhesive_nelem integer The number of elements across the width of the adhesive
adhesive_width real The width of the adhesive run
angtol real angle tolerance for bolt
angtol2 real angle tolerance at end 2 for 2 point bolt
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).
assembly_type constant The assembly type. Can be Conx.PART_SET or Conx.ASSEMBLY.
colour Colour The colour of the connection
diameter real Diameter of spotweld/rigid
diameter2 real Diameter of rigid at end 2
edge_distance real Spotweld line edge distance
edge_lock logical true if a spotweld line is locked to an edge, false if not
error (read only) string Description of the error if the connection cannot be made
error_details (read only) string Details of the error if the connection cannot be made
exists (read only) logical true if connection exists, false if referred to but not defined.
fit integer contact fitting method for library bolts
id integer Conx number. Also see the label property which is an alternative name for this.
include integer The Include file number that the connection is in.
label integer Conx number. Also see the id property which is an alternative name for this.
layers integer The number of layers the connection has.
length real Length of 1 point bolt, max thickness for 2 point bolt
length2 real max thickness at end 2 for 2 point bolt
material integer The ID of the Material used for 'merge' bolt connections. i.e. Conx.BOLT_MRG_CYL, Conx.BOLT_MRG_CYL_BEAM,
model (read only) integer The Model number that the connection is in.
module string name of library module for bolt
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.
patch_coords integer The number of patch coordinate points the connection has (Adhesive patch only).
patch_topol integer The number of patch topology entries the connection has (Adhesive patch only).
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 and x2, y2, z2
pitch real Spotweld line pitch
resize integer snap to points fitting method for library bolts
saved_settings boolean Whether settings are saved for a connection or not
shape integer shape for bolt attachment
shape2 integer shape for bolt attachment at end 2 for 2 point bolt
spr2_id (read only) integer Internal label of C_SPR2 which applied to this rivet connection
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.
spr2_unshared (read only) boolean True if C_SPR2 is unique for this rivet
status constant The status of the connection. Can be Conx.DORMANT, Conx.MADE, Conx.INVALID, Conx.REALIZED or Conx.BAD.
subtype constant The connection subtype. For SPOTWELD and SPOTWELD_LINE connections the subtype can be: For BOLT connections the subtype can be: For ADHESIVE connections the subtype can be: Conx.ADHESIVE_SOLID. Conx.ADHESIVE_PATCH.
title string Title for connection
transparency integer The transparency of the connection (0-100) 0% is opaque, 100% is transparent.
type constant The connection type. Can be Conx.SPOTWELD, Conx.BOLT or Conx.RIVET or Conx.ADHESIVE.
user_data string User data for connection
x real X coordinate
x2 real X coordinate for second point (adhesive only)
y real Y coordinate
y2 real Y coordinate for second point (adhesive only)
z real Z coordinate
z2 real Z coordinate for second point (adhesive only)

Detailed Description

The Conx class allows you to create, modify, edit and manipulate connections. See the documentation below for more details.

Constructor

new Conx(Model[Model], x[real], y[real], z[real], type (optional)[constant], subtype (optional)[constant], title (optional)[string])

Description

Create a new Conx object.

Arguments

  • Model (Model)

    Model that connection will be created in

  • x (real)

    X coordinate

  • y (real)

    Y coordinate

  • z (real)

    Z coordinate

  • type (optional) (constant)

    Type of connection. Can be Conx.SPOTWELD, Conx.BOLT, Conx.ADHESIVE Conx.SPOTWELD_LINE or Conx.RIVET. If omitted type will be set to Conx.SPOTWELD.

  • subtype (optional) (constant)

    Subtype of connection. See property subtype for valid values. If omitted subtype will be set to the default subtype for this type of connection.

  • title (optional) (string)

    Title for the connection

    Returns

    Conx object

    Return type

    Conx

    Example

    To create a new connection in model m, at coordinates (20, 40, 10)

    var c = new Conx(m, 20, 40, 10);

    Details of functions

    AssociateComment(Comment[Comment])

    Description

    Associates a comment with a connection.

    Arguments

  • Comment (Comment)

    Comment that will be attached to the connection

    Returns

    No return value

    Example

    To associate comment c to the connection c:

    c.AssociateComment(c);


    Blank()

    Description

    Blanks the connection

    Arguments

    No arguments

    Returns

    No return value

    Example

    To blank connection c:

    c.Blank();


    BlankAll(Model[Model], redraw (optional)[boolean]) [static]

    Description

    Blanks all of the connections in the model.

    Arguments

  • Model (Model)

    Model that all connections will be blanked in

  • redraw (optional) (boolean)

    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

    Example

    To blank all of the connections in model m:

    Conx.BlankAll(m);


    BlankFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]

    Description

    Blanks all of the flagged connections in the model.

    Arguments

  • Model (Model)

    Model that all the flagged connections will be blanked in

  • flag (Flag)

    Flag set on the connections that you want to blank

  • redraw (optional) (boolean)

    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

    Example

    To blank all of the connections in model m flagged with f:

    Conx.BlankFlagged(m, f);


    Blanked()

    Description

    Checks if the connection is blanked or not.

    Arguments

    No arguments

    Returns

    true if blanked, false if not.

    Return type

    Boolean

    Example

    To check if connection c is blanked:

    if (c.Blanked() ) do_something...


    ClearFlag(flag[Flag])

    Description

    Clears a flag on the connection.

    Arguments

  • flag (Flag)

    Flag to clear on the connection

    Returns

    No return value

    Example

    To clear flag f for connection c:

    c.ClearFlag(f);


    Copy(range (optional)[boolean])

    Description

    Copies the connection. The target include of the copied connection can be set using Options.copy_target_include.

    Arguments

  • range (optional) (boolean)

    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:

    var z = c.Copy();


    DetachComment(Comment[Comment])

    Description

    Detaches a comment from a connection.

    Arguments

  • Comment (Comment)

    Comment that will be detached from the connection

    Returns

    No return value

    Example

    To detach comment c from the connection c:

    c.DetachComment(c);


    EmptyPatch()

    Description

    Empties the patch topology/coordinates data.

    Arguments

    No arguments

    Returns

    No return value.

    Example

    To empty the patch topology/coordinates data for connection c;

    c.EmptyPatch();


    Error(message[string], details (optional)[string])

    Description

    Adds an error for connection. For more details on checking see the Check class.

    Arguments

  • message (string)

    The error message to give

  • details (optional) (string)

    An optional detailed error message

    Returns

    No return value

    Example

    To add an error message "My custom error" for connection c:

    c.Error("My custom error");


    ExtractColour()

    Description

    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 connection 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 connection.

    Arguments

    No arguments

    Returns

    colour value (integer)

    Return type

    Number

    Example

    To return the colour used for drawing connection c:

    var colour = c.ExtractColour();


    First(Model[Model]) [static]

    Description

    Returns the first connection in the model.

    Arguments

  • Model (Model)

    Model to get first connection in

    Returns

    Conx object (or null if there are no connections in the model).

    Return type

    Conx

    Example

    To get the first connection in model m:

    var c = Conx.First(m);


    FirstFreeLabel(Model[Model], layer (optional)[Include number]) [static]

    Description

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

    Arguments

  • Model (Model)

    Model to get first free connection label in

  • layer (optional) (Include number)

    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

    Conx label.

    Return type

    Number

    Example

    To get the first free connection label in model m:

    var label = Conx.FirstFreeLabel(m);


    FlagAll(Model[Model], flag[Flag]) [static]

    Description

    Flags all of the connections in the model with a defined flag.

    Arguments

  • Model (Model)

    Model that all connections will be flagged in

  • flag (Flag)

    Flag to set on the connections

    Returns

    No return value

    Example

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

    Conx.FlagAll(m, f);


    Flagged(flag[Flag])

    Description

    Checks if the connection is flagged or not.

    Arguments

  • flag (Flag)

    Flag to test on the connection

    Returns

    true if flagged, false if not.

    Return type

    Boolean

    Example

    To check if connection c has flag f set on it:

    if (c.Flagged(f) ) do_something...


    ForEach(Model[Model], func[function], extra (optional)[any]) [static]

    Description

    Calls a function for each connection in the model.
    Note that ForEach has been designed to make looping over connections as fast as possible and so has some limitations.
    Firstly, a single temporary Conx object is created and on each function call it is updated with the current connection data. This means that you should not try to store the Conx object for later use (e.g. in an array) as it is temporary.
    Secondly, you cannot create new connections inside a ForEach loop.

    Arguments

  • Model (Model)

    Model that all connections are in

  • func (function)

    Function to call for each connection

  • extra (optional) (any)

    An optional extra object/array/string etc that will appended to arguments when calling the function

    Returns

    No return value

    Example

    To call function test for all of the connections in model m:

    Conx.ForEach(m, test);
    function test(c)
    {
    // c is Conx object
    }

    To call function test for all of the connections in model m with optional object:

    var data = { x:0, y:0 };
    Conx.ForEach(m, test, data);
    function test(c, extra)
    {
    // c is Conx object
    // extra is data
    }


    GetAll(Model[Model], property (optional)[string]) [static]

    Description

    Returns an array of Conx objects or properties for all of the connections in a model in PRIMER. If the optional property argument is not given then an array of Conx objects is returned. If the property argument is given, that property value for each connection is returned in the array instead of a Conx object

    Arguments

  • Model (Model)

    Model to get connections from

  • property (optional) (string)

    Name for property to get for all connections in the model

    Returns

    Array of Conx objects or properties

    Return type

    Array

    Example

    To make an array of Conx objects for all of the connections in model m:

    var a = Conx.GetAll(m);

    To return an array containing the value of property 'foo' (for example 'x' for a node) for each connection in model m:

    var a = Conx.GetAll(m, 'foo');


    GetComments()

    Description

    Extracts the comments associated to a connection.

    Arguments

    No arguments

    Returns

    Array of Comment objects (or null if there are no comments associated to the node).

    Return type

    Array

    Example

    To get the array of comments associated to the connection c:

    var comm_array = c.GetComments();


    GetElements()

    Description

    Returns the beams/solids that are used in the connection weld.

    Arguments

    No arguments

    Returns

    An array containing the element IDs (or null if no elements).

    Return type

    Array

    Example

    To get the elements for connection c:

    var elems = c.GetElements();


    GetEntities(type[string])

    Description

    Returns list of the entities of type that are used in the connection.

    Arguments

  • type (string)

    The type of the item in the reference list (for a list of types see Appendix I of the PRIMER manual).

    Returns

    An array containing the item IDs (or null if none).

    Return type

    Array

    Example

    To get list of nodes for connection c:

    var items = c.GetEntities("NODE");


    GetFlagged(Model[Model], flag[Flag], property (optional)[string]) [static]

    Description

    Returns an array of Conx objects for all of the flagged connections in a model in PRIMER If the optional property argument is not given then an array of Conx objects is returned. If the property argument is given, then that property value for each connection is returned in the array instead of a Conx object

    Arguments

  • Model (Model)

    Model to get connections from

  • flag (Flag)

    Flag set on the connections that you want to retrieve

  • property (optional) (string)

    Name for property to get for all flagged connections in the model

    Returns

    Array of Conx objects or properties

    Return type

    Array

    Example

    To make an array of Conx objects for all of the connections in model m flagged with f:

    var c = Conx.GetFlagged(m, f);

    To return an array containing the value of property 'foo' (for example 'x' for a node) for all of the connections in model m flagged with f:

    var a = Conx.GetFlagged(m, f, 'foo');


    GetFromID(Model[Model], number[integer]) [static]

    Description

    Returns the Conx object for a connection ID.

    Arguments

  • Model (Model)

    Model to find the connection in

  • number (integer)

    number of the connection you want the Conx object for

    Returns

    Conx object (or null if connection does not exist).

    Return type

    Conx

    Example

    To get the Conx object for connection 100 in model m

    var c = Conx.GetFromID(m, 100);


    GetLayerData(layer[integer])

    Description

    Returns the data for a layer of the connection.

    Arguments

  • layer (integer)

    The layer you want the data for. Note that layers start at 0, not 1.

    Returns

    An array containing the layer data.

    Return type

    Array

    Example

    To get the data for the 3rd layer for connection c:

    var l_data = c.GetLayerData(2);


    GetLayerShells(layer[integer])

    Description

    Returns the attached shells for a layer of the connection.

    Arguments

  • layer (integer)

    The layer you want the data for. Note that layers start at 0, not 1.

    Returns

    Array of Shell objects or null if not valid

    Return type

    Array

    Example

    To get the attached shells for the 3rd layer for connection c:

    var shells = c.GetLayerShells(2);


    GetParameter(prop[string])

    Description

    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 the Conx.ViewParameters() method and 'method chaining' (see the examples below).

    Arguments

  • prop (string)

    connection property to get parameter for

    Returns

    Parameter object if property is a parameter, null if not.

    Return type

    Parameter

    Example

    To check if Conx property c.example is a parameter:

    Options.property_parameter_names = true;
    if (c.GetParameter(c.example) ) do_something...
    Options.property_parameter_names = false;

    To check if Conx property c.example is a parameter by using the GetParameter method:

    if (c.ViewParameters().GetParameter(c.example) ) do_something...


    GetPatchCoords(point[integer])

    Description

    Returns the data for a patch coordinate of an adhesive patch connection.

    Arguments

  • point (integer)

    The point you want the data for. Note that points start at 0, not 1.

    Returns

    An array containing the patch coordinate.

    Return type

    Array

    Example

    To get the data for the 3rd patch coordinate for connection c:

    var p_data = c.GetPatchCoords(2);


    GetPatchTopol(point[integer])

    Description

    Returns the topology for a patch quad/tria of an adhesive patch connection.

    Arguments

  • point (integer)

    The patch quad/tria you want the data for. Note that points start at 0, not 1.

    Returns

    Array of numbers containing the patch topology information.

    Return type

    Number

    Example

    To get the data for the 3rd patch quad/tria for connection c:

    var p_data = c.GetPatchTopol(2);


    GetPathData(point[integer])

    Description

    Returns the data for a path point of an adhesive/spotweld line connection.

    Arguments

  • point (integer)

    The point you want the data for. Note that points start at 0, not 1.

    Returns

    An array containing the path data.

    Return type

    Array

    Example

    To get the data for the 3rd path point for connection c:

    var p_data = c.GetPathData(2);


    GetPidData()

    Description

    Returns an array 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.

    Arguments

    No arguments

    Returns

    Array of Part objects

    Return type

    Array

    Example

    To make an array of Part objects for connection c

    var arr = c.GetPidData();


    GetSettings()

    Description

    Returns an object of settings stored with the connection.

    Arguments

    No arguments

    Returns

    Object with the following properties:

    Name Type Description
    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
    nrb_arcweld (optional) boolean Create arcweld using NRBs (rather than contact)
    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

    object

    Example

    To make an Oject containing the stored settings of connection c

    var o = Conx.GetSettings();


    GetShellThickness(Layer[integer])

    Description

    Returns an array 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.

    Arguments

  • 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:

    Name Type Description
    shelln Shell Shell object in the specified layer in contact with the nth 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.
    sthkn Double Thickness of shell in the specified layer in contact with the nth node of the solid adhesive element, where n can be a value from 1 to 8.

    Return type

    object

    Example

    To get the data for connection c layer 1:

    var sThkArr = c.GetShellThickness(1); // sThkArr is an array of objects containing shells and shell thicknesses in only layer 1 for each solid element in the connection.
    var 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.
    var 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.
    var so4   = sThkArr[4].solid;         // so4 is the fifth solid element object (array index 4) in the sThkArr array.


    Keyword()

    Description

    Returns the keyword for this connection (*CONNECTION_START_SPOTWELD etc). Note that a carriage return is not added. See also Conx.KeywordCards()

    Arguments

    No arguments

    Returns

    string containing the keyword.

    Return type

    String

    Example

    To get the keyword for connection c:

    var key = c.Keyword();


    KeywordCards()

    Description

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

    Arguments

    No arguments

    Returns

    string containing the cards.

    Return type

    String

    Example

    To get the cards for connection c:

    var cards = c.KeywordCards();


    Last(Model[Model]) [static]

    Description

    Returns the last connection in the model.

    Arguments

  • Model (Model)

    Model to get last connection in

    Returns

    Conx object (or null if there are no connections in the model).

    Return type

    Conx

    Example

    To get the last connection in model m:

    var c = Conx.Last(m);


    LastFreeLabel(Model[Model], layer (optional)[Include number]) [static]

    Description

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

    Arguments

  • Model (Model)

    Model to get last free connection label in

  • layer (optional) (Include number)

    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

    Conx label.

    Return type

    Number

    Example

    To get the last free connection label in model m:

    var label = Conx.LastFreeLabel(m);


    Next()

    Description

    Returns the next connection in the model.

    Arguments

    No arguments

    Returns

    Conx object (or null if there are no more connections in the model).

    Return type

    Conx

    Example

    To get the connection in model m after connection c:

    var c = c.Next();


    NextFreeLabel(Model[Model], layer (optional)[Include number]) [static]

    Description

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

    Arguments

  • Model (Model)

    Model to get next free connection label in

  • layer (optional) (Include number)

    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

    Conx label.

    Return type

    Number

    Example

    To get the next free connection label in model m:

    var label = Conx.NextFreeLabel(m);


    Pick(prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean], button text (optional)[string]) [static]

    Description

    Allows the user to pick a connection.

    Arguments

  • prompt (string)

    Text to display as a prompt to the user

  • limit (optional) (Model or Flag)

    If the argument is a Model then only connections from that model can be picked. If the argument is a Flag then only connections that are flagged with limit can be selected. If omitted, or null, any connections from any model can be selected. from any model.

  • modal (optional) (boolean)

    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 (optional) (string)

    By default the window with the prompt will have a button labelled 'Cancel' which if pressed will cancel the pick and return null. If you want to change the text on the button use this argument. If omitted 'Cancel' will be used.

    Returns

    Conx object (or null if not picked)

    Return type

    Conx

    Example

    To pick a connection from model m giving the prompt 'Pick connection from screen':

    var c = Conx.Pick('Pick connection from screen', m);


    Previous()

    Description

    Returns the previous connection in the model.

    Arguments

    No arguments

    Returns

    Conx object (or null if there are no more connections in the model).

    Return type

    Conx

    Example

    To get the connection in model m before connection c:

    var c = c.Previous();


    RealizeAll(Model[Model]) [static]

    Description

    Realizes all of the connections in the model.

    Arguments

  • Model (Model)

    Model that all connections will be realized in

    Returns

    No return value

    Example

    To realize all of the connections in model m:

    Conx.RealizeAll(m);


    RealizeFlagged(Model[Model], flag[Flag]) [static]

    Description

    Realizes all of the flagged connections in the model.

    Arguments

  • Model (Model)

    Model that the flagged connections will be realized in

  • flag (Flag)

    Flag set on the connections that you want to realize

    Returns

    No return value

    Example

    To realize all of the connections in model m flagged with f:

    Conx.RealizeFlagged(m, f);


    ReloadConnectors() [static]

    Description

    Reload all modules from primer_library/connectors

    Arguments

    No arguments

    Returns

    No return value

    Example

    Conx.ReloadConnectors();


    RemovePatchTopol(layer[integer])

    Description

    Deletes the topology at a particular location for patch type adhesive.

    Arguments

  • layer (integer)

    The topology location you want to remove. Note that layers start at 0, not 1.

    Returns

    No return value.

    Example

    To remove the 3rd topology data for connection c:

    c.RemovePatchTopol(2);


    RemovePathData(layer[integer])

    Description

    Deletes a pathc point for a line adhesive connection.

    Arguments

  • layer (integer)

    The point you want to remove. Note that layers start at 0, not 1.

    Returns

    No return value.

    Example

    To remove the 3rd point from connection c:

    c.RemovePathData(2);


    RenumberAll(Model[Model], start[integer]) [static]

    Description

    Renumbers all of the connections in the model.

    Arguments

  • Model (Model)

    Model that all connections will be renumbered in

  • start (integer)

    Start point for renumbering

    Returns

    No return value

    Example

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

    Conx.RenumberAll(m, 1000000);


    RenumberFlagged(Model[Model], flag[Flag], start[integer]) [static]

    Description

    Renumbers all of the flagged connections in the model.

    Arguments

  • Model (Model)

    Model that all the flagged connections will be renumbered in

  • flag (Flag)

    Flag set on the connections that you want to renumber

  • start (integer)

    Start point for renumbering

    Returns

    No return value

    Example

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

    Conx.RenumberFlagged(m, f, 1000000);


    Select(flag[Flag], prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean]) [static]

    Description

    Allows the user to select connections using standard PRIMER object menus.

    Arguments

  • flag (Flag)

    Flag to use when selecting connections

  • prompt (string)

    Text to display as a prompt to the user

  • limit (optional) (Model or Flag)

    If the argument is a Model then only connections from that model can be selected. If the argument is a Flag then only connections that are flagged with limit can be selected (limit should be different to flag). If omitted, or null, any connections can be selected. from any model.

  • modal (optional) (boolean)

    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 null if menu cancelled

    Return type

    Number

    Example

    To select connections from model m, flagging those selected with flag f, giving the prompt 'Select connections':

    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':

    Conx.Select(f, 'Select connections', l);


    SetFlag(flag[Flag])

    Description

    Sets a flag on the connection.

    Arguments

  • flag (Flag)

    Flag to set on the connection

    Returns

    No return value

    Example

    To set flag f for connection c:

    c.SetFlag(f);


    SetLayerData(layer[integer], item1[integer/string], item2 (optional)[integer/string], ... (optional)[integer/string])

    Description

    Sets the data for a layer of the connection.

    Arguments

  • 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 (optional) (integer/string)

    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).

  • ... (optional) (integer/string)

    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.

    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

    var a = new Array(10, 20);
    c.SetLayerData(2, a);


    SetPatchCoords(point[integer], x[real], y[real], z[real])

    Description

    Sets a coordinate used by the adhesive patch connection type.

    Arguments

  • point (integer)

    The point you want to set the data for. Note that points start at 0, not 1.

  • x (real)

    X coordinate of point

  • y (real)

    Y coordinate of point

  • z (real)

    Z coordinate of point

    Returns

    No return value.

    Example

    To set the position for the 3rd patch point for connection c, to be (10, 20, 30);

    c.SetPatchCoords(2, 10, 20, 30);


    SetPatchTopol(point[integer], c1[integer], c2[integer], c3[integer], c4 (optional)[integer])

    Description

    Sets the topology used by the adhesive patch connection type.

    Arguments

  • 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 (optional) (integer)

    4th coordinate location point

    Returns

    No return value.

    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);


    SetPathData(point[integer], x[real], y[real], z[real])

    Description

    Sets the data for a path point of the connection.

    Arguments

  • point (integer)

    The point you want to set the data for. Note that points start at 0, not 1.

  • x (real)

    X coordinate of point

  • y (real)

    Y coordinate of point

  • z (real)

    Z coordinate of point

    Returns

    No return value.

    Example

    To set the position for the 3rd path point for connection c, to be (10, 20, 30);

    c.SetPathData(2, 10, 20, 30);


    SetPidData(item1[integer/string], item2 (optional)[integer/string], ... (optional)[integer/string])

    Description

    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.

    Arguments

  • item1 (integer/string)

    Part label of the first item in the PID layer list.

  • item2 (optional) (integer/string)

    The second item for the layer definition.

  • ... (optional) (integer/string)

    The nth item for the layer definition.

    Returns

    No return value.

    Example

    To set the part data for c, to be part IDs 10 and 20:

    c.SetPidData(10, 20);

    or

    var a = new Array(10, 20);
    c.SetPidData(a);


    SetRuleDiameter(diameter[integer]) [static]

    Description

    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.

    Arguments

  • diameter (integer)

    The diameter to set for the ring

    Returns

    No return value

    Example

    To set the diameter for a ring to be 10.0:

    Conx.SetRuleDiameter(10.0);


    SetRuleFEPID(pid[integer]) [static]

    Description

    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.

    Arguments

  • pid (integer)

    The PID to set for the spotweld or adhesive elements

    Returns

    No return value

    Example

    To set the PID for a spotweld to be 1000:

    Conx.SetRuleFEPID(1000);


    SetRulePID(pid[integer]) [static]

    Description

    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.

    Arguments

  • pid (integer)

    The PID to set for the ring

    Returns

    No return value

    Example

    To set the PID for a ring to be 1000:

    Conx.SetRulePID(1000);


    SetSettings(data[object])

    Description

    Sets the settings stored on a connection entity. Not applicable for bolts.

    Arguments

  • data (object)

    Object containing the connection settings data. The properties can be:

    Object has the following properties:

    Name Type Description
    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
    nrb_arcweld (optional) boolean Create arcweld using NRBs (rather than contact)
    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.

    Example

    To set the various settings for a connection c:

    var data = { length_check:true, total_length:1.5, warpage_check:false, angle_tolerance:5.0 };
    c.SetSettings(data);


    Sketch(redraw (optional)[boolean])

    Description

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

    Arguments

  • redraw (optional) (boolean)

    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

    Example

    To sketch connection c:

    c.Sketch();


    SketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]

    Description

    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

    Arguments

  • Model (Model)

    Model that all the flagged connections will be sketched in

  • flag (Flag)

    Flag set on the connections that you want to sketch

  • redraw (optional) (boolean)

    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

    Example

    To sketch all connections flagged with flag in model m:

    Conx.SketchFlagged(m, flag);


    Total(Model[Model], exists (optional)[boolean]) [static]

    Description

    Returns the total number of connections in the model.

    Arguments

  • Model (Model)

    Model to get total for

  • exists (optional) (boolean)

    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

    Number

    Example

    To get the total number of connections in model m:

    var total = Conx.Total(m);


    Unblank()

    Description

    Unblanks the connection

    Arguments

    No arguments

    Returns

    No return value

    Example

    To unblank connection c:

    c.Unblank();


    UnblankAll(Model[Model], redraw (optional)[boolean]) [static]

    Description

    Unblanks all of the connections in the model.

    Arguments

  • Model (Model)

    Model that all connections will be unblanked in

  • redraw (optional) (boolean)

    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

    Example

    To unblank all of the connections in model m:

    Conx.UnblankAll(m);


    UnblankFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]

    Description

    Unblanks all of the flagged connections in the model.

    Arguments

  • Model (Model)

    Model that the flagged connections will be unblanked in

  • flag (Flag)

    Flag set on the connections that you want to unblank

  • redraw (optional) (boolean)

    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

    Example

    To unblank all of the connections in model m flagged with f:

    Conx.UnblankFlagged(m, f);


    UnflagAll(Model[Model], flag[Flag]) [static]

    Description

    Unsets a defined flag on all of the connections in the model.

    Arguments

  • Model (Model)

    Model that the defined flag for all connections will be unset in

  • flag (Flag)

    Flag to unset on the connections

    Returns

    No return value

    Example

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

    Conx.UnflagAll(m, f);


    Unsketch(redraw (optional)[boolean])

    Description

    Unsketches the connection.

    Arguments

  • redraw (optional) (boolean)

    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

    Example

    To unsketch connection c:

    c.Unsketch();


    UnsketchAll(Model[Model], redraw (optional)[boolean]) [static]

    Description

    Unsketches all connections.

    Arguments

  • Model (Model)

    Model that all connections will be unblanked in

  • redraw (optional) (boolean)

    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

    Example

    To unsketch all connections in model m:

    Conx.UnsketchAll(m);


    UnsketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]

    Description

    Unsketches all flagged connections in the model.

    Arguments

  • Model (Model)

    Model that all connections will be unsketched in

  • flag (Flag)

    Flag set on the connections that you want to unsketch

  • redraw (optional) (boolean)

    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

    Example

    To unsketch all connections flagged with flag in model m:

    Conx.UnsketchAll(m, flag);


    UseParentLayer(option[boolean]) [static]

    Description

    True (default) means put bolt FE into parent layer where possible.

    Arguments

  • option (boolean)

    True (default) means put bolt FE into parent layer where possible.

    Returns

    No return value

    Example

    To switch off use of parent layer (and use current layer)

    Conx.UseParentLayer(false);


    UseSPR2Pref(option[boolean]) [static]

    Description

    True (default) means use the pref settings for C_SPR2 created when rivet realized.

    Arguments

  • option (boolean)

    True (default) means use the pref settings for C_SPR2 created when rivet realized.

    Returns

    No return value

    Example

    To ignore any pref settings and use zero for newly created C_SPR2 cards

    Conx.UseSPR2Pref(false);


    ViewParameters()

    Description

    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.

    Arguments

    No arguments

    Returns

    Conx object.

    Return type

    Conx

    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...


    Warning(message[string], details (optional)[string])

    Description

    Adds a warning for connection. For more details on checking see the Check class.

    Arguments

  • message (string)

    The warning message to give

  • details (optional) (string)

    An optional detailed warning message

    Returns

    No return value

    Example

    To add a warning message "My custom warning" for connection c:

    c.Warning("My custom warning");


    Xrefs()

    Description

    Returns the cross references for this connection.

    Arguments

    No arguments

    Returns

    Xrefs object.

    Return type

    Xrefs

    Example

    To get the cross references for connection c:

    var xrefs = c.Xrefs();


    toString()

    Description

    Creates a string containing the connection data in keyword format. Note that this contains the keyword header and the keyword cards. See also Conx.Keyword() and Conx.KeywordCards().

    Arguments

    No arguments

    Returns

    string

    Return type

    String

    Example

    To get data for connection n in keyword format

    var s = c.toString();