SOLIDWORKS PDM API TIP: Stop Using File Names in PDM Automation – Here’s Why IDs Are Better

When developing automation tools or add-ins for SOLIDWORKS PDM, one of the most common mistakes I see is relying on file paths or names to identify objects.

At first glance, it seems logical—after all, files have names, right? But here’s the problem: file names and paths are fragile. Users can (and will) rename files, move folders, or reorganize entire directories. The moment that happens, your automation breaks.

Enter Immutable IDs

SOLIDWORKS PDM assigns a unique, immutable ID to every object—files, folders, data cards, you name it. These IDs never change, no matter what the user does.

By using these IDs in your scripts and add-ins:

  • You avoid errors caused by renamed or moved files.
  • Your code becomes more stable and resilient.
  • You save time troubleshooting broken automations.

Real-World Example

Let’s say your script updates a custom property on all files in a certain folder. If you use the folder path and someone moves it, your script won’t find it. If you use the folder’s ID, it works no matter where it lives.

The Takeaway

Best practice: Always use IDs to identify objects in SOLIDWORKS PDM. Paths and names are for humans. IDs are for automation.

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.