US$0.00
0

PowerShell PDMShell Search Command: Complete Guide for SOLIDWORKS PDM Administrators

PDMShell gives SOLIDWORKS PDM administrators the ability to run precise, scriptable, and automated operations across large sets of files, and the PowerShell PDMShell search command is at the center of that capability. One of its most powerful features is the unified search syntax unlocks a completely different level of control over your PDM vault.

PowerShell PDMShell Search Command and Screenshot showing a split view of SOLIDWORKS PDM tools in dark mode.
On the left is a PDMSHELL (PDMShell 3.0.6.0) console window with a completed search command highlighted in red:
search --search "Name=%.sldprt;Recursive=true;@Document Number=143"
The results show two files found:

membrane.sldprt
EdmObject_File

On the right is the regular SOLIDWORKS PDM Explorer window open to a “Speaker” folder. The same file “membrane.sldprt” is selected (highlighted with a red border). Its data card in the lower pane shows:

Document Number: 000143 (highlighted in red)
Description: 1” 3
Material:
Revision: A-01

The image demonstrates using PDMSHELL to quickly search the vault for all part files that have Document Number 143, instantly locating and highlighting the matching file “membrane.sldprt” in the vault.

Consider the following search command:

At first glance, it may appear complicated, but every element serves a clear purpose and is easy to understand once broken down.

Name=%.sldprt

This filter targets all part files (SLDPRT) using a wildcard pattern.
The use of % allows flexible pattern matching, returning any file that ends with .sldprt regardless of prefix or naming convention.

Recursive=true

This instructs PDMShell to search not only the current folder, but all subfolders beneath it.
This is especially important for large vaults, deep project structures, or multi-level assemblies.

@Document Number~143

This uses a variable-based search.
PDMShell looks up the PDM variable named “Document Number” and applies a contains (~) comparison against the value 143.

Variable search supports all standard comparison operators, including equals, greater than, less than, contains, and more.

What makes this system so powerful is that the same search filter can be passed into a wide range of PDMShell commands. You write the search once, and then apply it to whatever action you need to perform. Below are the PDMShell commands that fully support the -search parameter, along with direct documentation links:

Version Control

frogleap (increment, decrement, or manage versions)
https://pdmshell.com/src/FROGLEAP.html

Bulk Variable Updates

setvar (update PDM variables in bulk)
https://pdmshell.com/src/SETVAR.html

File Removal

delete (soft-delete matching files)
https://pdmshell.com/src/DELETE.html
destroy (permanently remove matching files)
https://pdmshell.com/src/DESTROY.html

Local Cache Retrieval

get (retrieve files to local cache)
https://pdmshell.com/src/GET.html

Publishing and Exporting

export (PDF, DXF, STEP, and custom publishing)
https://pdmshell.com/src/export.html

SOLIDWORKS Automation

runswmacro (open SOLIDWORKS and execute a macro on each file)
https://pdmshell.com/src/runswmacro.html

File State Management

checkout
https://pdmshell.com/src/CHECKOUT.html
checkin
https://pdmshell.com/src/CHECKIN.html

If you would like more examples, additional documentation, or help building automated workflows, reach out anytime.

Author

Amen Jlili

Amen Jlili is the founder and technical director of Blue Byte Systems Inc., a software company in Vancouver, Canada, specializing in automating SOLIDWORKS and PDM. With over a decade of experience, he has authored several courses and open-source frameworks related to the SOLIDWORKS API. His leadership ensures that Blue Byte Systems prioritizes customer satisfaction and delivers high-quality software and CAD design solutions.

Leave a Comment

0
    0
    Your Cart
    Your cart is emptyReturn to Shop
    ×