system.mes.material.exportPropertiesAsJson
Description
Exports all or selected material properties as raw bytes in JSON format (UTF-8 encoded).
Streams material property data from the database and formats it as JSON.
When idsOrNames is omitted, all material properties are exported.
Permissions
This method requires the MATERIAL.READ.GET permission.
Syntax
system.mes.material.exportPropertiesAsJson()
system.mes.material.exportPropertiesAsJson(idsOrNames=["Density"])
Parameters
| Parameter | Type | Nullable | Description |
|---|---|---|---|
idsOrNames | String[] | Yes | The ids or names of the material properties to export. Omit to export all. |
Returns
A byte array (byte[]) containing the raw byte data of the JSON export.
Code Examples
Perspective
jsonBytes = system.mes.material.exportPropertiesAsJson()
system.perspective.download("material-properties.json", jsonBytes)
Script Console
jsonBytes = system.mes.material.exportPropertiesAsJson()
path = system.file.saveFile("material-properties.json")
if path is not None:
system.file.writeFile(path, jsonBytes)