Windchill REST Services Domain Capabilities > Examples for Basic REST Operations > Examples for the PTC CAD Document Management Domain > Retrieving the CAD Document Structure Along with Navigating to the Related Drawings
Retrieving the CAD Document Structure Along with Navigating to the Related Drawings
You can retrieve the CAD document structure along with the latest compatible drawings related to the top-level CAD document and all components in the structure.
You can also retrieve the CAD document structure along with the latest compatible drawings using navigation criteria.
 
The value of the HasChildren attribute remains unaffected when you retrieve the CAD document structure using $expand on Drawings.
The following example demonstrates how to retrieve all the components in the CAD document structure along with navigating to the drawings related to the top-level CAD document and to all the components in the structure. Use the following POST URI with the request body:
URI
POST /Windchill/servlet/odata/CADDocumentMgmt/CADDocuments('OR:wt.epm.EPMDocument:201500')/PTC.CADDocumentMgmt.GetStructure?$expand=CADDocument($select=Name,Number,FileName,Version,State;$expand=Drawings($select=Name,Number,FileName,Version,State)),Components($levels=max;$expand=CADDocument($select=Name,Number,FileName,Version,State;$expand=Drawings($select=Name,Number,FileName,Version,State)))
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{}
The request returns the CAD document structure along with its latest compatible drawings.
Example: Retrieving the CAD Document Structure Including the Related Drawings By Using an Inline Navigation Criteria with As Stored Config Spec
The following example demonstrates how to retrieve the CAD document structure using the As Stored configuration specification in the inline navigation criteria specified in the request body. Use the following POST URI with the request body:
URI
POST /Windchill/servlet/odata/CADDocumentMgmt/CADDocuments('OR:wt.epm.EPMDocument:202744')/PTC.CADDocumentMgmt.GetStructure?$expand=CADDocument($select=Name,Number,FileName,Version,State;$expand=Drawings($select=Name,Number,FileName,Version,State)),Components($levels=max;$expand=CADDocument($select=Name,Number,FileName,Version,State;$expand=Drawings($select=Name,Number,FileName,Version,State)))
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.EPMDocAsStoredConfigSpec",
}
],
"Filters": [],
"HideUnresolvedDependents": false,
"Name": "As_Stored_CAD",
"SharedToAll": false,
"UseDefaultForUnresolved": false
}
}
The request returns the CAD document structure and the related drawings checked in at the same time as the assembly.
 
For the configuration specification specified as As Stored, the request returns only those related drawings that were checked in at the same time as the assembly.
Example: Retrieving the CAD Document Structure Including the Related Drawings and Representations for the Parent and Child Documents
The following example demonstrates how to retrieve the CAD document structure for an assembly that has two child documents. The example also shows you how to retrieve the CAD document structure along with navigating to the related drawings and representations for the top-level parent document and child documents. Use the following POST URI with the request body:
URI
POST /Windchill/servlet/odata/CADDocumentMgmt/CADDocumentMgmt/CADDocuments('OR:wt.epm.EPMDocument:191588')/PTC.CADDocumentMgmt.GetStructure?$expand=CADDocument($select=Name,Number,FileName,Version,State;$expand=Drawings($expand=Representations($select=AdditionalFiles/URL,AdditionalFiles/Format,AdditionalFiles/FileName))),Components($levels=max;$expand=CADDocument($select=Identity,Number;$expand=Drawings($select=ID,Name,Number,Revision,Version;$expand=Representations($select=AdditionalFiles/URL,AdditionalFiles/Format,AdditionalFiles/FileName))))
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{}
Example: Retrieving the CAD Document Structure Including the Related Drawings Along with Navigating to the Associations Between the Drawings and Its Related Parts
The following example demonstrates how to retrieve the CAD document structure for an assembly that has two child documents and related drawings. The example also shows you how to retrieve the CAD document structure along with navigating to the related drawings for the top-level parent document and child documents. The example also demonstrates navigating to the associations between the drawings and its related parts. Use the following POST URI with the request body:
URI
POST /Windchill/servlet/odata/CADDocumentMgmt/CADDocuments('OR:wt.epm.EPMDocument:193463')/PTC.CADDocumentMgmt.GetStructure?$expand=CADDocument($select=Name,Number,FileName,Version,State;$expand=Drawings($select=Name,Number,FileName,Version,State;$expand=PartDocAssociations($expand=RelatedPart($select=Name,Number,Version)))),Components($levels=max;$expand=CADDocument($select=Name,Number,FileName,Version,State;$expand=Drawings($select=Name,Number,FileName,Version,State;$expand=PartDocAssociations($expand=RelatedPart($select=Name,Number,Version)))))
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{}
Example: Retrieving the CAD Document Structure Including the Related Drawings by Using an Inline Navigation Criteria with Baseline Config Spec
The following example demonstrates how to retrieve the CAD document structure for an assembly using the Baseline configuration specification in the inline navigation criteria specified in the request body. Use the following POST URI with the request body:
URI
POST /Windchill/servlet/odata/CADDocumentMgmt/CADDocuments('OR:wt.epm.EPMDocument:202744')/PTC.CADDocumentMgmt.GetStructure?$select=CADDocumentFileName,HasChildren&$expand=CADDocument($select=Identity;$expand=Drawings($select=Identity)),Components($levels=max;$select=HasChildren,CADDocumentFileName;$expand=CADDocument($select=Identity;$expand=Drawings($select=Identity)))
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.EPMDocBaselineConfigSpec",
"Baseline": "wt.vc.baseline.ManagedBaseline:1312447"
}
],
"Filters": [],
"HideUnresolvedDependents": false,
"Name": "baseline001",
"SharedToAll": false,
"UseDefaultForUnresolved": false
}
}
The request returns the CAD document structure and the related drawings that exist in the same baseline.
 
For the configuration specification specified as Baseline, the request returns the related drawings that only exist in the baseline.