Moving the Association Between a Part and a CAD Document to a Different Revision
You can reassign an existing association between a part and a specific CAD document revision to a different revision of the same CAD document by specifying the OIDs of the attributes RelatedPart, SourceCADDoc, and RelatedCADDoc in the request body.
You can reassign one or more existing associations in a single call. To move an association, you must first check out the part.
Example: Moving the Association Between a Part and a CAD Document to a Different Revision
This example demonstrates how to move an owner association link that exists between a part and a specific CAD document to a different revision of the same CAD document.
In this example, consider that an association exists between Part1 and a CAD document CADDoc1 (A.1). Using this request, the existing association of Part1 is moved to a different revision of the same CAD document CADDoc1 (B.1) so that the association now exists between Part1 and CAD document CADDoc1 (B.1) instead.
Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/ProdMgmt/MoveAssociations?$expand=RelatedCADDoc
Request Header
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"MovePartDocAssociations": [
{
"[email protected]": "Parts('OR:wt.part.WTPart:204135')",
"[email protected]": "CADDocuments('OR:wt.epm.EPMDocument:204166')",
"[email protected]": "CADDocuments('OR:wt.epm.EPMDocument:204069')"
}
]
}
Example: Moving Multiple Associations Between Parts and CAD Documents
This example demonstrates how to move the owner association links between each of the two specified parts and their corresponding CAD document revisions to a different revision of the same CAD document, as specified for each part, in a single call.
In this example, consider that an association exists between Part2 and a CAD document CADDoc2 (A.2). Consider one more association existing between Part3 and a CAD document CADDoc3 (A.1).
Using this request, the association for both the parts is updated to be reassigned to a different revision of the same CAD document, as specified for each part, in a single call: Part2CADDoc2(B.1) and Part3CADDoc3 (B.1).
Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/ProdMgmt/MoveAssociations?$expand=RelatedCADDoc
Request Header
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"MovePartDocAssociations": [
{
"[email protected]": "Parts('OR:wt.part.WTPart:204260')",
"[email protected]": "CADDocuments('OR:wt.epm.EPMDocument:204416')",
"[email protected]": "CADDocuments('OR:wt.epm.EPMDocument:204209')"
},
{
"[email protected]": "Parts('OR:wt.part.WTPart:204373')",
"[email protected]": "CADDocuments('OR:wt.epm.EPMDocument:204394')",
"[email protected]": "CADDocuments('OR:wt.epm.EPMDocument:204313')"
}
]
}
這是否有幫助?