PDM: Check out files from csv or text file list

Programming and macros
Lars Paal
Posts: 3
Joined: Thu May 27, 2021 5:37 am
Answers: 0

PDM: Check out files from csv or text file list

Unread post 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
User avatar
AlexB
Posts: 501
Joined: Thu Mar 18, 2021 1:38 pm
Answers: 28
x 269
x 445

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

Unread post 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.
Lars Paal
Posts: 3
Joined: Thu May 27, 2021 5:37 am
Answers: 0

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

Unread post 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.
Post Reply