Models

Functions and constants relating to Models

Functions

Details of functions

GetModelInfo(model_id (optional)[integer], family_id (optional)[integer]) [static]

Description

Returns information about filenames in the current model, or in model_id if specified. It is an error to define model_id that is not currently in use.

Notes

The vast majority of analyses do not use adaptive remeshing and the family_id argument can be ignored. When it is given:

Family id 0 is the base analysis

Family id 1 is the first remesh, ie name_aa

... and so on

Arguments

  • model_id (optional) (integer)

    Model number. The current model is used if unspecified or zero

  • family_id (optional) (integer)

    Family number (starting from zero). The family number of an adaptive remesh analysis

    Returns

    Object with the following properties:

    Name Type Description
    ctf_name string the full name, including the pathname, of the contact force CTF file (intfor)
    num_families integer the number of adaptive remesh families in the file sequence. Will be one for a normal non-adaptive analysis
    num_states integer the number of complete states in the file sequence
    op2_name string the full name, including the pathname, of the Nastran OP2 file
    pp_name string the full name, including the pathname, of the LS-PREPOST database file
    ptf_name string the full name, including the pathname, of the complete state PTF/d3plot file
    xtf_name string the full name, including the pathname, of the extra database XTF file
    ztf_name string the full name, including the pathname, of the extra database ZTF file

    Return type

    object

    Example

    // Print the name of the PTF (d3plot) file of the current model and the number of states
    var info = GetModelInfo();
    Print("PTF filename = " + info.ptf_name + "\n");
    Print("Number of states = " + info.num_states + "\n");
    
    // Print the name of the 3rd adaptive remesh PTF file in model 2
    var info = GetModelInfo(2, 3);
    Print("PTF filename = " + info.ptf_name + "\n");
    


    ModelExists(model_id[integer]) [static]

    Description

    Checks whether a model exists in the database

    Arguments

  • model_id (integer)

    Model number to check

    Returns

    boolean

    Return type

    Boolean

    Example

    // Check if model #2 exists
    ModelExists(2);
    


    SetCurrentModel(model_id[integer]) [static]

    Description

    Sets the current model in the JavaScript interface to model_id

    At the start of script execution the current model is automatically set to the first active model in the database

    Arguments

  • model_id (integer)

    Model number to be made current

    Returns

    boolean

    Return type

    Boolean

    Example

    // Make model #2 current
    SetCurrentModel(2);