26
November

EPDM API: Rename Files Using a Serial Number

by Scoutn on 26. November 2009 17:01,
under Categories: EPDM

In our organisation, we’re going to start renaming our files to a new part number when a part no longer fits the “form, fit, or function” rule. Meaning, when a part is not interchangeable with the last revision, we don’t up-rev, we create a new part number.  Helps with costing and all that jazz.

Since we use serial numbers to generate our part numbers and we don’t allow duplicate file names, we run into a problem. We could have tried ‘save as’, generate a serial number, note the number and use that, but the returned serial number would be reused on the next save. We could also try to maintain our part numbers outside of EPDM, but we’d be missing a feature already built in and would in all likelihood run into duplicate part numbers.

So, I built an add-in to handle this for us. The add-in renames all selected files with the next serial number. The serial number generator is currently hard-coded, so you’ll want to change that if you use the code. (I can’t do everything for you!)

So, does it work? I was worried about file references so I decided to do a quick test. Here is a simple assembly before the rename:

EPDMContains1

And after:

EPDMContains2

Are the file references updated? Let’s check:

EPDMContains3

All is well.

Download here: EPDMRename.zip (148.01 kb)

Comments (0) Tags: more... Post RSS E-mail del.icio.us

Comments

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading