Enterprise PDM Files and Variables
in works well. However, if you need to load another copy of the
file over the top of the existing file, use this strategy.
The first and last steps are the same. You need to check out and
check in. But instead of editing the file after checking it out, you
can use the File.Copy method from System.IO namespace. This
method lets you copy a file over the top of an existing file. As
long as you have the vaulted file checked out, you can do this.
Check the file back in to finish the procedure. There is no need to
use the AddFile method since you are working with an existing
vaulted file rather than adding a new file.
Conclusion
Now that you have the ability to read and write properties and
check files in and out of the vault you can start automating. I have
used these same methods many times to help companies load
metadata into file cards from ERP databases and other PDM
systems. And hopefully, your new familiarity with the Enterprise
PDM API basics can jumpstart your exploration of how to move
files through workflow states and createing add-ins.
379