Skip to main content
Version: V2 (Ignition 8.1)

system.mes.material.setPropertyValue

Description​

Updates the value of a Material Property Values record given a material ID or path and a property ID or name.

Permissions​

This method requires the MATERIAL.WRITE.SAVE permission.

Syntax​

system.mes.material.setPropertyValue(materialIdOrPath, propertyIdOrName, value)

Parameters​

ParameterTypeNullableDescription
materialIdOrPathStringFalseThe ULID or path of the material.
propertyIdOrNameStringFalseThe ULID or name of the property for which the value is retrieved.
valueMixedTrueThe value assigned to the property. The type is mixed as it depends on the data type of the property. May be None to clear the value, but only when the property definition is nullable; passing None for a non-nullable property raises an error.

Returns​

Returns a JSON representation of the updated material property value.

Code Examples​

# Update the value of a material property value
updatedPropertyValue = system.mes.material.setPropertyValue('IRB/5391537510212', 'Density', 200)

# Output the JSON representation of the updated material property value
print(updatedPropertyValue)

# Clear the value of a nullable property by passing None
system.mes.material.setPropertyValue('IRB/5391537510212', 'Density', None)