Functions and constants relating to Data
| 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] |
| 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] |
| 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] |
A valid component code (e.g. Component.DX, Component.SXY)
A value to compare element data against.
Determines if condition is Constant.LT (<), Constant.LTEQ (<=), Constant.GT (>) or Constant.GTEQ (>=) than <value>.
This may be one of three types:
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. |
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 |
object
Constant.MIN for minimum contour plot value, or Constant.MAX for maximum contour plot value.
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.
Returnsreal (or null if <component> specified is not active) Return typeNumber |
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. |
A valid component code (e.g. Component.DX, Component.SXY)
A valid element type code (e.g. Type.SOLID, Type.SHELL)
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.
This may be one of three types:
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. |
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 requiredThe 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 number to be used instead of the current state
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 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.
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.
Returnsreal|Array of reals Return typeNumber |
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. |
A valid component code (e.g. Component.DX, Component.SXY)
A valid element type code (e.g. Type.SOLID, Type.SHELL)
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.
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.
This may be one of three types:
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. |
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 requiredThe 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 number to be used instead of the current state
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 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.
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 |
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> |
object
GetNumOnPlanIntPts(type_code[integer], item[integer], state_id (optional)[integer]) [static]DescriptionReturns the number of on plan points in an element in the current model |
A type code (either Type.SHELL or Type.TSHELL)
If +ve, the internal item number starting at 1. If -ve, the external label of the item.
The state to use instead of the current state. Only necessary in adaptively remeshed analyses.
Returnsinteger Return typeNumber |
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:
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
}
}
|
A valid type code or a 'GetNumberOf' constant
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. |
Returnsinteger Return typeNumber |
A valid type code or a 'GetNumberOf' constant
The state to use instead of the current state. Only necessary in adaptively remeshed analyses.
Returnsinteger Return typeNumber |
A valid component code (e.g. Component.DX, Component.SXY)
One of the type codes Type.SOLID, Type.SHELL or Type.TSHELL if the component is:
Returnsboolean Return typeBoolean |