PDMWE Number Generator - Part Deaux
July 9, 2008
Over the past few months I have received numerous emails from folks using the original PDMWE Number Generator. It is such a simple little app that I was pleasantly surprised at all of the nice feedback people gave me regarding it. To show my appreciation, I have modified the Number Generator to allow it to work with multiple serial number sequences ”on the fly.”
You have always had the ability to set up muliple serial number generators in PDMWorks Enterprise but now the user can decide at File/Folder creation time which serial number to use. An anticipated use case with this improved version of the tools is for users who have multiple categories of parts with numbers being assigned by category. Note: Even though the functionality has been expanded, the tool is still very easy to install and configure.
So how does it work?
The Number Generator is a PDMWorks Enterprise add-in that runs whenever a user presses a command button (from a data card) that is configured to “call” it. The Number Generator downloads the latest copy of the ListItems.xml file from your vault’s Options folder and checks it for List Items. Each <ListItem> element in the XML file has a <Name> element and corresponding <Value> element. The <Name> elements represent what the users sees in the Number Generator’s drop-down list and the <Value> elements represent the Serial Number sequence that is “called” whenever a user selects that item from the drop-down list. There is no reasonable limit to the number of serial number sequences that can be supported by the Number Generator. Just add a new <ListItem> node to the ListItems.xml file, being careful to type the exact name of the Serial Number sequence in the <Value> node.
Don’t be afraid of the xml. It is really simple. Here is the xml file that was used to develop and test the Number Generator. Notice that the text contained in the <Value> nodes of the ListItems are an exact match for the names of the Serial Number sequences in the vault.
Alright… Ready to get started? Good. Here are the high-level installation and configuration steps:
- Download and unzip the file containing the tool.
- Create any desired serial number sequences using the PDMWorks Enterprise Administration Tool.
- Add the included add-in to the PDMWorks Enterprise Add-ins using the PDMWorks Enterprise Administration Tool.
- Using Notepad or (better) an XML editor such as XML Notepad, edit the ListItems.xml file that is included in the Options folder to include your desired serial number sequences.
- Copy the included Options folder to the root of your PDMWorks Enterprise vault.
- Checkin the ListItems.xml file, if not done automatically.
- Give all users Read Only permissions to the Options folder.
- Add a command button to any data card you wish to run the Number Generator from and configure the command button to “call” the Number Generator.
- Test it out and if it works well for you, then add some nice feedback to this post. Otherwise, curse me under your breath and keep it to yourself.
Here are the detailed steps:
- Download the file containing the tool from here. Unzip it once it is downloaded. It should contain two dll files (Interop.EdmLib.dll and NumberGeneratorForPDMWE2008.dll) and an Options folder which in turn contains a single xml file (ListItems.xml).

- Create any desired serial number sequences using the PDMWorks Enterprise Administration Tool. Keep track of the names of the Serial Number sequences as you will need this information for step four.

- Add the included add-in to the PDMWorks Enterprise Add-ins using the PDMWorks Enterprise Administration Tool. Use the New button to add the Add-in’s dll files to the vault. Make sure you select BOTH dll files to add. Don’t worry about the warning message that PDMWorks Enterprise gives you after you add the dlls. The warning message is just letting you know that you have to reboot when updating the same Add-in to a later version. I changed the name of this add-in from the previous version so that won’t be an issue here.




- Using Notepad or (better) an XML editor such as XML Notepad, edit the ListItems.xml file that is included in the Options folder to include your desired serial number sequences. Notepad can be used but I am partial to XML Notepad as seen below. XML Notepad is a totally free utility from Microsoft and can be downloaded from here. If using Notepad, be very careful to preserve the format of the XML file. Each <ListItem> element tag must be closed by a corresponding </ListItem> element tag. The same goes true for the <Name> and <Value> element tags.

- Copy the included Options folder to the root of your PDMWorks Enterprise vault. I want to emphasize the “to the ROOT of your vault” part of that. If your vault’s local view is found at “C:\PDMWE\MyVault” then your Options folder should be found at “C:\PDMWE\MyVault\Options.”
- Checkin the ListItems.xml file, if not done automatically.
- Give all users Read Only permissions to the Options folder.
- Add a command button to any data card you wish to run the Number Generator from and configure the command button to “call” the Number Generator.

- Test it out and if it works well for you, then add some nice feedback to this post. Otherwise, curse me under your breath and keep it to yourself.


You can hit the “Copy” button to copy the auto-generated number to the clipboard. You can then paste it anywhere you want (e.g. filename, data card variable, etc…).

If you or someone you know use(s) this thing and find it helpful, then give us a holler in the comments section below. Thanks.
If you enjoyed this post, make sure you subscribe to my RSS feed!
Comments
2 Responses to “PDMWE Number Generator - Part Deaux”
Got something to say?




Works great when used inside the PDMWE File explorer. Works like a champ, easy to install and setup etc. Can you check on why it does not work from within the SW interface? So when I do an initial save on a SW file and put it into the vault, it does not work. I click the Add In Button on the data card and nothing seems to happen.
Other than that, AWESOME!
Daniel,
Thanks for letting me know. I will check it out. My guess is that SolidWorks somehow suppresses the callback since it happens in the midst of a SolidWorks command. I’ll debug it and let you know though.
Jeff