Group class

The Group class gives you access to groups in D3PLOT. More...

The D3PLOT 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
label (read only) integer The group label
model (read only) Model The Model that the group is in
title string The group title
type (read only) constant The type for the group (will be Type.GROUP)

Detailed Description

The Group class allows you to inspect groups in a model. See the documentation below for more details.

Constructor

new Group(model[Model object])

Description

Creates a new group in D3PLOT

Arguments

  • model (Model object)

    The model to create the group in

    Returns

    Group object

    Return type

    Group

    Example

    To create a group for Model m in D3PLOT

    var g = new Group(m);

    Details of functions

    AddFlagged(flag[Flag])

    Description

    Adds flagged items to the contents of the group

    Arguments

  • flag (Flag)

    Flag (see AllocateFlag) set on items to add to the group

    Returns

    No return value

    Example

    To add items flagged with flag f to group g:

    g.AddFlagged(f);


    Empty()

    Description

    Empties the group (removes everything from the group)

    Arguments

    No arguments

    Returns

    No return value

    Example

    To empty group g:

    g.Empty();


    First(model[Model]) [static]

    Description

    Returns the first group in the model (or null if there are no groups)

    Arguments

  • model (Model)

    Model to get first group in

    Returns

    Group object

    Return type

    Group

    Example

    To get the first group in model m:

    var g = Group.First(m);


    FlagContents(flag[Flag])

    Description

    Flags the contents of the group

    Arguments

  • flag (Flag)

    Flag (see AllocateFlag) to set for the group contents

    Returns

    No return value

    Example

    To flag the contents of group g with flag f:

    g.FlagContents(f);


    GetFromID(model[Model], label[integer]) [static]

    Description

    Returns the Group object for group in model with label (or null if it does not exist)

    Arguments

  • model (Model)

    Model to get group in

  • label (integer)

    The label for the group in the model

    Returns

    Group object

    Return type

    Group

    Example

    To get the group in model m with label 2:

    var g = Group.GetFromID(m, 2);


    Last(model[Model]) [static]

    Description

    Returns the last group in the model (or null if there are no groups)

    Arguments

  • model (Model)

    Model to get last group in

    Returns

    Group object

    Return type

    Group

    Example

    To get the last group in model m:

    var g = Group.Last(m);


    Next()

    Description

    Returns the next group in the model (or null if there is not one)

    Arguments

    No arguments

    Returns

    Group object

    Return type

    Group

    Example

    To get the next group after group g:

    g = g.Next();


    Previous()

    Description

    Returns the previous group in the model (or null if there is not one)

    Arguments

    No arguments

    Returns

    Group object

    Return type

    Group

    Example

    To get the previous group before group g:

    g = g.Previous();


    Total(model[Model]) [static]

    Description

    Returns the total number of groups in a model

    Arguments

  • model (Model)

    Model to get group in

    Returns

    The number of groups

    Return type

    integer

    Example

    To get the number of groups in model m:

    var total = Group.Total(m);