₩0
0

How to Preview SOLIDWORKS PDM Files in 3D and Export Thumbnails With PDMShell

Preview SOLIDWORKS PDM files from the PDMShell console: view vault thumbnails, open cached models in an embedded eDrawings 3D viewer, and export thumbnails for a whole search to PNG or JPG.
PDMShell preview command: view SOLIDWORKS PDM files in 3D
Picture of Amen Jlili

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.

To preview a SOLIDWORKS PDM file without opening SOLIDWORKS, run PDMShell’s preview command. preview -filePath "My Part.sldprt" shows the vault thumbnail right in the console, -mode 3d opens the locally cached model in an embedded eDrawings viewer, and -search with -directory exports thumbnails for a whole search to PNG, JPG or BMP files.

The preview command is new in PDMShell 4.1.2 and is part of the free tier. It belongs to our SOLIDWORKS PDM automation series.

PDMShell preview command showing a SOLIDWORKS assembly in an embedded 3D eDrawings viewer
preview -filePath speaker.sldasm -mode 3d opens the cached assembly in an eDrawings viewer inside the PDMShell console.

The problem: you just want to see the file

When you are working through files in a script or a search, you often need a quick look: is this the right bracket, which revision of the assembly is this, does this drawing have the new title block? In File Explorer that means clicking each file and waiting for the Preview tab. For a report or a supplier package, it means opening every model and saving a screenshot.

The manual way

  • Select each file in the vault view and wait for the Preview tab to load. If the eDrawings preview stops working, see how to reset the eDrawings datacard preview.
  • Open each model in SOLIDWORKS or eDrawings to rotate it.
  • Take screenshots one by one when you need images for a report, a quote or a catalog.

The PDMShell way: the preview command

preview (short name prvw) has two modes.

1. Bitmap: the vault thumbnail, inline

Bitmap is the default. PDMShell reads the stored thumbnail for the file’s current vault version and shows it in the console. It does not start SOLIDWORKS.

preview -filePath "My Part.sldprt"
preview -id 123

If the vault has no thumbnail for the file, PDMShell falls back to the preview stored in a file you already have in your local cache, then to the Windows thumbnail provider. The output labels this as a local cached preview, because it can be an older version or include changes that are not checked in yet.

2. 3D: an eDrawings viewer in the console

preview -filePath "My Assembly.sldasm" -mode 3d

The viewer opens right where the command ran. You can rotate, zoom and pan the model, and the header shows the file name, the cached version and the current vault revision. If your cache is older than the vault, the header also shows the latest version, so you know what you are looking at. Use Pop out to move the viewer into its own resizable window, and Dock back to return it.

3D mode opens your local cached copy. It does not check out the file, fetch missing references or save anything. Get the latest version of the model and its references first.

Export thumbnails for a whole search

Add -directory to write the thumbnails to image files. Combine it with -search to export every file a search returns. This uses the same search syntax as the PDMShell search command.

# Every part in the current folder and below, as PNG
preview -search "Name=%.sldprt;Recursive=true" -directory "C:\Exports\Part Previews"

# One file as JPG, replacing an older export
preview -id 123 -directory "C:\Exports\Previews" -format jpg -overwrite

# Export and show the images in the console as they are written
preview -id 123 -directory "C:\Exports\Previews" -show
  • Files are named FileName_FileID.png, for example My Part_123.png, so two files with the same name never overwrite each other.
  • Existing images are skipped unless you add -overwrite, so you can rerun an export and only new files are written.
  • An error on one file does not stop the rest of the search.
  • The exported images are plain files on disk. They are not added to the vault.

Because export works from the command line and the MCP server, you can schedule it. For example, refresh a folder of part images for your ERP or a parts catalog every night with Windows Task Scheduler, the same way as our weekly check-in script.

Requirements

  • PDMShell 4.1.2 or later, logged in to the vault.
  • Bitmap preview and export do not need eDrawings.
  • 3D preview needs the 64-bit eDrawings viewer installed, and runs in the standalone PDMShell app.
  • Inline images and the 3D viewer show in the standalone PDMShell app. From the CLI and the MCP server, use export with -directory.

FAQ

Does preview check out or download files?

No. It never checks out, undoes a checkout or silently downloads models. Bitmap mode reads the thumbnail PDM already stores. 3D mode opens the copy already in your local cache.

Which configuration does the thumbnail show?

The vault thumbnail is the one PDM stored at check-in. When PDMShell falls back to the preview inside a cached SOLIDWORKS file, it shows the file’s saved default preview, which may not be the configuration that was active in SOLIDWORKS.

How many previews can I keep open?

The console keeps the latest 20 thumbnails and up to three live 3D models, including popped-out ones. Older ones are released to save memory. Run cls to clear them all. For large searches, export to a folder without -show.

Can I export one thumbnail per configuration?

Not with preview. It exports one image per file, from the thumbnail PDM stores for the current version.

Try it on your own vault

Start a free 7-day trial of PDMShell, see plans and pricing, or read the preview command reference. Questions? Book a short call with our team.

Need this adapted to your workflow?

We build custom SOLIDWORKS macros, add-ins and PDM automation.

Picture of Amen Jlili

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.

Leave a Comment

0
0
Your Cart
Your cart is emptyReturn to Shop