AnsweredAssumed Answered

copy tree C#

Question asked by Dmitry Zamoshnikov on Apr 18, 2019
Latest reply on Jun 14, 2019 by Dmitry Zamoshnikov

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):

 

public void GetAddInInfo(ref EdmAddInInfo poInfo, IEdmVault5 poVault, IEdmCmdMgr5 poCmdMgr)
{
//Specify information to display in the add-in's Properties dialog box
poInfo.mbsAddInName = "swEPDM_BOM";
poInfo.mbsCompany = "Dmitry Zamoshnikov";
poInfo.mbsDescription = "The most magnificent description of this wonderous addin";
poInfo.mlAddInVersion = 1;


//Specify the minimum required version of SolidWorks Enterprise PDM
poInfo.mlRequiredVersionMajor = 5;
poInfo.mlRequiredVersionMinor = 2;


// set up hooks
//poCmdMgr.AddHook(EdmCmdType.EdmCmd_CardButton);
//poCmdMgr.AddHook(EdmCmdType.EdmCmd_PostAdd);
//poCmdMgr.AddHook(EdmCmdType.EdmCmd_PostLock);
//poCmdMgr.AddHook(EdmCmdType.EdmCmd_PreAdd);
//poCmdMgr.AddHook(EdmCmdType.EdmCmd_Menu);


foreach (EdmCmdType cmd in (EdmCmdType[]) Enum.GetValues(typeof(EdmCmdType)))
{
poCmdMgr.AddHook(cmd); // add each hook
}
}

 

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?

Outcomes