Skip to main content

system.mes.material.newMaterialClass

Generates an empty non-persisted Material Classes object to provide the structure required by the API to save a new record into the database. This method must be combined with the saveMaterialClass method in order to persist the record.

Syntax

system.mes.material.newMaterialClass()

Parameters

ParameterTypeDescription
None-This method does not take any parameters.

Returns

Returns a JSON representation of the newly created material class object. The following is a list of keys and default values:

KeyDefault Value
namenull
descriptionnull
pathnull
parentIdnull
idnull
notesnull
enabledtrue
spare1null
spare2null
spare3null

Code Examples

# Generate the object structure for a new material class object with no initial arguments
new_material_class = system.mes.material.newMaterialClass()

# Set basic attributes for the new material class
new_material_class['name'] = 'RAW'
# (You can continue setting other properties as needed here)

# Save the new material class to the system
saved_material_class = system.mes.material.saveMaterialClass(**new_material_class)

# Output the JSON representation of the saved material class
print(saved_material_class)