Creating a Material Assignment Link
A material assignment link exists between an engineering material object and a related part.
You can create a material assignment link object by specifying an engineering material object in the request URI and the required and optional attributes in the request body. You can also create a material assignment link object by specifying an optional soft attribute in the request body.
* 
The attributes BuildStatus and RelatedPart are required attributes. To create a material assignment link, you must first check out the related part.
Example: Creating a Material Assignment Link
The following example shows you how to create a material assignment link object for an engineering material object by specifying the required attributes and a soft attribute along with the other optional attributes in the request body.
Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/Sustainability/EngineeringMaterials('OR:wt.part.WTPart:564491')/MaterialAssignmentLinks
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"TestSoftAttribute": "test attr1",
"BuildStatus": {
"Value": "to_be_synced"
},
"Mass": {
"Value": 1,
"Unit": "kg",
"Precision": 3
},
"SurfaceArea": {
"Value": 2,
"Unit": "m**2",
"Precision": 3
},
"Volume": {
"Value": 3,
"Unit": "m**3",
"Precision": 3
},
"[email protected]": "Parts('OR:wt.part.WTPart:468955')"
}
The request creates a material assignment link from the specified engineering material object to the specified related part, and returns the details of the link in the response.
The specified engineering material object is added to the Engineering Materials table available for the related part in Windchill.
这对您有帮助吗?