system.mes.material.exportMaterialClassesAsJson
Description
Exports all Material Classes as a JSON string (UTF-8 encoded). Streams material data from the database and formats it as a JSON string, including a header row.
Syntax
system.mes.material.exportMaterialClassesAsJson()
Parameters
Parameter | Type | Nullable | Description |
---|---|---|---|
None | - | - | This method does not take any parameters. |
Returns
All materials as a JSON string (UTF-8 encoded).
Code Examples
Perspective
jsonString = system.mes.material.exportMaterialClassesAsJson()
system.perspective.download("material_classes.json", jsonBytes)
Script Console
jsonString = system.mes.material.exportMaterialClassesAsJson()
path = system.file.saveFile("material_classes.json")
if path is not None:
system.file.writeFile(path, jsonString)