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