getvar
Description
Gets the value of a variable for a specified file or folder.
Important
For files, getvar reads the local cache.
The file must be downloaded to your local vault view before you read its variables. Use Get Latest Version in PDM or the get command first. A missing or out-of-date local copy can cause a cache/version error or return older values.
Need the value stored in the PDM database instead? Use getvarfromdb, which does not require downloading the file. This local-file requirement does not apply to folder variables.
Syntax
getvar -filePath -variableName -configNames -clear -version
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 | The file or folder to get the variable from. |
-variableName |
-var |
No | The variable name to retrieve. |
-configNames |
-configs |
No | The configuration names to retrieve the variable from, separated by commas. |
-clear |
No | Clears the variable value. | |
-version |
-ver |
No | The version of the file to retrieve the variable from. |
-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. |
More about parameters
The file or folder to get the variable from.
The variable name to retrieve.
The configuration names to retrieve the variable from, separated by commas.
Clears the variable value.
The version of the file to retrieve the variable from.
Examples
getvar -filePath "file1.sldprt" -variableName "CustomVar"
Remarks
- The configuration names should be separated by commas.
- The variable must be in the data card.