Retrieving the CAD Document Structure
This example shows you how to retrieve a CAD Document structure using expand on components. In this example, the CAD document specified in the request URI has child components. The value of HasUnresolvedObjectsByAccessRights is true for the TOP_CADDOC CAD document specified in the request URI.
Consider that the user does not have access to the CHILD1_A component which has another child component CHILD1_A1 under it. The value of Resolved is false for CHILD1_A1. The value of HasChildren is true for all the components except for CHILD1_A1 as it is unresolved.
The value of HasChildrenfor CHILD2 structure is false as it does not have child components under it.
Use the following POST request.
URI
POST /Windchill/servlet/odata/CADDocumentMgmt/CADDocuments('OR:wt.epm.EPMDocument:196704')/PTC.CADDocumentMgmt.GetStructure?$expand=Components($levels=max)
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{}
Response
{
"@odata.context": "$metadata#CADStructures",
"CADDocumentID": "OR:wt.epm.EPMDocument:196704",
"HasChildren": true,
"CADDocumentUseID": null,
"CADDocumentName": "top_caddoc.asm",
"CADDocumentNumber": "TOP_CADDOC.ASM",
"CADDocumentFileName": "top_caddoc.asm",
"Resolved": true,
"HasUnresolvedObjectsByAccessRights": true,
"PVTreeId": "/",
"PVParentTreeId": null,
"@PTC.AppliedContainerContext.LocalTimeZone": "Asia/Kolkata",
"Components": [
{
"HasChildren": true,
"CADDocumentName": "child1.asm",
"CADDocumentNumber": "CHILD1.ASM",
"Resolved": true,
"HasUnresolvedObjectsByAccessRights": null,
"CADDocument": {
"@odata.id": "http://<host>:<port>/Windchill/servlet/odata/v2/CADDocumentMgmt/CADDocuments('OR:wt.epm.EPMDocument:195957')",
"ID": "OR:wt.epm.EPMDocument:195957",
"Name": "child1.asm",
"Number": "CHILD1.ASM"
},
"Components": [
{
"HasChildren": true,
"CADDocumentName": "child1_A.asm",
"CADDocumentNumber": "CHILD1_A.ASM",
"Resolved": true,
"HasUnresolvedObjectsByAccessRights": null,
"CADDocument": {
"@odata.id": "http://<host>:<port>/Windchill/servlet/odata/v2/CADDocumentMgmt/CADDocuments('OR:wt.epm.EPMDocument:196723')",
"ID": "OR:wt.epm.EPMDocument:196723",
"Name": "child1_A.asm",
"Number": "CHILD1_A.ASM"
},
"Components": [
{
"HasChildren": false,
"CADDocumentName": "child1_A1.prt",
"CADDocumentNumber": "CHILD1_A1.PRT",
"Resolved": false,
"HasUnresolvedObjectsByAccessRights": null,
"CADDocument": null,
"Components": []
}
]
}
]
},
{
"HasChildren": false,
"CADDocumentName": "child2.asm",
"CADDocumentNumber": "CHILD2.ASM",
"Resolved": true,
"HasUnresolvedObjectsByAccessRights": null,
"CADDocument": {
"@odata.id": "http://<host>:<port>/Windchill/servlet/odata/v2/CADDocumentMgmt/CADDocuments('OR:wt.epm.EPMDocument:195955')",
"ID": "OR:wt.epm.EPMDocument:195955",
"Name": "child2.asm",
"Number": "CHILD2.ASM"
},
"Components": []
}
]
}
Example: Retrieving the CAD Document Structure Using Navigation Criteria
This example shows you how to retrieve a CAD Document structure using navigation criteria by specifying the navigation criteria ID in the request body. In this example, the CAD document specified in the request URI has child components. The value of HasUnresolvedObjectsByAccessRights is false for the TOP_CADDOC CAD document specified in the request URI.
Consider that the CHILD1_A component has a child component CHILD1_A1 under it. According to the navigation criteria applied, the CHILD1_A1 component is unresolved, so the value of Resolved is false for the component. The value of HasChildren is true for all the components except for CHILD1_A1 as it is unresolved.
The value of HasChildrenfor CHILD2 structure is false as it does not have child components under it.
Use the following POST request with expand.
URI
POST /Windchill/servlet/odata/CADDocumentMgmt/CADDocuments('OR:wt.epm.EPMDocument:196704')/PTC.CADDocumentMgmt.GetStructure?$expand=Components($levels=max)
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"NavigationCriteria": {
"ApplicableType": "PTC.CADDocumentMgmt.CADDocument",
"ApplyToTopLevelObject": false,
"Centricity": false,
"ConfigSpecs": [
{
"@odata.type": "#PTC.NavCriteria.EPMDocStandardConfigSpec",
"WorkingIncluded": false,
"LifeCycleState": {
"Value": "INWORK",
"Display": "In Work"
}
}
],
"Filters": [],
"HideUnresolvedDependents": false,
"ID": "OR:wt.filter.NavigationCriteria:215079",
"UseDefaultForUnresolved": false
}
}
Response
{
"@odata.context": "$metadata#CADStructures",
"CADDocumentID": "OR:wt.epm.EPMDocument:196704",
"HasChildren": true,
"CADDocumentUseID": null,
"CADDocumentName": "top_caddoc.asm",
"CADDocumentNumber": "TOP_CADDOC.ASM",
"CADDocumentFileName": "top_caddoc.asm",
"Resolved": true,
"HasUnresolvedObjectsByAccessRights": false,
"PVTreeId": "/",
"PVParentTreeId": null,
"@PTC.AppliedContainerContext.LocalTimeZone": "Asia/Kolkata",
"Components": [
{
"HasChildren": true,
"CADDocumentName": "child1.asm",
"CADDocumentNumber": "CHILD1.ASM",
"Resolved": true,
"HasUnresolvedObjectsByAccessRights": null,
"CADDocument": {
"@odata.id": "http://<host>:<port>/Windchill/servlet/odata/v2/CADDocumentMgmt/CADDocuments('OR:wt.epm.EPMDocument:195957')",
"ID": "OR:wt.epm.EPMDocument:195957",
"Name": "child1.asm",
"Number": "CHILD1.ASM"
},
"Components": [
{
"HasChildren": true,
"CADDocumentName": "child1_A.asm",
"CADDocumentNumber": "CHILD1_A.ASM",
"Resolved": true,
"HasUnresolvedObjectsByAccessRights": null,
"CADDocument": {
"@odata.id": "http://<host>:<port>/Windchill/servlet/odata/v2/CADDocumentMgmt/CADDocuments('OR:wt.epm.EPMDocument:196723')",
"ID": "OR:wt.epm.EPMDocument:196723",
"Name": "child1_A.asm",
"Number": "CHILD1_A.ASM"
},
"Components": [
{
"HasChildren": false,
"CADDocumentName": "child1_A1.prt",
"CADDocumentNumber": "child1_A1.PRT",
"Resolved": false,
"HasUnresolvedObjectsByAccessRights": null,
"CADDocument": null,
"Components": []
}
]
}
]
},
{
"HasChildren": false,
"CADDocumentName": "child2.asm",
"CADDocumentNumber": "CHILD2.ASM",
"Resolved": true,
"HasUnresolvedObjectsByAccessRights": null,
"CADDocument": {
"@odata.id": "http://<host>:<port>/Windchill/servlet/odata/v2/CADDocumentMgmt/CADDocuments('OR:wt.epm.EPMDocument:195955')",
"ID": "OR:wt.epm.EPMDocument:195955",
"Name": "child2.asm",
"Number": "CHILD2.ASM"
},
"Components": []
}
]
}
Additionally, you can use the following expansions:
URI with Expand
POST /Windchill/servlet/odata/CADDocumentMgmt/CADDocuments('OR:wt.epm.EPMDocument:196704')/PTC.CADDocumentMgmt.GetStructure?$expand=Components($expand=CADDocument($select=Identity;$expand=Representations($select=AdditionalFiles),Attachments);$levels=max)
URI with Expand
POST /Windchill/servlet/odata/CADDocumentMgmt/CADDocuments('OR:wt.epm.EPMDocument:196704')/PTC.CADDocumentMgmt.GetStructure?$expand=Components($select=CADDocumentFileName,HasChildren,HasUnresolvedObjectsByAccessRights;$levels=max)