JSON syntax
Model object - JSON syntax
The REXS model is contained in a JSON object called "model," which includes a row of name-value pairs. In addition to the metadata ("version," "applicationId," "applicationVersion," "date," "applicationLanguage"), the "model" object contains the "relations" and "components" arrays, as well as a "load_spectrum" object if applicable.
Example model REXS file | JSON syntax
{"model": { "version": "1.4", "applicationId":"FVA-Workbench", "applicationVersion":"7.0.0", "date":"2021-11-03T11:35:17+01:00", "applicationLanguage":"en", "relations": [...], "components": [...], "load_spectrum": {...} (optional) } }
Components - JSON syntax
The "components" array contains a list of JSON objects. Each of these objects includes the name-value pairs "id" (ID of the component), "name" (component name), "type" (component type), as well as the "attributes" array.
Example components | JSON syntax
"components":[ {"id":4, "type"="cylindrical_gear", "name":"Pinion", "attributes": [ {"id": "attr1", "boolean": false}, {"id": "attr2", "unit": "none", "floating_point": 0.1}, ... ] }, {"id":6, "type"="cylindrical_gear", "name":"Wheel", "attributes": [ ... ] } ]
Attribute values - JSON syntax
The "attributes" array contains a list of objects with the following name-value pairs: "id" (attribute ID), "unit" (unit, required for certain data types), as well as the attribute value. Different identifiers are used to enable JSON validation, depending on the data type. The available identifiers are listed below. For details on binary-coded arrays and matrices, see Note and Note.
Data type | Details | JSON identifier | Example JSON value |
---|---|---|---|
scalar | Scalar values | ||
boolean | true, false | boolean | false |
string | string | "NU 206" | |
integer | integer | 3 | |
floating_point | The floating-point symbol is "." (period). Maximum number of significant digits: 15 | floating_point | 2.0 |
enum | Has a specified value range | enum | "both_directions" |
reference_component | ID of the reference component for specification of the position and orientation (POSE) | reference_component | 1 |
file_reference | Reference to a file or folder (relative or absolute) | file_reference | "example.gde" |
array | One-dimensional array of values | ||
floating_point_array | The floating-point symbol is "." (period). Maximum number of significant digits: 15 | floating_point_array | [1.0,0.0,0.0] |
floating_point_array | In binary format | floating_point_array_coded | {"code": "float64", "value": "62wRNhgQS0AAAAAAAAAAANgPsyG1MXDA"}} |
integer_array | integer_array | [1,2,3] | |
boolean_array | boolean_array | [true,false,true] | |
string_array | string_array | ["example 1","example 2"] | |
enum_array | The enum_array data type is new. Array of enum values | enum_array | ["quad4","triangle3","quad4"] |
matrix | Two-dimensional array of values, where each row has the same length | ||
floating_point_matrix | The floating-point symbol is "." (period). Maximum number of significant digits: 15 | floating_point_matrix | [[1.0,0.0,0.0],[0.0,1.0,0.0],[0.0,0.0,1.0]] |
floating_point_matrix | In binary format | floating_point_matrix_coded | {"code": "float64", "rows":2, "columns":3 "value": "AAAAAAAA8D8AAAAAAAAQQAAAAAAAAABAAAAAAAAAFEAAAAAAAAAIQAAAAAAAABhA"}} |
integer_matrix | integer_matrix | [[1,0,0],[0,1,0],[0,0,1]] | |
boolean_matrix | boolean_matrix | [[true,false,true],[false,false,true],[true,false,false]] | |
string_matrix | string_matrix | [["example 1","example 2"],["example 3","example 4"]] | |
array_of_arrays | Two-dimensional array of values, where the rows can have different lengths | ||
array_of_integer_arrays | array_of_integer_arrays | [[1,2,3,4],[1,3,4,5,6],[7,9,11]] |
Example attribute list | JSON syntax
"attributes":[ {"id": "name", "string": "30203-A"}, {"id": "normal_module", "unit": "mm", "floating_point": 2.0}, {"id": "addendum_modification_coefficient", "unit": "none", "floating_point": 0.1}, {"id": "number_of_gears", "integer": 3}, {"id": "is_driving_gear", "boolean": false}, {"id": "axial_force_absorption", "enum": "both_directions" }, {"id": "u_axis_vector", "unit": "mm","floating_point_array": [1.0,0.0,0.0]}, {"id": "matrix_correction", "unit": "mm", "floating_point_matrix": [[1.0,0.0,0.0],[0.0,1.0,0.0],[0.0,0.0,1.0]] }, {"id": "example_array_coded", "unit": "mm", "floating_point_array_coded": {"code": "float64", "value": "62wRNhgQS0AAAAAAAAAAANgPsyG1MXDA"}}, {"id": "example_matrix_coded", "unit": "mm", "floating_point_matrix_coded": {"code": "float64", columns="3", rows="2", "value": "AAAAAAAA8D8AAAAAAAAQQAAAAAAAAABAAAAAAAAAFEAAAAAAAAAIQAAAAAAAABhA62wRNhgQS0AAAAAAAAAAANgPsyG1MXDA"}}, {"id": "element_structure", "array_of_integer_arrays": [[108,2,1,107,7],[0,1,0],[0,7,0,1]]}, ]
Relations - JSON syntax
The "relations" array contains a list of JSON objects. Each of these objects includes the name-value pairs "id" (ID of the relation), "type" (type of relation), "order" (for relevant relation types), and the "refs" array. The "refs" array contains a list of objects with the name-value pairs "role" (role of the component in the relation), "id" (ID of the component in the relation), "hint" (optional addition for improved clarity).
Example REXS file relations | JSON syntax
"relations": [ {"id":15, "type":"ordered_assembly", "order":1, "refs": [ {"id":8, "role":"assembly", "hint":"bearing"}, {"id":16, "role":"part", "hint":"bearing_row"} ] }, {"id":23, "type":"stage", "refs": [ {"id":3, "role":"stage", "hint":"cylindrical_stage"}, {"id":7, "role":"gear_1", "hint":"cylindrical_gear"}, {"id":9, "role":"gear_2", "hint":"cylindrical_gear"} ] }, ]
"load_spectrum" object - JSON syntax
The "load_spectrum" object includes the name-value pairs "id" (ID of the load spectrum), "accumulation" (sub-model for accumulated values of the spectrum), and the "load_cases" array. The "accumulation" object contains a "components" array. The "load_cases" array contains a list of JSON objects, each of which includes both an "id" and a "components" array.
Example load spectrum | JSON syntax
"load_spectrum": { "id": 1, "load_cases": [ { "id": 1, "components": [ { "id": 1, "attributes": [...]}, { ... }, ... ] }, { "id": 2, "components": [ { "id": 2, "attributes": [...]}, { ... }, ... ] }, ... ] "accumulation": { "components": [ { "id": 2, "attributes": [...]}, { ... }, ... ] } }
Example model - JSON syntax
Example model | JSON syntax
{ "model": { "applicationId": "Bearinx", "applicationVersion": "12.0.8823", "date": "2021-07-01T12:18:38+01:00", "version": "1.3", "relations": [ { "id": 48, "type": "assembly", "refs": [ {"hint": "gear_unit","id": 1,"role": "assembly"}, {"hint": "gear_casing","id": 2,"role": "part"} ] }, { "id": 49, "type": "side", "refs": [ {"hint": "concept_bearing","id": 40,"role": "assembly"}, {"hint": "shaft","id": 13,"role": "inner_part"}, {"hint": "gear_casing","id": 2,"role": "outer_part"} ] } ... ] "components": [ { "id": 1, "name": "Transmission unit", "type": "gear_unit", "attributes": [ {"id": "example_string", "string": "30203-A"}, {"id": "example_floating_point_unit", "unit": "mm", "floating_point": 2.0}, {"id": "example_floating_point_without_unit", "unit": "none", "floating_point": 0.1}, {"id": "example_integer", "integer": 3}, {"id": "example_boolean", "boolean": false}, {"id": "example_enum", "enum": "both_directions" }, {"id": "example_floating_point_array", "unit": "mm","floating_point_array": [1.0,0.0,0.0]}, {"id": "example_floating_point_matrix", "unit": "mm", "floating_point_matrix": [[1.0,0.0,0.0], [0.0,1.0,0.0], [0.0,0.0,1.0]] }, {"id": "example_array_coded", "unit": "mm", "floating_point_array_coded": {"code": "float64", "value": "62wRNhgQS0AAAAAAAAAAANgPsyG1MXDA"}}, {"id": "example_array_of_arrays", "array_of_integer_arrays": [[108,2,1,107,7],[0,1,0],[0,7,0,1]]}, ] } { "id": 2, "name": "Input shaft", "type": "shaft", "attributes": [ ... ] } ... ] "load_spectrum": { "id": 1, "load_cases": [ { "id": 2, "components": [ { "id": 2, "attributes": [ ... ] }, { ... }, ... ] }, { ... } ] "accumulation": { "components": [ { "id": 2, "attributes": [ ... ] }, { ... }, ... ] } } } }