InterfaceLinkingEdge class

The InterfaceLinkingEdge class gives you access to define Interface Linking Edge cards 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

InterfaceLinkingEdge properties

Name Type Description
exists (read only) logical true if Interface Linking Edge exists, false if referred to but not defined.
ifid integer Interface ID.
include integer The Include file number that the Interface Linking Edge is in.
model (read only) integer The Model number that the Interface Linking Edge is in.
nsid integer Node set ID

Detailed Description

The InterfaceLinkingEdge class allows you to create, modify, edit and manipulate Interface Linking Edge cards. See the documentation below for more details.

Constructor

new InterfaceLinkingEdge(Model[Model], nsid[integer], ifid[integer])

Description

Create a new InterfaceLinkingEdge object.

Arguments

  • Model (Model)

    Model that Interface Linking Edge will be created in

  • nsid (integer)

    Node set ID

  • ifid (integer)

    Interface ID

    Returns

    InterfaceLinkingEdge object

    Return type

    InterfaceLinkingEdge

    Example

    To create a new Interface Linking Edge in model m with NSID 900 and IFID 2

    var b = new InterfaceLinkingEdge(m, 900, 2);

    Details of functions

    AssociateComment(Comment[Comment])

    Description

    Associates a comment with a Interface Linking Edge.

    Arguments

  • Comment (Comment)

    Comment that will be attached to the Interface Linking Edge

    Returns

    No return value

    Example

    To associate comment c to the Interface Linking Edge I_LE:

    I_LE.AssociateComment(c);


    ClearFlag(flag[Flag])

    Description

    Clears a flag on the Interface Linking Edge.

    Arguments

  • flag (Flag)

    Flag to clear on the Interface Linking Edge

    Returns

    No return value

    Example

    To clear flag f for Interface Linking Edge I_LE:

    I_LE.ClearFlag(f);


    Copy(range (optional)[boolean])

    Description

    Copies the Interface Linking Edge. The target include of the copied Interface Linking Edge 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

    InterfaceLinkingEdge object

    Return type

    InterfaceLinkingEdge

    Example

    To copy Interface Linking Edge I_LE into Interface Linking Edge z:

    var z = I_LE.Copy();


    DetachComment(Comment[Comment])

    Description

    Detaches a comment from a Interface Linking Edge.

    Arguments

  • Comment (Comment)

    Comment that will be detached from the Interface Linking Edge

    Returns

    No return value

    Example

    To detach comment c from the Interface Linking Edge I_LE:

    I_LE.DetachComment(c);


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

    Description

    Adds an error for Interface Linking Edge. 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 Interface Linking Edge I_LE:

    I_LE.Error("My custom error");


    First(Model[Model]) [static]

    Description

    Returns the first Interface Linking Edge in the model.

    Arguments

  • Model (Model)

    Model to get first Interface Linking Edge in

    Returns

    InterfaceLinkingEdge object (or null if there are no Interface Linking Edges in the model).

    Return type

    InterfaceLinkingEdge

    Example

    To get the first Interface Linking Edge in model m:

    var I_LE = InterfaceLinkingEdge.First(m);


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

    Description

    Flags all of the Interface Linking Edges in the model with a defined flag.

    Arguments

  • Model (Model)

    Model that all Interface Linking Edges will be flagged in

  • flag (Flag)

    Flag to set on the Interface Linking Edges

    Returns

    No return value

    Example

    To flag all of the Interface Linking Edges with flag f in model m:

    InterfaceLinkingEdge.FlagAll(m, f);


    Flagged(flag[Flag])

    Description

    Checks if the Interface Linking Edge is flagged or not.

    Arguments

  • flag (Flag)

    Flag to test on the Interface Linking Edge

    Returns

    true if flagged, false if not.

    Return type

    Boolean

    Example

    To check if Interface Linking Edge I_LE has flag f set on it:

    if (I_LE.Flagged(f) ) do_something...


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

    Description

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

    Arguments

  • Model (Model)

    Model that all Interface Linking Edges are in

  • func (function)

    Function to call for each Interface Linking Edge

  • 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 Interface Linking Edges in model m:

    InterfaceLinkingEdge.ForEach(m, test);
    function test(I_LE)
    {
    // I_LE is InterfaceLinkingEdge object
    }

    To call function test for all of the Interface Linking Edges in model m with optional object:

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


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

    Description

    Returns an array of InterfaceLinkingEdge objects or properties for all of the Interface Linking Edges in a model in PRIMER. If the optional property argument is not given then an array of InterfaceLinkingEdge objects is returned. If the property argument is given, that property value for each Interface Linking Edge is returned in the array instead of a InterfaceLinkingEdge object

    Arguments

  • Model (Model)

    Model to get Interface Linking Edges from

  • property (optional) (string)

    Name for property to get for all Interface Linking Edges in the model

    Returns

    Array of InterfaceLinkingEdge objects or properties

    Return type

    Array

    Example

    To make an array of InterfaceLinkingEdge objects for all of the Interface Linking Edges in model m:

    var a = InterfaceLinkingEdge.GetAll(m);

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

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


    GetComments()

    Description

    Extracts the comments associated to a Interface Linking Edge.

    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 Interface Linking Edge I_LE:

    var comm_array = I_LE.GetComments();


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

    Description

    Returns an array of InterfaceLinkingEdge objects for all of the flagged Interface Linking Edges in a model in PRIMER If the optional property argument is not given then an array of InterfaceLinkingEdge objects is returned. If the property argument is given, then that property value for each Interface Linking Edge is returned in the array instead of a InterfaceLinkingEdge object

    Arguments

  • Model (Model)

    Model to get Interface Linking Edges from

  • flag (Flag)

    Flag set on the Interface Linking Edges that you want to retrieve

  • property (optional) (string)

    Name for property to get for all flagged Interface Linking Edges in the model

    Returns

    Array of InterfaceLinkingEdge objects or properties

    Return type

    Array

    Example

    To make an array of InterfaceLinkingEdge objects for all of the Interface Linking Edges in model m flagged with f:

    var I_LE = InterfaceLinkingEdge.GetFlagged(m, f);

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

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


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

    Description

    Returns the InterfaceLinkingEdge object for a Interface Linking Edge ID.

    Arguments

  • Model (Model)

    Model to find the Interface Linking Edge in

  • number (integer)

    number of the Interface Linking Edge you want the InterfaceLinkingEdge object for

    Returns

    InterfaceLinkingEdge object (or null if Interface Linking Edge does not exist).

    Return type

    InterfaceLinkingEdge

    Example

    To get the InterfaceLinkingEdge object for Interface Linking Edge 100 in model m

    var I_LE = InterfaceLinkingEdge.GetFromID(m, 100);


    GetParameter(prop[string])

    Description

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

    Arguments

  • prop (string)

    Interface Linking Edge property to get parameter for

    Returns

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

    Return type

    Parameter

    Example

    To check if InterfaceLinkingEdge property I_LE.example is a parameter:

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

    To check if InterfaceLinkingEdge property I_LE.example is a parameter by using the GetParameter method:

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


    Keyword()

    Description

    Returns the keyword for this Interface Linking Edge (*INTERFACE_LINKING_EDGE). Note that a carriage return is not added. See also InterfaceLinkingEdge.KeywordCards()

    Arguments

    No arguments

    Returns

    string containing the keyword.

    Return type

    String

    Example

    To get the keyword for Interface Linking Edge m:

    var key = m.Keyword();


    KeywordCards()

    Description

    Returns the keyword cards for the Interface Linking Edge. Note that a carriage return is not added. See also InterfaceLinkingEdge.Keyword()

    Arguments

    No arguments

    Returns

    string containing the cards.

    Return type

    String

    Example

    To get the cards for Interface Linking Edge l:

    var cards = l.KeywordCards();


    Last(Model[Model]) [static]

    Description

    Returns the last Interface Linking Edge in the model.

    Arguments

  • Model (Model)

    Model to get last Interface Linking Edge in

    Returns

    InterfaceLinkingEdge object (or null if there are no Interface Linking Edges in the model).

    Return type

    InterfaceLinkingEdge

    Example

    To get the last Interface Linking Edge in model m:

    var I_LE = InterfaceLinkingEdge.Last(m);


    Next()

    Description

    Returns the next Interface Linking Edge in the model.

    Arguments

    No arguments

    Returns

    InterfaceLinkingEdge object (or null if there are no more Interface Linking Edges in the model).

    Return type

    InterfaceLinkingEdge

    Example

    To get the Interface Linking Edge in model m after Interface Linking Edge I_LE:

    var I_LE = I_LE.Next();


    Previous()

    Description

    Returns the previous Interface Linking Edge in the model.

    Arguments

    No arguments

    Returns

    InterfaceLinkingEdge object (or null if there are no more Interface Linking Edges in the model).

    Return type

    InterfaceLinkingEdge

    Example

    To get the Interface Linking Edge in model m before Interface Linking Edge I_LE:

    var I_LE = I_LE.Previous();


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

    Description

    Allows the user to select Interface Linking Edges using standard PRIMER object menus.

    Arguments

  • flag (Flag)

    Flag to use when selecting Interface Linking Edges

  • prompt (string)

    Text to display as a prompt to the user

  • limit (optional) (Model or Flag)

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

    Return type

    Number

    Example

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

    InterfaceLinkingEdge.Select(f, 'Select Interface Linking Edges', m);

    To select Interface Linking Edges, flagging those selected with flag f but limiting selection to Interface Linking Edges flagged with flag l, giving the prompt 'Select Interface Linking Edges':

    InterfaceLinkingEdge.Select(f, 'Select Interface Linking Edges', l);


    SetFlag(flag[Flag])

    Description

    Sets a flag on the Interface Linking Edge.

    Arguments

  • flag (Flag)

    Flag to set on the Interface Linking Edge

    Returns

    No return value

    Example

    To set flag f for Interface Linking Edge I_LE:

    I_LE.SetFlag(f);


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

    Description

    Returns the total number of Interface Linking Edges in the model.

    Arguments

  • Model (Model)

    Model to get total for

  • exists (optional) (boolean)

    true if only existing Interface Linking Edges should be counted. If false or omitted referenced but undefined Interface Linking Edges will also be included in the total.

    Returns

    number of Interface Linking Edges

    Return type

    Number

    Example

    To get the total number of Interface Linking Edges in model m:

    var total = InterfaceLinkingEdge.Total(m);


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

    Description

    Unsets a defined flag on all of the Interface Linking Edges in the model.

    Arguments

  • Model (Model)

    Model that the defined flag for all Interface Linking Edges will be unset in

  • flag (Flag)

    Flag to unset on the Interface Linking Edges

    Returns

    No return value

    Example

    To unset the flag f on all the Interface Linking Edges in model m:

    InterfaceLinkingEdge.UnflagAll(m, f);


    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

    InterfaceLinkingEdge object.

    Return type

    InterfaceLinkingEdge

    Example

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

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


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

    Description

    Adds a warning for Interface Linking Edge. 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 Interface Linking Edge I_LE:

    I_LE.Warning("My custom warning");


    Xrefs()

    Description

    Returns the cross references for this Interface Linking Edge.

    Arguments

    No arguments

    Returns

    Xrefs object.

    Return type

    Xrefs

    Example

    To get the cross references for Interface Linking Edge I_LE:

    var xrefs = I_LE.Xrefs();


    toString()

    Description

    Creates a string containing the Interface Linking Edge data in keyword format. Note that this contains the keyword header and the keyword cards. See also InterfaceLinkingEdge.Keyword() and InterfaceLinkingEdge.KeywordCards().

    Arguments

    No arguments

    Returns

    string

    Return type

    String

    Example

    To get data for Interface Linking Edge l in keyword format

    var s = l.toString();