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…

Details

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);…

Details