export
Export a cached SOLIDWORKS file from the vault. Select one source with -filePath, -id, or -search, and specify the output formats with -extensions.
Syntax
export (-filePath <path> | -id <id> | -search <query>) -extensions <formats> [options]
Parameters
| Parameter | Description |
|---|---|
-filePath |
Source file path, absolute or relative to the current vault folder. |
-id |
Source PDM file ID. For a shared file with multiple locations, use its exact path. |
-search |
Export files matching a vault search. Add -recursive to include subfolders. |
-extensions, -ext |
Required. One or more formats separated by commas, such as pdf,step. |
-directory, -dir |
Output folder. Defaults to the current vault folder. A PDM destination folder must already exist. |
-name |
Output base name. Defaults to the source filename without its extension. Supports expressions. Drawing flat-pattern exports use the referenced model's basename instead. |
-overwrite |
Replace existing exports. The default is to skip them. |
-flatPattern |
Export sheet-metal flat patterns to DXF or DWG. Enable the checkbox in the visual editor, or use this flag in a script. Explicit true and false values are also accepted. |
-bendLines |
With -flatPattern, use false for geometry only. Defaults to true. |
-map |
Copy data-card values to a PDM destination using Source=Destination pairs separated by semicolons. |
-sourceConfig, -targetConfig |
Configurations for reading and writing mapped card values. Both default to @. |
-outputVariable |
Store the successfully exported filenames, one per line. For example, -outputVariable Files sets ${global.Files}. |
-csv |
With -search, write a results report. |
-version |
SOLIDWORKS year to use, such as 2025. Defaults to the latest installed version. |
-timeout |
Seconds to wait for SOLIDWORKS to start. |
Export a drawing PDF and its referenced model as STEP
export -filePath "$localPath" -directory "$folderPath" -name "$fileNameWithoutExtension Rev $revision" -extensions "pdf,step"
PDF uses the drawing. STEP uses the locally cached part or assembly in the configuration shown in the drawing. Repeated views of the same model and configuration produce one STEP. If the drawing shows several models or configurations, export the intended model directly.
Export sheet-metal flat patterns
export -filePath "C:\Vault\Drawings\Bracket.slddrw" -directory "C:\Exports" -ext dxf -flatPattern
A part uses its active configuration. A drawing uses directly referenced parts in their view configurations and names each output after the model, for example Bracket.dxf, without configuration or body suffixes. Conflicting filenames or multiple bodies in a drawing reference report an error; export those parts separately. Direct part exports keep separate body filenames. Ordinary parts and assembly views are skipped. Cache referenced parts before export.
Export to PDM and copy data card values
export -id 123 -directory "C:\Vault\Exports" -ext pdf -map "Description=Description;Title=Title" -overwrite
New vault exports are checked in. When replacing a file, PDMShell checks it back in if it acquired the checkout. A file you already had checked out stays checked out.