Group class

The Group class gives you access to groups in T/HIS. More...

The T/HIS 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

Group properties

Name Type Description
crv_at_ymax integer Curve number of the curve with the maximum Y value in the group.
crv_at_ymin integer Curve number of the curve with the minimum Y value in the group.
curves (read only) integer Number of curves in the group
name (read only) string Group name
x_at_ymax real X value at the maximum Y value over all curves in the group.
x_at_ymin real X value at the minimum Y value over all curves in the group.
x_at_yminpos real X value at the minimum positive Y value over all curves in the group.
xmax real Maximum X value over all curves in the group.
xmin real Minimum X value over all curves in the group.
xminpos real Minimum positive X value over all curves in the group.
ymax real Maximum Y value over all curves in the group.
ymin real Minimum Y value over all curves in the group.
yminpos real Minimum positive Y value over all curves in the group.

Detailed Description

The Group class allows you to create, and modify groups. See the documentation below for more details.

Constructor

new Group(name[string])

Description

Create a new Group object.

Arguments

  • name (string)

    Group name used to reference the group

    Returns

    Group object

    Return type

    Group

    Example

    To create a new group with the name X-Velocity

    var l = new Group("X-velocity");

    Details of functions

    Add(Curve[Curve])

    Description

    Adds a curve object to group.

    Arguments

  • Curve (Curve)

    Curve that will be added to group

    Returns

    No return value.

    Example

    To add curve c to curve group g:

    g.Add(c);


    AddAll()

    Description

    Adds all curves to group.

    Arguments

    No arguments

    Returns

    No return value.

    Example

    To add all curves to curve group g:

    g.AddAll();


    AddID(ID[integer])

    Description

    Adds curve by ID to a group.

    Arguments

  • ID (integer)

    The ID of the curve you want to add.

    Returns

    No return value.

    Example

    To add curve 3 to curve group g:

    g.AddID(3);


    Contains(Curve[Curve])

    Description

    Checks if a curve object is in a curve group.

    Arguments

  • Curve (Curve)

    Curve that will be checked

    Returns

    TRUE if the curve is in the group, otherwise FALSE

    Return type

    Boolean

    Example

    To check if a curve object n is in group g

    var exists = g.Contains(n);


    ContainsID(ID[integer])

    Description

    Checks if a curve ID is in a curve group.

    Arguments

  • ID (integer)

    The ID of the curve you want to check.

    Returns

    TRUE if the curve is in the group, otherwise FALSE

    Return type

    Boolean

    Example

    To check if a curve ID n is in group g

    var exists = g.ContainsID(n);


    DeleteGroup(group ID or name[integer or string], delete automatic groups (optional)[integer]) [static]

    Description

    Deletes a curve group

    Arguments

  • group ID or name (integer or string)

    ID of group to delete or name of group. If this argument is 0, delete all groups. Automatically generated groups won't be deleted unless the next argument is set to 1.

  • delete automatic groups (optional) (integer)

    If this argument is 1, automatic groups can be deleted. If no argument or 0, automatic groups cant be deleted.

    Returns

    No return value

    Example

    To delete group n

    Group.DeleteGroup(n);


    Get(Name[string]) [static]

    Description

    Returns a group object.

    Arguments

  • Name (string)

    Name of the group to return object for

    Returns

    Group object (or Null if the group does not exist).

    Return type

    Group

    Example

    To get the group called 'left'

    var group = Group.Get("left");


    GetCurveIDs()

    Description

    Returns an array of Curve ID's for all the Curves in the group.

    Arguments

    No arguments

    Returns

    Array of integers.

    Return type

    Number

    Example

    To make an array of Curve ID's for all the curves in group g:

    var curves = g.GetCurveIDs();


    GetCurves()

    Description

    Returns an array of Curve Objects for all the Curves in the group.

    Arguments

    No arguments

    Returns

    Array of Curve objects.

    Return type

    Array

    Example

    To make an array of Curve objects for all the curves in group g:

    var curves = g.GetCurves();


    GetFromID(ID[integer]) [static]

    Description

    Returns a group object.

    Arguments

  • ID (integer)

    ID of the group to return object for

    Returns

    Group object (or Null if the group does not exist).

    Return type

    Group

    Example

    To get the group number 1

    var group = Group.GetFromID(1);


    Remove(Curve[Curve])

    Description

    Removes a curve object from a group.

    Arguments

  • Curve (Curve)

    Curve that will be removed from group

    Returns

    No return value.

    Example

    To remove curve c from curve group g:

    g.Remove(c);


    RemoveAll()

    Description

    Removes all curves from a group.

    Arguments

    No arguments

    Returns

    No return value.

    Example

    To remove all curves from curve group g:

    g.RemoveAll();


    RemoveID(ID[integer])

    Description

    Remove a curve by ID from a group.

    Arguments

  • ID (integer)

    The ID of the curve you want to remove.

    Returns

    No return value.

    Example

    To remove curve 3 from curve group g:

    g.RemoveID(3);


    Spool()

    Description

    Spools a group, entry by entry and returns the curve objects. See also Group.StartSpool

    Arguments

    No arguments

    Returns

    Curve Object of item, or NULL if no more curves in group

    Return type

    Curve

    Example

    To spool group g:

    var id;
    g.StartSpool();
    while (id = g.Spool() )
    {
        do something...
    }


    SpoolID()

    Description

    Spools a group, entry by entry and returns the curve ID's or 0 when no more curves in group. See also Group.StartSpool

    Arguments

    No arguments

    Returns

    integer

    Return type

    Number

    Example

    To spool group g :

    var id;
    g.StartSpool();
    while (id = g.SpoolID() )
    {
        do something...
    }


    StartSpool()

    Description

    Starts a group spooling operation. See also Group.Spool

    Arguments

    No arguments

    Returns

    No return value

    Example

    To start spooling group g:

    g.StartSpool();


    Total() [static]

    Description

    Returns the total number of curve group currently defined

    Arguments

    No arguments

    Returns

    Number of curve groups currently defined.

    Return type

    Number

    Example

    To get the number of curve groups

    var total = Group.Total();