Retrieving the CAD Document Structure Using Path Filters
You can retrieve the bill of materials for a CAD document specified in the request URI using a single or multiple path filters.
You can retrieve the bill of materials using a path filter by specifying the RootIdentifier CAD document, appropriate odata.type, InternalPath of the CAD document to which you want to apply the path filter, and other required attributes in the request body.
 
InternalPath of a CAD document indicates the path of the CAD document from its top-level CAD document in a structure.
To retrieve a CAD document structure using a path filter, the value of InternalPath of the CAD document is specified same as the value of its PVTreeId.
You can use the following API to get PVTreeId of a CAD document to which you want to apply the path filter:
POST /Windchill/servlet/odata/CADDocumentMgmt/CADDocuments('<TopLevelCADDocOID>')/PTC.CADDocumentMgmt.GetStructure?$expand=Components($expand=CADDocument($select=Identity,Name,Version);$levels=max)
If an invalid InternalPath is specified, the path filter is not applied, and the entire CAD document structure is returned.
You can also retrieve the bill of materials using a path filter along with the PathFilterWithSiblings attribute specified as true in the request body.
 
The CAD document specified as RootIdentifier must be the same as the top-level CAD document specified in the request URI.
It is not required to expand on Uses for retrieving a CAD document structure using the path filters.
When you specify multiple path filters, you must use the same type of path filters.
When you specify multiple paths, DisplayPath is a required attribute. You can specify any value, including an empty string (""), for this attribute.
Example: Retrieving the CAD Document Structure Using a Path Filter
The following example demonstrates how to retrieve the CAD document structure using a path filter. Use the following POST URI with the request body:
URI
POST /Windchill/servlet/odata/CADDocumentMgmt/CADDocuments('OR:wt.epm.EPMDocument:173487')/PTC.CADDocumentMgmt.GetStructure?$expand=Components($expand=CADDocument($select=Identity,Name,Version);$levels=max)
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"NavigationCriteria": {
"ApplicableType": "PTC.CADDocumentMgmt.CADDocument",
"Filters": [
{
"@odata.type": "#PTC.NavCriteria.UsesPathFilter",
"RootIdentifier": "wt.epm.EPMDocument:173487",
"Paths": [
{
"InternalPath": "/M|sub1.asm|40/M|p2.prt|43"
}
]
}
]
}
}
The request returns the structure for the specified CAD document path.
Example: Retrieving the CAD Document Structure by Using a Path Filter Along with "PathFilterWithSiblings" Specified as "True"
The following example demonstrates how to retrieve the CAD document structure using a path filter along with PathFilterWithSiblings specified as true in the request body. Use the following POST URI with the request body:
URI
POST /Windchill/servlet/odata/CADDocumentMgmt/CADDocuments('OR:wt.epm.EPMDocument:173487')/PTC.CADDocumentMgmt.GetStructure?$expand=Components($expand=CADDocument($select=Identity,Version;$expand=Representations($select=CreoViewURL));$levels=max)
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"NavigationCriteria": {
"ApplicableType": "PTC.CADDocumentMgmt.CADDocument",
"Filters": [
{
"@odata.type": "#PTC.NavCriteria.UsesPathFilter",
"RootIdentifier": "wt.epm.EPMDocument:173487",
"Paths": [
{
"InternalPath": "/M|sub1.asm|40/M|p2.prt|43"
}
]
}
]
},
"PathFilterWithSiblings": true
}
The request returns the structure for the specified CAD document path including the siblings of the CAD document. The request also returns the siblings of the specified CAD document’s parent. The request does not return the children of the siblings.
 
In a CAD document tree structure, siblings are the CAD documents that belong to the same parent.
Example: Retrieving the CAD Document Structure by Using a Path Filter for Multiple Uses Along with "PathFilterWithSiblings" Specified as "True"
The following example demonstrates how to retrieve the CAD document structure using a path filter for two uses along with PathFilterWithSiblings specified as true in the request body. Use the following POST URI with the request body:
URI
POST /Windchill/servlet/odata/CADDocumentMgmt/CADDocuments('OR:wt.epm.EPMDocument:173487')/PTC.CADDocumentMgmt.GetStructure?$expand=Components($expand=CADDocument($select=Identity,Version;$expand=Representations($select=CreoViewURL));$levels=max)
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"NavigationCriteria": {
"ApplicableType": "PTC.CADDocumentMgmt.CADDocument",
"Filters": [
{
"@odata.type": "#PTC.NavCriteria.UsesPathFilter",
"RootIdentifier": "wt.epm.EPMDocument:173487",
"Paths": [
{
"DisplayPath": "",
"InternalPath": "/M|sub1.asm|40/M|p2.prt|43"
},
{
"DisplayPath": "",
"InternalPath": "/M|sub2.asm|41/M|p3.prt|44"
}
]
}
]
},
"BOMMembersOnly": true,
"PathFilterWithSiblings": true
}