PASTEASSHARED Command
Description
Shares one SOLIDWORKS PDM file, or files found by search, into another vault folder.
The pasteasshared command uses filePath or search to select the source file or files. The directory parameter is the destination vault folder where the shared file entries are created.
This command uses the SOLIDWORKS PDM shared-file behavior. It does not create a copy of the file; it shares the same PDM file into another folder.
Syntax
pasteasshared (-filePath file_path | -search search_query) -directory target_vault_folder [-recursive]
Parameters
filePathOptional. Single source file to share. Use eitherfilePathorsearch.searchOptional. Search query used to find files to share. Use eitherfilePathorsearch.directoryRequired. Destination vault folder where the shared file entries are created.recursiveOptional. When used withsearch, includes matching files in subfolders.
Validation
directoryis required.- Specify either
filePathorsearch, but not both. recursiveapplies only when usingsearch.
Behavior
- Shares each selected source file into the destination folder.
- Keeps the same PDM file ID because this is a shared file, not a copied file.
- Reports files that cannot be shared, for example when a file with the same name already exists in the destination folder or the user does not have permission.
- Skips duplicate search results before attempting to share.
Examples
# Share one part into another vault folder
pasteasshared -filePath "Part.sldprt" -directory "Shared Parts"
# Share all matching parts from the current folder into another vault folder
pasteasshared -search "Name=%.sldprt" -directory "Shared Parts"
# Share all matching parts from the current folder and subfolders
pasteasshared -search "Name=%.sldprt" -directory "Shared Parts" -recursive
Remarks
- The destination
directorymust be a vault folder. - If a file with the same name already exists in the destination folder, SOLIDWORKS PDM refuses the share.
- The user must have permission to share the selected files into the destination folder.
Availability
Available since PDMShell 4.0.9.