Page 1 of 1

PDM: Check out files from csv or text file list

Posted: Wed Apr 27, 2022 5:49 am
by Lars Paal
Hi everybody,

I am searching for a possibilty to check out every file that is listed in a file (csv or text, line by line). Does anyone know if there is an existing solution?

Background: I updated many variable values with an SQL query in the VariableValue table and want to transfer these values to the file properties. The only way I see, is to use the "update file properties from database" function from the PDM GUI. I could export the name and path of the affected files in a csv-file, before I do the changes to the table. Then I have to check out all the files, do the file property update to all the files and check them in again. I don't want to update them one by one because they are too many.

Many thanks, Lars

Re: PDM: Check out files from csv or text file list

Posted: Thu Apr 28, 2022 8:41 am
by AlexB
The short answer is yes, it's possible. I don't have a code sample that does specifically this, however it should be relatively straight forward to parse a text file. I'm sure there are great examples on stackoverflow discussing just that.

As for the checking out of specified files... this example may help.
https://help.solidworks.com/2018/englis ... CSharp.htm

I'm not familiar enough with the "Update -> File Attributes from Database" from the API perspective so I don't know the best way to go about that.

Re: PDM: Check out files from csv or text file list

Posted: Fri Apr 29, 2022 12:55 am
by Lars Paal
Hi AlexB,
thanks for your quick reply. After checking out the files I could filter the PDM for the checked out files and do the update of the data from db to file props manually via the PDM-menu. Checking in also.