EPDM API: Exception from HRESULT: 0x80070057

I was recently working on an app that used the SolidWorks EPDM API; specifically the app saves and restores folder permissions. While trying to set permissions, I was getting the error: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)) After trying different methods of working with the¬†EdmFolderPermission array, I noticed that I had ‘Embed…

EPDM API: PHP Example

I recently had someone ask me to provide an example using PHP with the SolidWorks EPDM API. I am posting the example I provided in hopes it may help someone else down the road. Note the module name in the ‘new COM’ line. <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> <html xmlns=”http://www.w3.org/1999/xhtml”> <head> <style…

EPDM: API Data Helper Class

Since I have trouble remembering what the members are of the EdmCmdData structs I wrote a helper class. Instead of mlObjectID1, mlObjectID2, etc, I am presented with the corresponding data for the struct. So instead of: foreach (EdmCmdData cmdData in data) { int fileId = cmdData.mlObjectID1; int parentFolderId = cmdData.mlObjectID3; IEdmFile5 file = (IEdmFile5)vault.GetObject(EdmObjectType.EdmObject_File, fileId);…