Table of Contents

Advanced Search Overview

PDMShell advanced search extends SOLIDWORKS PDM search so the same -search query can be used by commands such as search, delete, checkout, get, setvar, and transition.

Use this page for the search mental model. Use the focused articles for details:

How Search Is Processed

PDMShell search has two stages:

  1. SOLIDWORKS PDM returns the raw matching files and folders.
  2. PDMShell optionally shapes those results by sorting, grouping, and applying a result-selection strategy.

Simple filter-only searches can be served as PDM returns results. Result-shaping searches must first collect the full matching result set.

PDM search
  -> raw matching results
  -> optional SortBy
  -> optional GroupBy or DuplicatedBy
  -> optional Strategy
  -> final results passed to the command
Important

SortBy, GroupBy, DuplicatedBy, and Strategy are result-shaping operations. PDMShell must first collect all matching PDM search results, then sort, group, and apply the strategy. Be careful using these options with broad recursive searches that may return hundreds or thousands of files. Narrow the search with Name, variables, folder scope, state, date, or other filters before applying result selection.

Simple Searches

If no operators are present, the entire input is treated as a Name filter.

pump.sldprt
assembly_1001
%.sldasm

These are equivalent to:

Name=pump.sldprt
Name=assembly_1001
Name=%.sldasm

Advanced Syntax

Multiple conditions are separated with semicolons.

Name=%Pump%;Recursive=true;VersionsBefore=20200101

Escaping rules:

\; inserts a semicolon
\= inserts an equals sign
\\ inserts a literal backslash

Example:

Name=Valve\=A;Label=Released\;Approved

Wildcards

PDMShell supports the same SQL-style wildcard patterns used by SOLIDWORKS PDM.

Wildcard Meaning Example Result
% Matches zero or more characters %.sldprt Returns all part files
_ Matches exactly one character pump_.sldprt Matches pump1.sldprt and pumpA.sldprt, but not pump10.sldprt

Common Examples

Search by name:

Name=%Valve%

Search recursively:

Name=%.pdf;Recursive=true

Combine file name, workflow state, and a PDM variable:

Name=%Pump%;StateName=Released;@Revision!=A

Sort all PDFs by file date and exclude the first sorted result:

search -search "Name=%.pdf;SortBy=FileDate;Recursive=true;Strategy=ExcludeFirst" -columns FileDate

Keep the newest PDF in each duplicate-name group:

search -search "Name=%.pdf;Recursive=true;GroupBy=Name;SortBy=FileDate;SortOrder=Desc;Strategy=KeepFirst"

Technical Support

Please reach out to us if you have a premium license or are considering getting one from our contact page on our main website.