Setting or clearing custom property when adding files to vault

Discuss SolidWorks PDM
starshiphalo2333
Posts: 9
Joined: Fri Sep 30, 2022 11:49 am
Answers: 0
x 1

Setting or clearing custom property when adding files to vault

Unread post by starshiphalo2333 »

I have the Copy Tree tool setup to clear and set certain variables (custom properties) when a user copies a design. If a user does a standard 'Save As' in SOLIDWORKS, the new file(s) will get a new filename (based on Serial# counter) but custom properties carry over from the original file. There are certain custom properties that I would like to reset or clear, such as the 'Date' and 'Designer'. What would be the best way to handle this in PDM?
User avatar
AlexB
Posts: 493
Joined: Thu Mar 18, 2021 1:38 pm
Answers: 27
x 265
x 440

Re: Setting or clearing custom property when adding files to vault

Unread post by AlexB »

The way I've managed this in the past is to have an initial state that the workflow starts in where I don't care what properties are on that file. There is an automatic transition from that initial state to the "Editable" state that wipes/sets the custom properties as needed and the "Overwrite Version" option is checked on that transition.

This way, the initial state with bad custom properties essentially never existed.
starshiphalo2333
Posts: 9
Joined: Fri Sep 30, 2022 11:49 am
Answers: 0
x 1

Re: Setting or clearing custom property when adding files to vault

Unread post by starshiphalo2333 »

AlexB wrote: Tue Nov 14, 2023 2:23 pm The way I've managed this in the past is to have an initial state that the workflow starts in where I don't care what properties are on that file. There is an automatic transition from that initial state to the "Editable" state that wipes/sets the custom properties as needed and the "Overwrite Version" option is checked on that transition.

This way, the initial state with bad custom properties essentially never existed.
We actually have an automatic transition like you mentioned but that doesn't trigger until the user checks in the file. After a Save As, the data card is displayed. If the user sets variables, then checks in, the variables would then get cleared - losing what they have entered. Many times, the user doesn't edit the variables that I want to clear (like Date and Designer), so I would like to do this automatically. But if they happen to enter correct data after Save As, I do not want the variables to get cleared. Do you trigger than automatic transition before the user even sees the data card?
User avatar
AlexB
Posts: 493
Joined: Thu Mar 18, 2021 1:38 pm
Answers: 27
x 265
x 440

Re: Setting or clearing custom property when adding files to vault

Unread post by AlexB »

starshiphalo2333 wrote: Tue Nov 14, 2023 3:09 pm Do you trigger than automatic transition before the user even sees the data card?
It's essentially triggered when the user first checks the file in. Due to the limitations you mentioned, our process dictates that adding a file to PDM requires it to be checked in at least one time before working on it due to this automatic transition.
ReeceB
Posts: 6
Joined: Mon Nov 13, 2023 7:01 pm
Answers: 0
x 10

Re: Setting or clearing custom property when adding files to vault

Unread post by ReeceB »

The automatic transition at the start does work well from my experience but as mentioned requires users to first check files in, then out again before they can be worked on however I have found discipline in this regard to be poor.

I set the "Default Value" category in the data card editor to "special value -> clear existing value" a lot for clearing unwanted fields. I find that this allows users to work without first checking the file in then deals with those variables when they get around to the initial check in.

This doesn't work for dates however I prefer to set date drawn after the initial editing transition instead of when the files are created but that's personal preference.
User avatar
mp3-250
Posts: 630
Joined: Tue Sep 28, 2021 4:09 am
Answers: 20
Location: Japan
x 695
x 346

Re: Setting or clearing custom property when adding files to vault

Unread post by mp3-250 »

in tree copy you could set up the automatic check in from the registry. then automatic first transition to clean all your variables. minimal effort from user pov
starshiphalo2333
Posts: 9
Joined: Fri Sep 30, 2022 11:49 am
Answers: 0
x 1

Re: Setting or clearing custom property when adding files to vault

Unread post by starshiphalo2333 »

mp3-250 wrote: Tue Nov 14, 2023 4:24 pm in tree copy you could set up the automatic check in from the registry. then automatic first transition to clean all your variables. minimal effort from user pov
Copy Tree is setup to clear and set these variables based on the user performing the Copy Tree and the date the file was copied. I am looking for ways to clear/set these variables if a user manually does a Save As in SOLIDWORKS.

I am curious though, what do you mean by "automatic check in from registry" ? Part of the Copy Tree process is for the user to check the box 'Check-in on Copy' but some users forget to check that box.
User avatar
mp3-250
Posts: 630
Joined: Tue Sep 28, 2021 4:09 am
Answers: 20
Location: Japan
x 695
x 346

Re: Setting or clearing custom property when adding files to vault

Unread post by mp3-250 »

I force that setting with the registry for every pdm installation so the user does not have to remember the checkin box
User avatar
jcapriotti
Posts: 1852
Joined: Wed Mar 10, 2021 6:39 pm
Answers: 29
Location: The south
x 1196
x 1984

Re: Setting or clearing custom property when adding files to vault

Unread post by jcapriotti »

ReeceB wrote: Tue Nov 14, 2023 4:15 pm The automatic transition at the start does work well from my experience but as mentioned requires users to first check files in, then out again before they can be worked on however I have found discipline in this regard to be poor.

I set the "Default Value" category in the data card editor to "special value -> clear existing value" a lot for clearing unwanted fields. I find that this allows users to work without first checking the file in then deals with those variables when they get around to the initial check in.
This is the way. If you don't clear those values on first add to vault, they will forever be in the history. Especially critical for some variables like "Part Number" when searching with the "All versions" checkbox.
Jason
Post Reply