AnsweredAssumed Answered

PDM via VBA - add file to vault as new version on existing file

Question asked by Karel Varel on Oct 4, 2018
Latest reply on Nov 4, 2018 by Barry Cavanaugh

Hello everyone,

I've created Solidworks macro - it's purpose is to export drawing to PDF and BOM to CSV file into PDM. I'm unsing PDM api function fileadd2 and everything works ok IF I'm creating new PDF in PDM. But when I want to create updated version of PDF and save it over checked in file, macro will hang on SaveAs3 to PDF step. When I then kill Solidworks, restart it and want to manually save drawing as PDF over that file, Solidworks keeps me telling that file is read only (but I see that it's checked in for me).

I tried to edit macro, that it creates new pdf in temp directory and then copy it to PDM via fileadd2, but I get error saying that I can't add file to PDM because file with same filename is already there. What is VBA command to update file in PDM with new version of file?

Thanks in advance.