Since I had enought of SOLIDWORKS PDM File Version Upgrade Tool being broken, I am writing my own PDM TASK ror my purpose,
I will lauch a task that:
・open a part file (ignores SLDASM)
・cache locally the latest version
・checkout the file
・set the document properties (image quality etc)
・cycle through configurations and force rebuild them
・save
・checkin overwriting the latest version and deleting the locally cached version
I am looking for a way to backup locally (i.e. outside the vault) the file before checking it out.
The original SOLIDWORKS PDM File Version Upgrade Tool will save a .bak file into the archive server folder (0~F) with the HEX value of document ID as a filename. For the moment I do not want to write the archive server disk, but I would like to create a folder named as the PDM DocumentID on the TASK machine desktop and save the backup file inside it.
Is there a way to get the DocumentID from a VBA PDM TASK script?
VBA PDM TASK and PDM Document ID
Re: VBA PDM TASK and PDM Document ID
I find several references to DocumentID in something called the PDM Pro API Web Service. Here is one link, but there are many.
https://help.solidworks.com/2022/englis ... Ni4wLjAuMA..
https://help.solidworks.com/2022/englis ... Ni4wLjAuMA..
-
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
Re: VBA PDM TASK and PDM Document ID
The ID within the sql server is the same as the IEdmFile5.ID property. Convert this value to hex and you have your folder name.
Re: VBA PDM TASK and PDM Document ID
If the data set has any assemblies with virtual components would those sldasm files need to be opened to get the virtual part files updated?
Re: VBA PDM TASK and PDM Document ID
Thank you! IEdmFile5.ID property is what I was looking for to get the file ID.
https://help.solidworks.com/2023/englis ... mbers.html
I have already used the Document ID outside the macro world to recover some cold storage file.
After DEC ->HEX conversion the last digit of the HEX ID is the archive server folder name in which the file resides.
Now I have to figure out how to backup and rename that file outside the vault, so I could checkout and edit the one inside the vault overwriting the latest version like the FVUT. And properly log every operation. =)
I still do not understand why I have to fix by myself what it was supposed to be a working PDM tool...
Re: VBA PDM TASK and PDM Document ID
A virtual part is saved inside the SLDASM data, and it is temporary cached inside the user temp folder when opened in solidworks. To update its properties its assembly must be opened otherwise that part is not accessible.