Updating Engineering Materials
To update the attributes of an engineering material object, you must first check out the object.
You can update an engineering material object by specifying the object in the request URI.
Example: Updating a Specific Engineering Material Object
The following example shows you how to update an engineering material object specified in the request URI.
This example shows you how to update the TestSoftAttribute and Density attributes for the specified object.
Use the following PATCH URI with the request body.
URI
PATCH /Windchill/servlet/odata/Sustainability/EngineeringMaterials('OR:wt.part.WTPart:536532')
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"TestSoftAttribute": "testsoftattribute1_updated",
"Density": {
"Value": 3.00,
"Unit": "kg/m**3",
"Precision": 3
}
}
You can update one or more engineering materials in a single call.
Example: Updating Multiple Engineering Material Objects
The following example shows you how to update two engineering material objects specified in the request body.
This example shows you how to update the TestSoftAttribute and Density attributes corresponding to the two objects specified in the request body.
Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/Sustainability/UpdateEngineeringMaterials
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"EngineeringMaterials": [
{
"ID": "OR:wt.part.WTPart:623577",
"TestSoftAttribute": "softattribute1_updated",
"Density": {
"Value": 5,
"Unit": "kg/m**3",
"Precision": 3
}
},
{
"ID": "OR:wt.part.WTPart:623587",
"TestSoftAttribute": "softattribute2_updated",
"Density": {
"Value": 6,
"Unit": "kg/m**3",
"Precision": 3
}
}
]
}