Data

Functions and constants relating to Data

Functions

Data constants

Constants for Frame of Reference

Name Description
CYLINDRICAL This constant is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Cylindrical coordinate system. Use Constant.CYLINDRICAL instead  [deprecated]
GLOBAL This constant is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Global coordinate system. Use Constant.GLOBAL instead  [deprecated]
LOCAL This constant is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Element local coordinate system. Use Constant.LOCAL instead  [deprecated]
MATERIAL This constant is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Material axes coordinate system. Use Constant.MATERIAL instead  [deprecated]
USER_DEFINED This constant is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
User-defined coordinate system. Use Constant.USER_DEFINED instead  [deprecated]

Constants for GetNumberOf

Name Description
CUT_SECTION This constant is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Number of non-parallel cut plane directions. Use Constant.CUT_SECTION instead  [deprecated]
FAMILY This constant is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Number of families. Use Constant.FAMILY instead  [deprecated]
GROUP This constant is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Number of groups. Use Type.GROUP instead  [deprecated]
INCLUDE This constant is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Number of includes. Use Constant.INCLUDE instead  [deprecated]
MODEL This constant is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Number of models. Use Type.MODEL instead  [deprecated]
NEIPH This constant is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Number of "Extra" Solid variables. Use Constant.NEIPH instead  [deprecated]
NEIPS This constant is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Number of "Extra" Shell variables. Use Constant.NEIPS instead  [deprecated]
NEIPT This constant is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Number of "Extra" Thick Shell variables. Use Constant.NEIPT instead  [deprecated]
NIP_B This constant is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Number of Beam integration points. Use Constant.NIP_B instead  [deprecated]
NIP_H This constant is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Number of Solid integration points. Use Constant.NIP_H instead  [deprecated]
NIP_S This constant is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Number of Shell integration points. Use Constant.NIP_S instead  [deprecated]
NIP_T This constant is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Number of Thick Shell integration points. Use Constant.NIP_T instead  [deprecated]
N_ON_PLAN This constant is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Number of on-plan integration points written. Use Constant.N_ON_PLAN instead  [deprecated]
N_UBMS This constant is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Number of user-defined beam scalar components. Use Constant.N_UBMS instead  [deprecated]
N_UBMV This constant is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Number of user-defined beam vector components. Use Constant.N_UBMV instead  [deprecated]
N_UNOS This constant is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Number of user-defined node scalar components. Use Constant.N_UNOS instead  [deprecated]
N_UNOV This constant is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Number of user-defined node vector components. Use Constant.N_UNOV instead  [deprecated]
N_USSS This constant is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Number of user-defined solid/shell scalar components. Use Constant.N_USSS instead  [deprecated]
N_USST This constant is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Number of user-defined solid/shell tensor components. Use Constant.N_USST instead  [deprecated]
STATE This constant is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Number of states. Use Constant.STATE instead  [deprecated]
USER This constant is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Number of user-defined components. Use Constant.USER instead  [deprecated]

Constants for Phase Angle Results

Name Description
CURRENT_VAL This constant is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Current value result. Use Constant.CURRENT_VAL instead  [deprecated]
MAGNITUDE This constant is deprecated in version 21.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Magnitude result. Use Constant.MAGNITUDE instead  [deprecated]

Details of functions

GetConditionParts(component[integer], value[real], mode[integer], int_pt (optional)[object | integer], extra (optional)[integer]) [static]

Description

Returns an object with all parts in current model filtered into two lists (pass_list and fail_list). Passing parts must have elements that pass the specified condition (indicated by <value> and <mode>) for the specified <component>.

NOTE: This function only works for scalar components. If <component> is a vector or tensor component, this function will return null.

