whereusedtree
Use
-parentScopeand-parentFilterto control the parent tree. The CSV includes anIsTopLevelcolumn.
Builds a recursive where-used tree for one file or each file found by a search. It uses the same traversal, parent filtering, and CSV output as whereused, but defaults to all parent levels rather than direct parents.
Console folder paths are vault-relative, with subdued paths and distinct file-ID colors in the desktop console. CSV folder paths remain absolute.
Syntax
whereusedtree (-filePath <path> | -search <query>) [-parentScope direct|all|top] [-parentFilter <query>] [-depth <number>] [-csv <path.csv>]
Use -id as an alternative to -filePath for the same operand. A required target still needs one selector, even though each alternative is optional individually. See File IDs and paths for selection rules and command-specific exceptions.
Parameters
| Parameter | Alias | Required | Description |
|---|---|---|---|
-filePath |
-f |
No | Starting file; absolute or relative to the current vault folder. Mutually exclusive with -search. |
-search |
-s |
No | Finds starting files in the current folder. Add Recursive=true for subfolders. |
-parentScope |
No | all (default), direct, or top. |
|
-parentFilter |
No | Standard search query filtering returned parents, not starting files. Searches the whole vault recursively by default. | |
-depth |
No | Positive maximum number of parent levels; default 10. Direct scope returns only level 1. |
|
-csv |
No | Optional CSV output path. Relative paths resolve in the current vault folder. | |
-id |
No | Positive PDM file ID instead of -filePath, identifying the same file that -filePath describes (including a macro, input CSV or existing output file). Requires a connected vault. Shared files with multiple locations require an exact -filePath. Resolving the ID itself does not download, check out or check in the file; the requested command still performs its normal operation. |
Examples
Trace parents and ancestors of one file:
whereusedtree -filePath "C:\Vault\Parts\Bracket.SLDPRT"
Find starting parts below the current folder and return only released assembly parents, while still traversing through excluded ancestors:
whereusedtree -search "Name=%.SLDPRT;Recursive=true" -parentFilter "Name=%.SLDASM;StateName=Released" -depth 20 -csv "C:\Reports\released-parents.csv"
Export unique, confirmed top-level assembly parents:
whereusedtree -filePath "Bracket.SLDPRT" -parentScope top -parentFilter "Name=%.SLDASM" -depth 30 -csv "C:\Reports\top-parents.csv"
Use the same command for direct parents only:
whereusedtree -filePath "Bracket.SLDPRT" -parentScope direct
Top-level and filtering behavior
top means the ancestor has no file parents reported by PDM for the logged-in user. It is not simply the highest assembly or the highest matching ancestor. An assembly referenced by a drawing is not top-level, even when the filter excludes drawings. References to older child versions are included.
Parent filtering affects returned rows, not traversal. Explicit FolderID and Recursive tokens override parent-filter defaults. Both selectors support shared search syntax, including CSV-query input. Edit is not allowed. An incomplete parent-filter search aborts export.
Top parents are deduplicated per starting file/folder and parent file ID, keeping the first encountered chain. all retains different ancestor paths. A parentless starting file is not its own result.
CSV output
RootFileID,RootFileName,RootFolderPath,ChildFileID,ChildFileName,ParentFileID,ParentFileName,ParentFolderPath,Level,Chain,Circular,IsTopLevel
The existing 11-column order is unchanged; IsTopLevel is appended. Its value is True, False, or blank when parent status could not be verified. ChildFileID/ChildFileName identify the immediate child of the returned parent, while RootFileID identifies the starting file. Chain includes filtered-out intermediate names.
See the shared CSV structure and output-file rules for field definitions and an example. New reports inside the vault are added to PDM; existing ones must be checked out by you on this computer. Reports outside the vault are local files.
Limits and failures
Cycles are marked and not followed indefinitely. A depth boundary, inaccessible parent, or reference error is never treated as a top-level parent. Cycles, unresolved references, depth truncation, and root-search limits mark the command incomplete; other branches and search roots continue. A requested CSV can therefore contain partial results—review the command result/log before relying on it as complete. Error details are not per-row CSV columns.
Cancellation does not export CSV. Native PDM calls may take time to return before cancellation can be observed.