SetPart class

The SetPart class gives you access to part 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

SetPart properties

Name Type Description
include (read only) integer The include file number in the model that the part set is in
index (read only) integer The internal index for the part set in D3PLOT (starting at 0)
label (read only) integer The Ansys LS-DYNA label for the part set
model (read only) Model The Model that the part set is in
title (read only) string The title for the part 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 part items in the part set
type (read only) constant The type for the part set (will be Type.SET_PART)

Detailed Description

The SetPart 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 part items for the part set in the model

Arguments

No arguments

Returns

array of Part objects

Return type

Array

Example

To get the part items in part set s:

var items = s.AllItems();


ClearFlag(flag[Flag])

Description

Clears a flag on a part set

Arguments

  • flag (Flag)

    Flag (see AllocateFlag) to clear on the part set

    Returns

    No return value

    Example

    To clear flag f on part set s:

    s.ClearFlag();


    First(model[Model]) [static]

    Description

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

    Arguments

  • model (Model)

    Model to get first part set in

    Returns

    SetPart object

    Return type

    SetPart

    Example

    To get the first part set in model m:

    var s = SetPart.First(m);


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

    Description

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

    Arguments

  • model (Model)

    Model that all the part sets will be flagged in

  • flag (Flag)

    Flag (see AllocateFlag) to set on the part sets

    Returns

    No return value

    Example

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

    SetPart.FlagAll(m, f);


    Flagged(flag[Flag])

    Description

    Checks if the part set is flagged or not

    Arguments

  • flag (Flag)

    Flag (see AllocateFlag) to test on the part set

    Returns

    true if flagged, false if not

    Return type

    boolean

    Example

    To check if part 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 SetPart objects or properties for all of the part sets in the model. If the optional property argument is not given then an array of SetPart objects is returned. If the property argument is given, that property value for each part set is returned in the array instead of a SetPart object

    Arguments

  • model (Model)

    Model that all the part sets are in

  • property (optional) (string)

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

    Returns

    Array of SetPart objects or properties

    Return type

    Array

    Example

    To get all of the part sets in model m:

    var s = SetPart.GetAll(m);

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

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


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

    Description

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

    Arguments

  • model (Model)

    Model that the flagged part sets are in

  • flag (Flag)

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

  • property (optional) (string)

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

    Returns

    Array of SetPart objects or properties

    Return type

    Array

    Example

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

    SetPart.GetFlagged(m, f);

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

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


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

    Description

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

    Arguments

  • model (Model)

    Model to get part set in

  • label (integer)

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

    Returns

    SetPart object

    Return type

    SetPart

    Example

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

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


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

    Description

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

    Arguments

  • model (Model)

    Model to get part set in

  • index (integer)

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

    Returns

    SetPart object

    Return type

    SetPart

    Example

    To get the 51st part set in model m:

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


    Item(index[integer])

    Description

    Returns a part item from the part set in the model

    Arguments

  • index (integer)

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

    Returns

    Part object

    Return type

    Part

    Example

    To get the 10th part in part set s:

    var items = s.Item(9);


    Last(model[Model]) [static]

    Description

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

    Arguments

  • model (Model)

    Model to get last part set in

    Returns

    SetPart object

    Return type

    SetPart

    Example

    To get the last part set in model m:

    var s = SetPart.Last(m);


    Next()

    Description

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

    Arguments

    No arguments

    Returns

    SetPart object

    Return type

    SetPart

    Example

    To get the next part set after part set s:

    s = s.Next();


    Previous()

    Description

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

    Arguments

    No arguments

    Returns

    SetPart object

    Return type

    SetPart

    Example

    To get the previous part set before part set s:

    s = s.Previous();


    SetFlag(flag[Flag])

    Description

    Sets a flag on a part set

    Arguments

  • flag (Flag)

    Flag (see AllocateFlag) to set on the part set

    Returns

    No return value

    Example

    To set flag f on part set s:

    s.SetFlag(f);


    Total(model[Model]) [static]

    Description

    Returns the total number of part sets in the model

    Arguments

  • model (Model)

    Model to get total in

    Returns

    The number of part sets

    Return type

    integer

    Example

    To get the number of part sets in model m:

    var total = SetPart.Total(m);


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

    Description

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

    Arguments

  • model (Model)

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

  • flag (Flag)

    Flag (see AllocateFlag) to unset on the part sets

    Returns

    No return value

    Example

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

    SetPart.UnflagAll(m, f);