Ulf Stockburger

Create a PDM add-in in scripting languages

Discussion created by Ulf Stockburger on Apr 16, 2019

Hi all


I developed a PDM add-in that works as a wrapper for scripting languages. This makes it possible to implement PDM add-ins in any scripting language.


Before the script is executed, a set of default information for the executed event will be created and given to the script. Simple evaluations are possible without having access to the PDM-API. Further information can be collected via SQL and PDM-API. A prerequisite to use the PDM-API is that the chosen language supports COM.

It is important to know that for time-critical add-ins or actions that cannot be executed outside the current thread, programming in .NET or C++ cannot be avoided. Nevertheless, there are a lot of tasks that can also be implemented without .NET or C++ knowledge. And this, from my point of view, with less code in a short time. The prerequisite is that you master your chosen scripting language.


I am no longer a SolidWorks PDM administrator, so I have no use for this add-in anymore. For this reason, I decided to release it to the public on Github. Feel free to use it and fit it to your needs.


1. Added an AHK script as a workaround for the problem that in PDM only comments can be forced for all transitions. Require comment for specific transisiton : Function EdmCmd_PreState001

2. Added an AHK script as an example of how to read and compare variables and cancel a Check-In if necessary. Function EdmCmd_PreUnlock001

3. Added examples to deal with other scripting languages, e.g. VBScript and Batch. How to run scripts in AutoHotkey

4. Added an AHK script as an example of how to force the filling in of forms before a status transition. How can EPDM Prompt for ECN form During Transition? What kind of Transition action i have to create or add to fullfill the ECO requirement During transition? : Function EdmCmd_PreState002

5. Added an AHK script as an example of how to rename files in the vault according to specific needs. In this example, the new name based on the serial number of the file. Function EdmCmd_Menu003

6. Added a short description of compiling the source code in .NET 2.0 and 4.0 in Getting Started.

7. Added an AHK script as an example of how to create your own serial numbers generator. PDM - Multiple serial numbers Function EdmCmd_PostAdd001

8. Added a solution to solve problems like this: PDM API file reference : COM-Server SWPAWHelper

9. Added an example to solve problems like this: Project number generator/database : Serial Number GeneratorSWSNG 

10. Added an example of a CAD add-in that uses the serial number generator SWSNG when Save As from CAD: SWSNG

11. Added an example to solve problems like this: Can you modify info on multiple data cards at once?