WHEREUSEDTREE Command
Description
The whereusedtree command builds a recursive where-used tree for one file or for each file found by a search in the current directory.
Use this when you need to see not only the direct parents of a file, but also the parents of those parents.
The command prints a tree in the session output and can optionally export the results to CSV.
Syntax
whereusedtree (-filePath <path> | -search <query>) [-depth <number>] [-csv <file.csv>]
Parameters
filePathFull or relative path of the file to evaluate. Use either-filePathor-search, not both.searchSearch query used to find files in the current directory. Use either-searchor-filePath, not both.depthOptional maximum number of parent levels to traverse. Defaults to10.csvOptional CSV output file. Include the.csvextension.
Examples
Example 1: Recursive Where Used For One File
whereusedtree -filePath "C:\Vault\Parts\Bracket.SLDPRT"
Example 2: Limit The Tree Depth
whereusedtree -filePath "C:\Vault\Parts\Bracket.SLDPRT" -depth 3
Example 3: Run Against Files Found In The Current Directory
whereusedtree -search "%.SLDPRT"
Example 4: Export To CSV
whereusedtree -search "%.SLDASM" -depth 5 -csv whereusedtree.csv
The CSV includes:
- RootFileID
- RootFileName
- RootFolderPath
- ChildFileID
- ChildFileName
- ParentFileID
- ParentFileName
- ParentFolderPath
- Level
- Chain
- Circular
Remarks
-filePathand-searchare mutually exclusive. You must specify exactly one.-searchis scoped to the current PDMShell directory.- Circular parent chains are detected and marked as
Circularin CSV output.
Availability
Available since PDMShell 4.0.1.