I've been playing with copy tree with my addin. I'm trying to get the source folder variables and the destination folder variables. I am then planning on replacing the project number within the parts copied to the new project number for all configurations. I don't see a way to get the source files so I can pull the required variables. I'm executing copy tree from one folder and changing the destination to another (from 101 to 789). I'm assuming dispatch scripting would be better for this?
This is the code to add all events (for those that are curious how each event gets triggered):
<p>public void GetAddInInfo(ref EdmAddInInfo poInfo, IEdmVault5 poVault, IEdmCmdMgr5 poCmdMgr)</p><p>{</p><p>//Specify information to display in the add-in's Properties dialog box</p><p>poInfo.mbsAddInName = "swEPDM_BOM";</p><p>poInfo.mbsCompany = "Dmitry Zamoshnikov";</p><p>poInfo.mbsDescription = "The most magnificent description of this wonderous addin";</p><p>poInfo.mlAddInVersion = 1;</p><p></p><p></p><p>//Specify the minimum required version of SolidWorks Enterprise PDM</p><p>poInfo.mlRequiredVersionMajor = 5;</p><p>poInfo.mlRequiredVersionMinor = 2;</p><p></p><p></p><p>// set up hooks</p><p>//poCmdMgr.AddHook(EdmCmdType.EdmCmd_CardButton);</p><p>//poCmdMgr.AddHook(EdmCmdType.EdmCmd_PostAdd);</p><p>//poCmdMgr.AddHook(EdmCmdType.EdmCmd_PostLock);</p><p>//poCmdMgr.AddHook(EdmCmdType.EdmCmd_PreAdd);</p><p>//poCmdMgr.AddHook(EdmCmdType.EdmCmd_Menu);</p><p></p><p></p><p>foreach (EdmCmdType cmd in (EdmCmdType[]) Enum.GetValues(typeof(EdmCmdType)))</p><p>{</p><p>poCmdMgr.AddHook(cmd); // add each hook</p><p>}</p><p>}</p>These are the events that are triggered (in sequential order).
Copy Events get triggered when I copy paste (regular ctrl-c, ctrl-v). Are the copy operations w/in copy-tree not triggering the epdm copy events?

Crtl-c/v are Windows commands while Copy-Tree is a completely different SWPDM function. Since PDM does not have an actual folder structure it does not have to actually copy the files in the same way that Copy/Paste would do it. Copy-Tree would do most of the work in the database and then add a copy of it in the local view and make it ready for check in.
I have not looked into Copy-Tree in the API so I don't know if you can access it, but my thought is that if you want to use it you would have to call it directly from your add-in.
I've abandoned trying to make this automated through Copy Tree and just added an extra menu command that traverses through each selected part, and through each configuration. See code below for those interested.
Thanks. I'll have to do some digging to see if I can call it directly. I find it annoying to have to manually edit the part no field in the file card for every file that I've copied over. No big deal if it's just one file (main assembly); annoying if it's most of the subassemblies and several parts.