Include class

The Include class gives you access to include files 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

Include constants

Constants for Directory separators

Name Description
Include.NATIVE Use directory separators native to this machine when writing directory names.
Include.UNIX Use unix directory separators when writing directory names.
Include.WINDOWS Use windows directory separators when writing directory names.

Include properties

Name Type Description
label (read only) integer The label for the include file
name (read only) string The name for the include file
parent (read only) integer The label for the include file parent (0 if main file)

Detailed Description

The Include class allows you to inspect include files that are used in a model. Note that for D3PLOT to be able to get include file data there must be a ztf file. See the documentation below for more details.

Details of functions

First(model[Model]) [static]

Description

Returns the first include file in the model (or null if there are no include files in the model)

Arguments

  • model (Model)

    Model to get first include file in

    Returns

    Include object

    Return type

    Include

    Example

    To get the first include file in model m:

    var i = Include.First(m);


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

    Description

    Returns the include file in the model with number (or null if it does not exist)

    Arguments

  • model (Model)

    Model to get include file in

  • number (integer)

    The number for the include file in the model. Note that include file numbers start at 1. 0 is the main file.

    Returns

    Include object

    Return type

    Include

    Example

    To get include file number 5 in model m:

    var i = Include.GetFromID(m, 5);


    Last(model[Model]) [static]

    Description

    Returns the last include file in the model (or null if there are no include files in the model)

    Arguments

  • model (Model)

    Model to get last include file in

    Returns

    Include object

    Return type

    Include

    Example

    To get the last include file in model m:

    var i = Include.Last(m);


    Next()

    Description

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

    Arguments

    No arguments

    Returns

    Include object

    Return type

    Include

    Example

    To get the next include file after include i:

    var i = i.Next();


    Previous()

    Description

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

    Arguments

    No arguments

    Returns

    Include object

    Return type

    Include

    Example

    To get the previous include file before include i:

    var i = i.Previous();


    Total(model[Model]) [static]

    Description

    Returns the total number of include files in the model

    Arguments

  • model (Model)

    Model to get total in

    Returns

    Number of includes

    Return type

    int

    Example

    To get the number of include files in model m:

    var t = Include.Total(m);