Solid class

The Solid class gives you access to solid elements 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

Solid properties

Name Type Description
data (read only) real|array Component data for a solid passed as an argument to GetMultipleData. Note that data will only exist for the instance of the solid passed to GetMultipleData. i.e. it is a local property stored on the specific instance. It is not stored in the D3PLOT database
include (read only) integer The include file number in the model that the solid is in
index (read only) integer The internal index for the solid in D3PLOT (starting at 0)
label (read only) integer The Ansys LS-DYNA label for the solid
material (read only) Material The Material the solid has. This is only available if there is a ztf file for the model. If not null will be returned. If this is a PART_COMPOSITE then null will be returned. Part.GetCompositeData should be used to get material data in this case
model (read only) Model The Model that the solid is in
part (read only) Part The Part the solid is in
type (read only) constant The type for the solid (will be Type.SOLID)

Detailed Description

The Solid class allows you to inspect solid elements in a model. See the documentation below for more details.

Details of functions

Blank(window[GraphicsWindow])

Description

Blanks the solid in a graphics window

Arguments

  • window (GraphicsWindow)

    GraphicsWindow) to blank the solid in

    Returns

    No return value

    Example

    To blank solid s in graphics window g:

    s.Blank(g);


    BlankAll(window[GraphicsWindow], model[Model]) [static]

    Description

    Blanks all of the solids in the model

    Arguments

  • window (GraphicsWindow)

    GraphicsWindow) to blank the solids in

  • model (Model)

    Model that all the solids will be blanked in

    Returns

    No return value

    Example

    To blank all of the solids in model m, in graphics window gw:

    Solid.BlankAll(gw, m);


    BlankFlagged(window[GraphicsWindow], model[Model], flag[Flag]) [static]

    Description

    Blanks all of the solids in the model flagged with a defined flag

    Arguments

  • window (GraphicsWindow)

    GraphicsWindow) to blank the solids in

  • model (Model)

    Model that the flagged solids will be blanked in

  • flag (Flag)

    Flag (see AllocateFlag) set on the solids to blank

    Returns

    No return value

    Example

    To blank all of the solids flagged with flag f in model m, in graphics window gw:

    Solid.BlankFlagged(gw, m, f);


    Blanked(window[GraphicsWindow])

    Description

    Checks if the solid is blanked in a graphics window or not

    Arguments

  • window (GraphicsWindow)

    GraphicsWindow) in which to check if the solid is blanked

    Returns

    true if blanked, false if not

    Return type

    boolean

    Example

    To check if solid s is blanked in graphics window g:

    if (s.Blanked(g) ) do_something...


    ClearFlag(flag[Flag])

    Description

    Clears a flag on a solid

    Arguments

  • flag (Flag)

    Flag (see AllocateFlag) to clear on the solid

    Returns

    No return value

    Example

    To clear flag f on solid s:

    s.ClearFlag();


    Deleted()

    Description

    Checks if the solid has been deleted or not

    Arguments

    No arguments

    Returns

    true if deleted, false if not

    Return type

    boolean

    Example

    To check if solid s has been deleted:

    if (s.Deleted() ) do_something...


    First(model[Model]) [static]

    Description

    Returns the first solid in the model (or null if there are no solids in the model)

    Arguments

  • model (Model)

    Model to get first solid in

    Returns

    Solid object

    Return type

    Solid

    Example

    To get the first solid in model m:

    var s = Solid.First(m);


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

    Description

    Flags all of the solids in the model with a defined flag

    Arguments

  • model (Model)

    Model that all the solids will be flagged in

  • flag (Flag)

    Flag (see AllocateFlag) to set on the solids

    Returns

    No return value

    Example

    To flag all of the solids with flag f in model m:

    Solid.FlagAll(m, f);


    Flagged(flag[Flag])

    Description

    Checks if the solid is flagged or not

    Arguments

  • flag (Flag)

    Flag (see AllocateFlag) to test on the solid

    Returns

    true if flagged, false if not

    Return type

    boolean

    Example

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

    Arguments

  • model (Model)

    Model that all the solids are in

  • property (optional) (string)

    Name for property to get for all solids in the model

    Returns

    Array of Solid objects or properties

    Return type

    Array

    Example

    To get all of the solids in model m:

    var s = Solid.GetAll(m);

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

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


    GetData(component[constant], options (optional)[object])

    Description

    Returns the value for a data component.
    Also see GetMultipleData

    Arguments

  • component (constant)

    Component constant to get data for

  • options (optional) (object)

    Object containing options for getting data. Can be any of:

    Object has the following properties:

    Name Type Description
    extra integer The extra data component number if component Component.SOX for solids, Component.BMX for beams or Component.SHX for shells and thick shells
    ip integer Integration point number to get the data at (ip >= 1 or one of the constants Constant.TOP, Constant.MIDDLE or Constant.BOTTOM). If the integration point is not defined it will use the integration point defined on the current GUI "data" panel, which defaults to the middle surface for shells, thick shells, and solids, and Mag All for beams, but may vary if changed by an interactive user. If consistent output from a script is required, independent of any prior interactive activity, an explicit integration point or surface should be defined
    op integer On plane integration point number for shells and thick shells (op >= 1 [default])
    referenceFrame constant The frame of reference to return values in. Either Constant.GLOBAL (default), Constant.LOCAL, Constant.CYLINDRICAL, Constant.USER_DEFINED or Constant.MATERIAL. This is only necessary for directional components (eg X stress) and then only when something other than the default Constant.GLOBAL coordinate system is to be used
    user integer The user-defined component number if component Component.UNOS, Component.UNOV, Component.USSS, Component.USST, Component.UBMS or Component.UBMV

    Returns

    Number if a scalar component, array if a vector or tensor component (or null if the value cannot be calculated because it's not available in the model).
    If requesting an invalid component it will throw an error (e.g. Component.AREA of a node).

    Return type

    real|array

    Example

    To calculate a component and check it has been calculated (note that in the example, the argument extra is optional):

    var value = s.GetData(component, {extra: 1});
    if (value !== null) do_something...


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

    Description

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

    Arguments

  • model (Model)

    Model that the flagged solids are in

  • flag (Flag)

    Flag (see AllocateFlag) set on the solids to get

  • property (optional) (string)

    Name for property to get for all flagged solids in the model

    Returns

    Array of Solid objects or properties

    Return type

    Array

    Example

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

    Solid.GetFlagged(m, f);

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

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


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

    Description

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

    Arguments

  • model (Model)

    Model to get solid in

  • label (integer)

    The Ansys LS-DYNA label for the solid in the model

    Returns

    Solid object

    Return type

    Solid

    Example

    To get the solid in model m with label 1000:

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


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

    Description

    Returns the Solid object for solid in model with index (or null if it does not exist)

    Arguments

  • model (Model)

    Model to get solid in

  • index (integer)

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

    Returns

    Solid object

    Return type

    Solid

    Example

    To get the 51st solid in model m:

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


    GetMultipleData(component[constant], items[array], options (optional)[object]) [static]

    Description

    Returns the value for a data component for multiple solids. For each solid a local property called data will be created containing a number if a scalar component, or an array if a vector or tensor component (or null if the value cannot be calculated). The data is also returned as an object.
    Also see GetData

    Arguments

  • component (constant)

    Component constant to get data for

  • items (array)

    Array of Solid objects to get the data for. All of the solids must be in the same model.

  • options (optional) (object)

    Object containing options for getting data. Can be any of:

    Object has the following properties:

    Name Type Description
    extra integer The extra data component number if component Component.SOX for solids, Component.BMX for beams or Component.SHX for shells and thick shells
    ip integer Integration point number to get the data at (ip >= 1 or one of the constants Constant.TOP, Constant.MIDDLE or Constant.BOTTOM)
    op integer On plane integration point number for shells and thick shells (op >= 1 [default])
    referenceFrame constant The frame of reference to return values in. Either Constant.GLOBAL (default), Constant.LOCAL, Constant.CYLINDRICAL, Constant.USER_DEFINED or Constant.MATERIAL. This is only necessary for directional components (eg X stress) and then only when something other than the default Constant.GLOBAL coordinate system is to be used
    user integer The user-defined component number if component Component.UNOS, Component.UNOV, Component.USSS, Component.USST, Component.UBMS or Component.UBMV

    Returns

    Object containing the data. A property is created in the object for each solid with the label. The value of the property is a number if a scalar component or an array if a vector or tensor component (or null if the value cannot be calculated)

    Return type

    object

    Example

    To calculate a component for solids in array items and use the data property (note that in the example, the argument extra is optional):

    Solid.GetMultipleData(component, items, {extra: 1});
    for (i=0; i<items.length; i++)
    {
        if (items[i].data !== null) do_something...
    }

    To calculate a component for solids in array items and use the return value (note that in the example, the argument extra is optional):

    var data = Solid.GetMultipleData(component, items, {extra: 1});
    for (d in data)
    {
        Message("Label is " + d);
        if (data[d] !== null) do_something...
    }


    Last(model[Model]) [static]

    Description

    Returns the last solid in the model (or null if there are no solids in the model)

    Arguments

  • model (Model)

    Model to get last solid in

    Returns

    Solid object

    Return type

    Solid

    Example

    To get the last solid in model m:

    var s = Solid.Last(m);


    LocalAxes()

    Description

    Returns the local axes of the element in model space, expressed as direction cosines in a 2D array. Beam elements must have 3 nodes to be able to return local axes.

    Arguments

    No arguments

    Returns

    array of arrays

    Return type

    Array

    Example

    To get the local axes for solid s:

    var axes = s.LocalAxes();
    var xAxis = [ axes[0][0], axes[0][1], axes[0][2] ];
    var yAxis = [ axes[1][0], axes[1][1], axes[1][2] ];
    var zAxis = [ axes[2][0], axes[2][1], axes[2][2] ];


    Next()

    Description

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

    Arguments

    No arguments

    Returns

    Solid object

    Return type

    Solid

    Example

    To get the next solid after solid s:

    s = s.Next();


    Pick() [static]

    Description

    Allows the user to pick a solid from the screen

    Arguments

    No arguments

    Returns

    Solid object or null if cancelled

    Return type

    Solid

    Example

    To pick a solid:

    var s = Solid.Pick();


    PlasticStrain(options (optional)[object])

    Description

    Returns the effective plastic strain for the solid (or null if the value cannot be calculated)

    Arguments

  • options (optional) (object)

    Object containing options for getting data. Can be any of:

    Object has the following properties:

    Name Type Description
    ip integer Integration point number to get the data at (ip >= 1)

    Returns

    Plastic strain

    Return type

    real

    Example

    To return the effective plastic strain of solid s:

    var strain = s.PlasticStrain();
    if (strain !== null) do_something...


    Previous()

    Description

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

    Arguments

    No arguments

    Returns

    Solid object

    Return type

    Solid

    Example

    To get the previous solid before solid s:

    s = s.Previous();


    Select(flag[Flag]) [static]

    Description

    Selects solids using an object menu

    Arguments

  • flag (Flag)

    Flag (see AllocateFlag) to use when selecting solids

    Returns

    The number of solids selected or null if menu cancelled

    Return type

    integer

    Example

    To select solids, flagging those selected with flag f:

    var total = Solid.Select(f);


    SetFlag(flag[Flag])

    Description

    Sets a flag on a solid

    Arguments

  • flag (Flag)

    Flag (see AllocateFlag) to set on the solid

    Returns

    No return value

    Example

    To set flag f on solid s:

    s.SetFlag(f);


    StrainTensor(options (optional)[object])

    Description

    Returns the strain tensor for the solid

    Arguments

  • options (optional) (object)

    Object containing options for getting data. Can be any of:

    Object has the following properties:

    Name Type Description
    ip integer Integration point number to get the data at (ip >= 1)
    referenceFrame constant The frame of reference to return values in. Either Constant.GLOBAL (default), Constant.LOCAL, Constant.CYLINDRICAL, Constant.USER_DEFINED or Constant.MATERIAL

    Returns

    Array containing the strain tensor [Exx, Eyy, Ezz, Exy, Eyz, Ezx] (or null if the value cannot be calculated)

    Return type

    array

    Example

    To return the strain tensor of solid s:

    var tensor = s.StrainTensor();
    if (tensor !== null) do_something...


    StressTensor(options (optional)[object])

    Description

    Returns the stress tensor for the solid

    Arguments

  • options (optional) (object)

    Object containing options for getting data. Can be any of:

    Object has the following properties:

    Name Type Description
    ip integer Integration point number to get the data at (ip >= 1)
    referenceFrame constant The frame of reference to return values in. Either Constant.GLOBAL (default), Constant.LOCAL, Constant.CYLINDRICAL, Constant.USER_DEFINED or Constant.MATERIAL

    Returns

    Array containing the stress tensor [Exx, Eyy, Ezz, Exy, Eyz, Ezx] (or null if the value cannot be calculated)

    Return type

    array

    Example

    To return the stress tensor of solid s:

    var tensor = s.StressTensor();
    if (tensor !== null) do_something...


    Topology()

    Description

    Returns the topology for the solid in the model

    Arguments

    No arguments

    Returns

    array of Node objects

    Return type

    Array

    Example

    To get the topology for solid s:

    var topology = s.Topology();


    Total(model[Model]) [static]

    Description

    Returns the total number of solids in the model

    Arguments

  • model (Model)

    Model to get total in

    Returns

    The number of solids

    Return type

    integer

    Example

    To get the number of solids in model m:

    var total = Solid.Total(m);


    TotalDeleted(model[Model]) [static]

    Description

    Returns the total number of solids that have been deleted in a model in the state given by its state property

    Arguments

  • model (Model)

    Model to get total in

    Returns

    The number of solids that have been deleted

    Return type

    integer

    Example

    To get the number of solids in model m that have been deleted in state 10:

    m.state = 10;
    var total = Solid.TotalDeleted(m);


    Unblank(window[GraphicsWindow])

    Description

    Unblanks the solid in a graphics window

    Arguments

  • window (GraphicsWindow)

    GraphicsWindow) to unblank the solid in

    Returns

    No return value

    Example

    To unblank solid s in graphics window g:

    s.Unblank(g);


    UnblankAll(window[GraphicsWindow], model[Model]) [static]

    Description

    Unblanks all of the solids in the model

    Arguments

  • window (GraphicsWindow)

    GraphicsWindow) to unblank the solids in

  • model (Model)

    Model that all the solids will be unblanked in

    Returns

    No return value

    Example

    To unblank all of the solids in model m, in graphics window gw:

    Solid.UnblankAll(gw, m);


    UnblankFlagged(window[GraphicsWindow], model[Model], flag[Flag]) [static]

    Description

    Unblanks all of the solids in the model flagged with a defined flag

    Arguments

  • window (GraphicsWindow)

    GraphicsWindow) to unblank the solids in

  • model (Model)

    Model that the flagged solids will be unblanked in

  • flag (Flag)

    Flag (see AllocateFlag) set on the solids to unblank

    Returns

    No return value

    Example

    To unblank all of the solids flagged with flag f in model m, in graphics window gw:

    Solid.UnblankFlagged(gw, m, f);


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

    Description

    Unsets a defined flag on all of the solids in the model

    Arguments

  • model (Model)

    Model that the defined flag for all solids will be unset in

  • flag (Flag)

    Flag (see AllocateFlag) to unset on the solids

    Returns

    No return value

    Example

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

    Solid.UnflagAll(m, f);


    VonMisesStress(options (optional)[object])

    Description

    Returns the von Mises stress for the solid (or null if the value cannot be calculated)

    Arguments

  • options (optional) (object)

    Object containing options for getting data. Can be any of:

    Object has the following properties:

    Name Type Description
    ip integer Integration point number to get the data at (ip >= 1)

    Returns

    von Mises stress

    Return type

    real

    Example

    To return the von Mises stress of solid s:

    var svm = s.VonMisesStress();
    if (svm !== null) do_something...