Skip to main content
Version: V2 (Ignition 8.1)

system.mes.material.exportPropertiesAsCsv

Description

Exports all or selected material properties as raw bytes in CSV format (UTF-8 encoded). Streams material property data from the database and formats it as CSV, including a header row. When idsOrNames is omitted, all material properties are exported.

Permissions

This method requires the MATERIAL.READ.GET permission.

Syntax

system.mes.material.exportPropertiesAsCsv()
system.mes.material.exportPropertiesAsCsv(idsOrNames=["Density"])

Parameters

ParameterTypeNullableDescription
idsOrNamesString[]YesThe 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 CSV export.

Code Examples

Perspective

csvBytes = system.mes.material.exportPropertiesAsCsv()
system.perspective.download("material-properties.csv", csvBytes)

Script Console

csvBytes = system.mes.material.exportPropertiesAsCsv()
path = system.file.saveFile("material-properties.csv")
if path is not None:
system.file.writeFile(path, csvBytes)