Arguments

  • component (integer)

    A valid component code (e.g. Component.DX, Component.SXY)

  • value (real)

    A value to compare element data against.

  • mode (integer)

    Determines if condition is Constant.LT (<), Constant.LTEQ (<=), Constant.GT (>) or Constant.GTEQ (>=) than <value>.

  • int_pt (optional) (object) | integer

    This may be one of three types:

    1. A +ve integer that is an integration point id
    2. One of the types Constant.TOP, Constant.MIDDLE or Constant.BOTTOM for shell surfaces only
    3. An object defining both through-thickness and on-plan integration points for fully integrated shells.

    Integration points are only meaningful for some element type / data component combinations:

    This has become a complex data field, please see the separate section on Defining the Integration point argument below.

    Where the integration point is not relevant this argument may be omitted.

    If <int_pt> is not defined, this function will loop through all through thickness integration points for each element to check if the condition is fufilled.

    Use zero to define a null "padding" argument

    Object has the following properties:

    Name Type Description
    ip integer Through thickness integration point
    op (optional) integer On plan integration point. Defaults to the first one.

  • extra (optional) (integer)

    If any of the above component codes are used, the "extra" argument must be set to a non zero value.

    Returns

    Object with the following properties:

    Name Type Description
    fail_list array of integers List of failing parts (indices starting at 1)
    failed integer Number of failing parts
    pass_list array of integers List of passing parts (indices starting at 1)
    passed integer Number of passing parts

    Return type

    object

    Example

    // Does the filtering for the (scalar) X stress of part elements at integration point 2,
    // checking if they are greater than 0.1
    var a = GetConditionParts(Component.SXX, 0.1, Constant.GT, 2);
    
    // Does the filtering for the yield utilisation factor of part elements (looping through all
    // integration points), checking if they are greater than or equals to 1.0
    var b = GetConditionParts(Component.YUTF, 1.0, Constant.GTEQ);
    


    GetContourLimit(mode[integer], component (optional)[string]) [static]

    Description

    Returns the maximum/ minimum contour plot value of <component> specified for the current window. Returns null if <component> specified is not active.

    Arguments

  • mode (integer)

    Constant.MIN for minimum contour plot value, or Constant.MAX for maximum contour plot value.

  • component (optional) (string)

    Contour plot component: "SCALAR_1" for Scalar 1, "SCALAR_2" for Scalar 2, "VECTOR_1" or "VECTOR" for Vector, "VECTOR_2" or "VEL" for "Vel". If only 1 component is active, <component> is optional and min/max will be evaluated for the active component. If more than 1 component is active and <component> is not specified, min/max will be evaluated for Scalar 1.

    Returns

    real (or null if <component> specified is not active)

    Return type

    Number

    Example

    // Gets the minimum contour plot value for Scalar 1
    s1min = GetContourLimit(Constant.MIN, "SCALAR_1");
    
    // Gets the maximum contour plot value for Scalar 2
    s2max = GetContourLimit(Constant.MAX, "SCALAR_2");
    
    // Gets the minimum contour plot value for Vector
    v1min = GetContourLimit(Constant.MIN, "VECTOR_1");
    
    // Gets the maximum contour plot value for "Vel"
    v2max = GetContourLimit(Constant.MAX, "VECTOR_2");
    


    GetData(component[integer], type_code[integer], item[integer], int_pt (optional)[object | integer], extra (optional)[integer], fr_of_ref (optional)[integer], state_id (optional)[integer], dda (optional)[integer], consider_blanking (optional)[integer], mag_or_cur (optional)[integer]) [static]

    Description

    Returns the data for <component> of type <type_code> for the single <item>

    WARNING: If the function arguments are grammatically correct but the requested data component is not present in the database, then 1, 3 or 6 zeros are returned as required, and no warning message is output. Therefore it is good practice to use function QueryDataPresent() to check that an optional data component is actually present in a database before attempting to extract its values.

    NOTE: to return the same data for a range of items it will be much faster to call the GetMultipleData() variant of this function, described below.

    In other words instead of something like this, calling GetData()for each item individually:

    
    for(item=item_1; item<=item_2; item++)
    {
        result = GetData(component, type, item, ...);
    }
    
    

    You can write the following to extract data into an array of results using a single call to GetMultipleData():

    
    result = GetMultipleData(component, type, item_1, item_2, ...);
    
    

    This reduces the time taken to extract data by a factor nearly equal to #items, and for a large model this can give a dramatic speed increase.

    Arguments

  • component (integer)

    A valid component code (e.g. Component.DX, Component.SXY)

  • type_code (integer)

    A valid element type code (e.g. Type.SOLID, Type.SHELL)

  • item (integer)

    If +ve, the internal item number starting at 1. If -ve, the external label of the item. Internal numbers will be many times faster to process.

  • int_pt (optional) (object) | integer

    This may be one of three types:

    1. A +ve integer that is an integration point id
    2. One of the types Constant.TOP, Constant.MIDDLE or Constant.BOTTOM for shell surfaces only
    3. An object defining both through-thickness and on-plan integration points for fully integrated shells.

    Integration points are only meaningful for some element type / data component combinations:

    This has become a complex data field, please see the separate section on Defining the Integration point argument below.

    Where the integration point is not relevant this argument may be omitted. Use zero to define a null "padding" argument.

    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.

    Object has the following properties:

    Name Type Description
    ip integer Through thickness integration point
    op (optional) integer On plan integration point. Defaults to the first one.

  • extra (optional) (integer)

    If any of the above component codes are used, the "extra" argument must be set to a non zero value.

    Use zero to define a null "padding" argument if this is not required

  • fr_of_ref (optional) (integer)

    The frame of reference to return values in Constant.GLOBAL, Constant.LOCAL, Constant.CYLINDRICAL, Constant.USER_DEFINED, 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. If omitted, or set to zero, it defaults to Constant.GLOBAL for directional components and is ignore for all others.

  • state_id (optional) (integer)

    State number to be used instead of the current state

  • dda (optional) (integer)

    Direct Disk Access flag. Either Constant.OFF (default) for normal data cacheing or Constant.ON to enable direct disk reading of data.

    If turned on this reads data not currently in core memory directly from disk without loading the complete data vector for the state into core.

    This should be used if you want to extract results for a few items over a range of states, since it will potentially be faster.

  • consider_blanking (optional) (integer)

    Consider blanking flag. Either Constant.OFF (default) to ignore blanking or Constant.ON to consider blanking.

    This argument is relevant for nodal contact force results. By default the sum of all forces at a given node for all surfaces using that node will be returned. By blanking all but the contact surface(s) of interest and setting this argument to ON the results can be restricted to the contact surface(s) you want.

  • mag_or_cur (optional) (integer)

    Magnitude or Current Value flag. This argument is relevant for analyses with phase angle results.

    Set it to Constant.MAGNITUDE to output the magnitude

    Set it to Constant.CURRENT_VAL to output the current value [Magniude * cos(phase + phi)]. This is dependent on the current phi angle displayed in the graphics window and can be set using SetWindowFrame(). See example below.

    If omitted, or set to zero, it defaults to Constant.MAGNITUDE.

    Returns

    real|Array of reals

    Return type

    Number

    Example

    // Returns the (scalar) X stress of internal shell #27 at integration point 2, in the element local coordinate system.
    var a = GetData(Component.SXX, Type.SHELL, 27, 2, 0, Constant.LOCAL);
    
    // Returns the (scalar) X stress of the shell with external label 123 with the same options.
    var a = GetData(Component.SXX, Type.SHELL, -123, 2, 0, Constant.LOCAL);
    
    // Returns an array[6] of the strain tensor in solid element#93, implicitly in the global coordinate system.
    var b = GetData(Component.ETEN, Type.SOLID, 93);
    var sxx = b[Constant.XX];
    var sxy = b[Constant.XY];
    
    // Returns an array[3] of the 2nd user-defined Nodal Vector component at internal node #inode at state #3.
    var c = GetData(Component.UNOV, Type.NODE, inode,0, 2, 0, 3);
    var vx = c[Constant.X];
    var vy = c[Constant.Y];
    var vz = c[Constant.Z];
    
    // For an anlysis with phase angles returns the DZ displacement of internal node #1 at the second frame of state 3.
    // (Note that the state has to be set with both SetCurrentState() and a DialogueInput() command to get CURRENT_VAL
    // to work as this works off the current settings in the graphics window and SetCurrentState() does not update the
    // graphics window, it is only used internally by the Javascript interface).
    SetCurrentState(3);
    DialogueInput("/STATE 3");
    SetWindowFrame(1, 2);
    var a = GetData(Componnent.DZ, Type.NODE, 1, 0, 0, 0, 0, Constant.OFF, Constant.OFF, Constant.CURRENT_VAL);
    


    GetMultipleData(component[integer], type_code[integer], item_1[integer], item_2[integer], int_pt (optional)[object | integer], extra (optional)[integer], fr_of_ref (optional)[integer], state_id (optional)[integer], dda (optional)[integer], consider_blanking (optional)[integer], mag_or_cur (optional)[integer]) [static]

    Description

    Returns the data for <component> of type <type_code> for the range of items <item1 .. item2>

    WARNING #1: If the function arguments are grammatically correct but the requested data component is not present in the database, then 1, 3 or 6 zeros are returned as required, and no warning message is output. Therefore it is good practice to use function QueryDataPresent() to check that an optional data component is actually present in a database before attempting to extract its values.

    WARNING #2: It is possible to extract vary large quantities of data using a single call of this function. Bear in mind that JavaScript representations of values are quite bloated, for example all "numbers"are 64 bit (8 byte) floating double format, and the language imposes further overheads because of the way it organises data. For large models it may be necessary to extract large blocks of data in several smaller chunks, rather than one big one.

    WARNING #3: The data return value from this function is an array of length #rows, and the subscripts of this array start at row 0. In other words the result for item_1 in the call below will be returned in results array row data[0]. When extracting results for all items of a type, for example all shells in a model, item_1 will typically be 1, and it is easy to make the mistake of expecting this to be in results array row data[1]. In addition when you extract data for vector or tensor data the result will be a two-dimensional array, aligned data[#cols][#rows]. See the examples at the bottom of this description for more information about using two-dimensional arrays.

    Arguments

  • component (integer)

    A valid component code (e.g. Component.DX, Component.SXY)

  • type_code (integer)

    A valid element type code (e.g. Type.SOLID, Type.SHELL)

  • item_1 (integer)

    If +ve, the internal item number starting at 1. If -ve, the external label of the item. Internal numbers will be many times faster to process.

  • item_2 (integer)

    If +ve, the internal item number starting at 1. If -ve, the external label of the item. Must have the same sign as item_1, so both must be +ve or -ve. It is legal for it to be the same as item_1, in which case only values for a single item will be extracted.

  • int_pt (optional) (object) | integer

    This may be one of three types:

    1. A +ve integer that is an integration point id
    2. One of the types Constant.TOP, Constant.MIDDLE or Constant.BOTTOM for shell surfaces only
    3. An object defining both through-thickness and on-plan integration points for fully integrated shells.

    Integration points are only meaningful for some element type / data component combinations:

    This has become a complex data field, please see the separate section on Defining the Integration point argument below.

    Where the integration point is not relevant this argument may be omitted. Use zero to define a null "padding" argument.

    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.

    Object has the following properties:

    Name Type Description
    ip integer Through thickness integration point
    op (optional) integer On plan integration point. Defaults to the first one.

  • extra (optional) (integer)

    If any of the above component codes are used, the "extra" argument must be set to a non zero value.

    Use zero to define a null "padding" argument if this is not required

  • fr_of_ref (optional) (integer)

    The frame of reference to return values in Constant.GLOBAL, Constant.LOCAL, Constant.CYLINDRICAL, Constant.USER_DEFINED, 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. If omitted, or set to zero, it defaults to Constant.GLOBAL for directional components and is ignore for all others.

  • state_id (optional) (integer)

    State number to be used instead of the current state

  • dda (optional) (integer)

    Direct Disk Access flag. Either Constant.OFF (default) for normal data cacheing or Constant.ON to enable direct disk reading of data.
    If turned on this reads data not currently in core memory directly from disk without loading the complete data vector for the state into core.
    This should be used if you want to extract results for a few items over a range of states, since it will potentially be faster.

  • consider_blanking (optional) (integer)

    Consider blanking flag. Either Constant.OFF (default) to ignore blanking or Constant.ON to consider blanking.

    This argument is relevant for nodal contact force results. By default the sum of all forces at a given node for all surfaces using that node will be returned. By blanking all but the contact surface(s) of interest and setting this argument to ON the results can be restricted to the contact surface(s) you want.

  • mag_or_cur (optional) (integer)

    Magnitude or Current Value flag. This argument is relevant for analyses with phase angle results.
    Set it to Constant.MAGNITUDE to output the magnitude
    Set it to Constant.CURRENT_VAL to output the current value [Magniude * cos(phase + phi)]. This is dependent on the current phi angle displayed in the graphics window and can be set using SetWindowFrame(). See example below.

    If omitted, or set to zero, it defaults to MAGNITUDE.

    Returns

    Object with the following properties:

    Name Type Description
    data array of reals
    • data[#rows] for data components that return a scalar value, eg DX
    • data[#cols][#rows] for data components that return a vector or tensor value, eg UNOV

    Take care when dealing with the two-dimensional array of results returned by the vector and tensor component cases, as the order in which the data is stored is [column][row]. For example if you have a tensor component then in order to extract the XY shear term for index you need to write:

    
    r = GetMultipleData(args...)
    
    shear_term = r.data[Constant.XY][index];
    
    

    Also remember that the rows in this array start at index 0, thus the results for item_1 will be row index [0] in the array of results returned, and so on.

    nc integer The number of columns of data. 1 for scalar components, 3 for vector, 6 for tensor
    nr integer The number of rows of data, ie how many items processed in the range <item_1 .. item_2>

    Return type

    object

    Example

    // Returns the (scalar) X stress of internal shells #1 to #100 inclusive at integration
    // point 2, in the element local coordinate system
    a = GetMultipleData(Component.SXX, Type.SHELL, 1, 100, 2, 0, Constant.LOCAL);
    sxx = a.data[0];  // X stress in first shell
    sxx = a.data[99]; // X stress in 100th shell
    
    // Returns an array[6] of the strain tensor in solid elements #1 to #100, implicitly in the
    // global coordinate system.
    b = GetMultipleData(Component.ETEN, Type.SOLID, 1, 100);
    sxx = b.data[Constant.XX][0];  // X strain in 1st solid
    sxy = b.data[Constant.XY][99]; // XY strain in 100th solid
    
    // Returns an array[3] of the 2nd user-defined Nodal Vector component at nodes with external
    // labels 1 to 100 at state #3.
    // Note that when a range of external labels is supplied, ie -ve values for <item_1> and <item_2>,
    // you should check the .nr return value to see how many rows of results were actually returned, since
    // if there are gaps in that label range the result may not be |item_2| - |item_1| + 1.
    
    c = GetMultipleData(Component.UNOV, Type.NODE, -1, -100, 0, 2, 0, 3);
    
    nres = c.nr; // Number of rows of data returned
    vx = c.data[Constant.X][0]; // X component for 1st node
    vy = c.data[Constant.Y][1]; // Y component for 2nd node
    vz = c.data[Constant.Z][2]; // Z component for 3rd node
    


    GetNumOnPlanIntPts(type_code[integer], item[integer], state_id (optional)[integer]) [static]

    Description

    Returns the number of on plan points in an element in the current model

    Arguments

  • type_code (integer)

    A type code (either Type.SHELL or Type.TSHELL)

  • item (integer)

    If +ve, the internal item number starting at 1. If -ve, the external label of the item.

  • state_id (optional) (integer)

    The state to use instead of the current state. Only necessary in adaptively remeshed analyses.

    Returns

    integer

    Return type

    Number

    Example

    // Return the number of on plan points in the first SHELL element in the current model
    var a = GetNumOfPlanIntPts(Type.SHELL, 1);
    


    GetNumberOf(type_code[integer], options (optional)[object]) [static]

    Description

    Returns the number of items of type_code in the current model

    Note that in adaptively remeshed models the current family may affect the number of nodes and elements returned. The family of the current state will be used unless you supply the optional state_id argument, in which case the family of that state will be used.

    Notes:

    The number of models returned by GetNumberOf(Type.MODEL) is actually the number of active and inactive model "slots" in the database, including those currently not in use. This means that it will always return the highest model number that has been used to date.

    Therefore the following sequence:

    • Read in (say) three models M1 to M3
    • Delete models M1 and M2, leaving only M3 in use

    Will result in GetNumberOf(Type.MODEL) returning the value 3.

    You can use SetCurrentModel(model_id) to attempt to set a model and examine its return value to see whether it succeeded or failed:

    
    n = GetNumberOf(Type.MODEL);
    
    for(i=1; i<=n; i++)
    {
        if(SetCurrentModel(i))  // TRUE if present
        {
            do something
        }
    }
    

    Arguments

  • type_code (integer)

    A valid type code or a 'GetNumberOf' constant

  • options (optional) (object)

    Object has the following properties:

    Name Type Description
    state_id (optional) integer The state to use instead of the current state. Only necessary in adaptively remeshed analyses.

    Returns

    integer

    Return type

    Number

    Example

    // Return the number of models
    var a = GetNumberOf(Type.MODEL);
    
    // Return the number of shell integration points
    var a = GetNumberOf(Constant.NIP_S);
    
    // Return the number of solid elements in family of state 20
    var a = GetNumberOf(Type.SOLID, { state_id:20 });
    


    GetNumberOf(type_code[integer], state_id (optional)[integer]) [static]  [deprecated]

    This function is deprecated in version 19.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.

    Description

    Returns the number of items of type_code in the current model

    Also see the notes at the non-deprecated function with the same name.

    Arguments

  • type_code (integer)

    A valid type code or a 'GetNumberOf' constant

  • state_id (optional) (integer)

    The state to use instead of the current state. Only necessary in adaptively remeshed analyses.

    Returns

    integer

    Return type

    Number

    Example

    // Return the number of models
    var a = GetNumberOf(Type.MODEL);
    
    // Return the number of shell integration points
    var a = GetNumberOf(Constant.NIP_S);
    
    // Return the number of solid elements in family of state 20
    var a = GetNumberOf(Type.SOLID, 20);
    


    QueryDataPresent(component[integer], type_code (optional)[integer]) [static]

    Description

    Returns true if data <component> is present in the current model's database, otherwise false. For some data components that are switchable the <type_code> must also be supplied, these are listed below.

    Arguments

  • component (integer)

    A valid component code (e.g. Component.DX, Component.SXY)

  • type_code (optional) (integer)

    One of the type codes Type.SOLID, Type.SHELL or Type.TSHELL if the component is:

    Returns

    boolean

    Return type

    Boolean

    Example

    // Returns true if Effective Plastic Strain exists for solid
    var a = QueryDataPresent(Component.EPL, Type.SOLID);
    
    // Returns true if nodal temperatures exist
    var a = QueryDataPresent(Component.TEMP);