Table of Contents

setvarsfromsource

alias setvarsourceFree

Description

Sets variables for multiple files using a CSV file as the source.

Syntax

setvarsfromsource -source -evaluatealias

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
-source Yes See parameter details below.
-evaluatealias Yes See parameter details below.
-filePath No The CSV file containing the file IDs and variable values.
-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.

CSV File Format

The CSV file should have the following format:

FileID,Variable1,Variable2,... 
XXXX,Value1,Value2,... 
XXXX,Value1,Value2,...

Examples

setvarsfromsource -source variables.csv # the source file must be exist in the current directory

Remarks

  • The CSV file should have the first column as the file ID and the subsequent columns as the variable names.
  • You need to include the extension in the filename. This file can be outside the vault.
  • The best way to generate a source CSV is to use the dir command or the search command on a folder with the -csv parameter and the columns, like:
dir -columns Description,"Part Number" -csv data.csv
search -search %.sldprt -recursive -columns Description,"Part Number" -csv data.csv #this will save all parts from all levels in the current directory with the columns Description and Part Number

Tutorial