SetBeam class

The SetBeam class gives you access to beam sets 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

SetBeam properties

Name Type Description
include (read only) integer The include file number in the model that the beam set is in
index (read only) integer The internal index for the beam set in D3PLOT (starting at 0)
label (read only) integer The Ansys LS-DYNA label for the beam set
model (read only) Model The Model that the beam set is in
title (read only) string The title for the beam set (or null if no title). This is only available if there is a ztf file for the model. If not null will be returned.
total (read only) integer The total number of beam items in the beam set
type (read only) constant The type for the beam set (will be Type.SET_BEAM)

Detailed Description

The SetBeam class allows you to view sets in D3PLOT. There are various methods and properties available. This class requires a ztf file to be present for the model. See the documentation below for more details.

Details of functions

AllItems()

Description

Returns all of the beam items for the beam set in the model

Arguments

No arguments

Returns

array of Beam objects

Return type

Array

Example

To get the beam items in beam set s:

var items = s.AllItems();


ClearFlag(flag[Flag])

Description

Clears a flag on a beam set

Arguments

  • flag (Flag)

    Flag (see AllocateFlag) to clear on the beam set

    Returns

    No return value

    Example

    To clear flag f on beam set s:

    s.ClearFlag();


    First(model[Model]) [static]

    Description

    Returns the first beam set in the model (or null if there are no beam sets in the model)

    Arguments

  • model (Model)

    Model to get first beam set in

    Returns

    SetBeam object

    Return type

    SetBeam

    Example

    To get the first beam set in model m:

    var s = SetBeam.First(m);


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

    Description

    Flags all of the beam sets in the model with a defined flag

    Arguments

  • model (Model)

    Model that all the beam sets will be flagged in

  • flag (Flag)

    Flag (see AllocateFlag) to set on the beam sets

    Returns

    No return value

    Example

    To flag all of the beam sets with flag f in model m:

    SetBeam.FlagAll(m, f);


    Flagged(flag[Flag])

    Description

    Checks if the beam set is flagged or not

    Arguments

  • flag (Flag)

    Flag (see AllocateFlag) to test on the beam set

    Returns

    true if flagged, false if not

    Return type

    boolean

    Example

    To check if beam set s has flag f set on it:

    if (s.Flagged(f) ) do_something...


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

    Description

    Returns an array of SetBeam objects or properties for all of the beam sets in the model. If the optional property argument is not given then an array of SetBeam objects is returned. If the property argument is given, that property value for each beam set is returned in the array instead of a SetBeam object

    Arguments

  • model (Model)

    Model that all the beam sets are in

  • property (optional) (string)

    Name for property to get for all beam sets in the model

    Returns

    Array of SetBeam objects or properties

    Return type

    Array

    Example

    To get all of the beam sets in model m:

    var s = SetBeam.GetAll(m);

    To return an array containing the value of property 'foo' (for example 'label' for a beam set) for each beam set in model m:

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


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

    Description

    Gets all of the beam sets in the model flagged with a defined flag. If the optional property argument is not given then an array of SetBeam objects is returned. If the property argument is given, that property value for each beam set is returned in the array instead of a SetBeam object

    Arguments

  • model (Model)

    Model that the flagged beam sets are in

  • flag (Flag)

    Flag (see AllocateFlag) set on the beam sets to get

  • property (optional) (string)

    Name for property to get for all flagged beam sets in the model

    Returns

    Array of SetBeam objects or properties

    Return type

    Array

    Example

    To get all of the beam sets flagged with flag f in model m:

    SetBeam.GetFlagged(m, f);

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

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


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

    Description

    Returns the SetBeam object for beam set in model with label (or null if it does not exist)

    Arguments

  • model (Model)

    Model to get beam set in

  • label (integer)

    The Ansys LS-DYNA label for the beam set in the model

    Returns

    SetBeam object

    Return type

    SetBeam

    Example

    To get the beam set in model m with label 1000:

    var s = SetBeam.GetFromID(m, 1000);


    GetFromIndex(model[Model], index[integer]) [static]

    Description

    Returns the SetBeam object for beam set in model with index (or null if it does not exist)

    Arguments

  • model (Model)

    Model to get beam set in

  • index (integer)

    The D3PLOT internal index in the model for beam set, starting at 0.

    Returns

    SetBeam object

    Return type

    SetBeam

    Example

    To get the 51st beam set in model m:

    var s = SetBeam.GetFromIndex(m, 50);


    Item(index[integer])

    Description

    Returns a beam item from the beam set in the model

    Arguments

  • index (integer)

    The index in the beam set to get the beam from (0 <= index < total)

    Returns

    Beam object

    Return type

    Beam

    Example

    To get the 10th beam in beam set s:

    var items = s.Item(9);


    Last(model[Model]) [static]

    Description

    Returns the last beam set in the model (or null if there are no beam sets in the model)

    Arguments

  • model (Model)

    Model to get last beam set in

    Returns

    SetBeam object

    Return type

    SetBeam

    Example

    To get the last beam set in model m:

    var s = SetBeam.Last(m);


    Next()

    Description

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

    Arguments

    No arguments

    Returns

    SetBeam object

    Return type

    SetBeam

    Example

    To get the next beam set after beam set s:

    s = s.Next();


    Previous()

    Description

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

    Arguments

    No arguments

    Returns

    SetBeam object

    Return type

    SetBeam

    Example

    To get the previous beam set before beam set s:

    s = s.Previous();


    SetFlag(flag[Flag])

    Description

    Sets a flag on a beam set

    Arguments

  • flag (Flag)

    Flag (see AllocateFlag) to set on the beam set

    Returns

    No return value

    Example

    To set flag f on beam set s:

    s.SetFlag(f);


    Total(model[Model]) [static]

    Description

    Returns the total number of beam sets in the model

    Arguments

  • model (Model)

    Model to get total in

    Returns

    The number of beam sets

    Return type

    integer

    Example

    To get the number of beam sets in model m:

    var total = SetBeam.Total(m);


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

    Description

    Unsets a defined flag on all of the beam sets in the model

    Arguments

  • model (Model)

    Model that the defined flag for all beam sets will be unset in

  • flag (Flag)

    Flag (see AllocateFlag) to unset on the beam sets

    Returns

    No return value

    Example

    To unset flag f on all of the beam sets in model m:

    SetBeam.UnflagAll(m, f);