I am trying to write a bit of code that will batch get library files when needed. I found and modified some code on this forum to do exactly this, but it doesn't seem to work for me. This is on EPDM 2012 SP3. Using Visual Studio 2010, C#. I am getting and invalid arguement exception on bg.AddSelection. Anyone care to take a look at it?
SolidworksSolidworks Pdm enterprise PdmEdmVault5 vault = new EdmVault5(); ;
// Change "My Vault" to your vault name
vault.LoginAuto("My Vault", 0);
// Change the number 2 in the following line to match the number of folders
EdmSelItem[] folders;
folders = new EdmSelItem[2];
// The folders array index starts with 0.
// mlDocId = 0 tells EPDM you want all the files in the folder
folders[0].mlDocID = 0;
folders[0].mlProjID = vault.GetFolderFromPath("C:\\My Vault\\Library").ID;
folders[1].mlDocID = 0;
folders[1].mlProjID = vault.GetFolderFromPath("C:\\My Vault\\Misc").ID;
IEdmBatchGet bg;
bg = vault.CreateUtility(EdmUtility.EdmUtil_BatchGet);
bg.AddSelection(vault, folders);
bg.CreateTree(0, 8);
bg.GetFiles(0, null);