Retrieving Associations Between a Part and CAD Documents
You can retrieve associations between a part and CAD documents. Additionally, you can retrieve calculated associations between a part and CAD drawings.
* 
Calculated associations cannot be retrieved when the wt.epm.displayCalculatedLink property is set to false in Windchill.
The request returns the calculated associations based on the preferences configured in the system. For more information, see the Drawing-Part Relationships topic in the Windchill Help Center.
Example: Retrieving a CAD Document Associated to a Part
The following example demonstrates how to retrieve an owner association between the specified part and a CAD document. Use the following GET URI:
URI
GET /Windchill/servlet/odata/ProdMgmt/Parts('OR:wt.part.WTPart:918283')/PartDocAssociations?$expand=RelatedCADDoc($select=Identity)
Response
The response returns the owner association and related CAD document:
{
"@odata.context": "$metadata#PartDocAssociations",
"value": [
{
"ID": "OR:wt.epm.build.EPMBuildRule:2248022",
"AssociationType": {
"@odata.type": "#PTC.CADDocumentMgmt.AssociationTypeInfo",
"Value": "OWNER",
"Display": "Owner"
},
"RelatedCADDoc": {
"@odata.id": "http://<host>:<port>/Windchill/servlet/odata/v3/CADDocumentMgmt/CADDocuments('OR:wt.epm.EPMDocument:5161698')",
"ID": "OR:wt.epm.EPMDocument:5161698",
"Identity": "CAD Part - spring.prt, 4.1"
}
}
],
"@PTC.AppliedContainerContext.LocalTimeZone": "America/New_York"
}
Example: Retrieving Multiple CAD Documents Associated to a Part
The following example demonstrates how to retrieve multiple CAD documents associated to the specified part. In this example, three different CAD documents are associated to the specified part. Use the following GET URI:
URI
GET /Windchill/servlet/odata/ProdMgmt/Parts('OR:wt.part.WTPart:918283')/PartDocAssociations?$expand=RelatedCADDoc($select=Identity)
Response
The response returns three associations and the related CAD document for each association:
{
"@odata.context": "$metadata#PartDocAssociations",
"value": [
{
"ID": "OR:wt.epm.build.EPMBuildRule:5891443",
"AssociationType": {
"@odata.type": "#PTC.CADDocumentMgmt.AssociationTypeInfo",
"Value": "CONTRIBUTING_CONTENT",
"Display": "Owner"
},
"RelatedCADDoc": {
"@odata.id": "http://<host>:<port>/Windchill/servlet/odata/v3/CADDocumentMgmt/CADDocuments('OR:wt.epm.EPMDocument:5161698')",
"ID": "OR:wt.epm.EPMDocument:5161698",
"Identity": "CAD Part - spring_blue.prt, 2.1"
}
},
{
"ID": "OR:wt.epm.build.EPMBuildRule:2248022",
"AssociationType": {
"@odata.type": "#PTC.CADDocumentMgmt.AssociationTypeInfo",
"Value": "OWNER",
"Display": "Owner"
},
"RelatedCADDoc": {
"@odata.id": "http://<host>:<port>/Windchill/servlet/odata/v3/CADDocumentMgmt/CADDocuments('OR:wt.epm.EPMDocument:5161677')",
"ID": "OR:wt.epm.EPMDocument:5161677",
"Identity": "CAD Part - spring.prt, 4.1"
}
},
{
"ID": "OR:wt.epm.build.EPMDescribeLink:5891444",
"AssociationType": {
"@odata.type": "#PTC.CADDocumentMgmt.AssociationTypeInfo",
"Value": "CONTENT",
"Display": "Owner"
},
"RelatedCADDoc": {
"@odata.id": "http://<host>:<port>/Windchill/servlet/odata/v3/CADDocumentMgmt/CADDocuments('OR:wt.epm.EPMDocument:5161643')",
"ID": "OR:wt.epm.EPMDocument:5161643",
"Identity": "Drawing - spring.drw, 4.5"
}
}
],
"@PTC.AppliedContainerContext.LocalTimeZone": "America/New_York"
}
Example: Retrieving Calculated Associations Between a Part and CAD Drawings
The following example demonstrates how to retrieve calculated associations between the specified part and CAD drawings for the model with the Owner Only association type. In this example, the specified part has one calculated association with a CAD drawing. Use the following GET URI:
URI
GET /Windchill/servlet/odata/ProdMgmt/Parts('OR:wt.part.WTPart:216030')/PartDocAssociations
Response
{
"@odata.context": "$metadata#PartDocAssociations",
"value": [
{
"ID": "OR:wt.part.WTPart:216030_Calculated_OR:wt.epm.EPMDocument:215989",
"AssociationType": {
"@odata.type": "#PTC.CADDocumentMgmt.AssociationTypeInfo",
"Value": "CALCULATED",
"Display": "Calculated"
}
}
],
"@PTC.AppliedContainerContext.LocalTimeZone": "America/New_York"
}
Example: Retrieving a Specific Calculated Association Between a Part and a CAD Drawing
The following example demonstrates how to retrieve a specific calculated association by specifying the ID of the calculated link between the specific part and CAD drawing. This example demonstrates how to retrieve a specific calculated association for the model with the All Models association type. When the preference is set to All Models, it is common to have multiple calculated associations. Use the following GET URI:
URI
GET /Windchill/servlet/odata/ProdMgmt/Parts('OR:wt.part.WTPart:176002')/PartDocAssociations('OR:wt.part.WTPart:176002_Calculated_OR:wt.epm.EPMDocument:175876')/AssociationType
Response
The response returns the specified calculated association:
{
"@odata.context": "$metadata#PartDocAssociations",
"value": [
{
"ID": "OR:wt.part.WTPart:176002_Calculated_OR:wt.epm.EPMDocument:175876",
"AssociationType": {
"Value": "CALCULATED",
"Display": "Calculated"
}
}
],
"@PTC.AppliedContainerContext.LocalTimeZone": "America/New_York"
}
Example: Retrieving a Specific Calculated Association Along with the Related CAD Drawing
The following example demonstrates how to retrieve a specific calculated association by specifying the ID of the calculated link between the specified part and CAD drawing for the model with the Owner Only association type. The example also shows how to retrieve the related CAD drawing. Use the following GET URI with expand:
URI
GET /Windchill/servlet/odata/ProdMgmt/Parts('OR:wt.part.WTPart:176002')/PartDocAssociations('OR:wt.part.WTPart:176002_Calculated_OR:wt.epm.EPMDocument:175841')?$expand=RelatedCADDoc($select=Number,Name,FileName,Version)
Response
The response returns the specified calculated association and related CAD document:
{
"@odata.context": "$metadata#PartDocAssociations",
"value": [
{
"ID": "OR:wt.part.WTPart:176002_Calculated_OR:wt.epm.EPMDocument:175841",
"AssociationType": {
"Value": "CALCULATED",
"Display": "Calculated"
},
"RelatedCADDoc": {
"@odata.id": "http://<host>:<port>/Windchill/servlet/odata/v3/CADDocumentMgmt/CADDocuments('OR:wt.epm.EPMDocument:175841')",
"ID": "OR:wt.epm.EPMDocument:175841",
"FileName": "cad1.drw",
"Name": "cad1.drw",
"Number": "CAD1.DRW",
"Version": "A.1"
}
}
],
"@PTC.AppliedContainerContext.LocalTimeZone": "America/New_York"
}
これは役に立ちましたか?