Page 1 of 1

add old revision number to copy tree/branch

Posted: Wed Oct 20, 2021 2:45 pm
by berg_lauritz
Is it possible to copy over the old revision number from the old part/assembly/drawing to the new drawing?
We would like to have a 'Replaced [part #].[revision #]' automatically filled out in our drawings.

The title block would say:

Replaced 123456.07

It's easy to add the 123456 in there - but we could not find any option to copy over the revision #. Am I missing something?

Re: add old revision number to copy tree/branch

Posted: Thu Oct 21, 2021 2:09 pm
by VicFrauenfeld
Sorry I cannot answer your question. But you say that it is easy to add the part number to the copied or branched file. How did you accomplish that?

Re: add old revision number to copy tree/branch

Posted: Thu Oct 21, 2021 2:19 pm
by bnemec
There's a way to do it for any data card variable by adding extra (likely hidden) data card variables that are duplicates of the part number and revision for example. Then on CopyTree or Branch (can also be used to help make metadata correct in a Merge I think) you can set data card variables by user group settings. I had started this to have the supersedes data like you mention, but got bogged down and other squirrels ran by and I've not gotten back to it.

The trick is getting the timing right between using proper default values for the variable control on the data card (affects all new files) which IIRC over writes the existing data when copying a file. Then in our workflow all CAD files enter the workflow through an initiated state just for the sake of an automatic transition to WIP that we can set filters and actions on. So data card variables can be set here as well. Again, IIRC this is where the duplicate part number and revision variables come in because they were not changed by default values. I wish I could remember the exact process. Maybe I should just keep quiet until I find my old notes...

Re: add old revision number to copy tree/branch

Posted: Thu Oct 21, 2021 3:33 pm
by berg_lauritz
VicFrauenfeld wrote: Thu Oct 21, 2021 2:09 pm Sorry I cannot answer your question. But you say that it is easy to add the part number to the copied or branched file. How did you accomplish that?
We use PDM Professional & you can actually select the variable in the Administration of PDM & just copy it over into a custom property. You then link the custom property to a title block field i.e. & you have a replaced in there.

The variable name is:

Code: Select all

File name without extension

Re: add old revision number to copy tree/branch

Posted: Thu Oct 21, 2021 3:35 pm
by berg_lauritz
bnemec wrote: Thu Oct 21, 2021 2:19 pm There's a way to do it for any data card variable by adding extra (likely hidden) data card variables that are duplicates of the part number and revision for example. Then on CopyTree or Branch (can also be used to help make metadata correct in a Merge I think) you can set data card variables by user group settings. I had started this to have the supersedes data like you mention, but got bogged down and other squirrels ran by and I've not gotten back to it.

The trick is getting the timing right between using proper default values for the variable control on the data card (affects all new files) which IIRC over writes the existing data when copying a file. Then in our workflow all CAD files enter the workflow through an initiated state just for the sake of an automatic transition to WIP that we can set filters and actions on. So data card variables can be set here as well. Again, IIRC this is where the duplicate part number and revision variables come in because they were not changed by default values. I wish I could remember the exact process. Maybe I should just keep quiet until I find my old notes...
So you insert a state after copy tree/branch? How do you do that? Am I slow on the uptake here? :shock: :?: :?: :?

Re: add old revision number to copy tree/branch

Posted: Thu Oct 21, 2021 5:46 pm
by bnemec
berg_lauritz wrote: Thu Oct 21, 2021 3:35 pm So you insert a state after copy tree/branch? How do you do that? Am I slow on the uptake here? :shock: :?: :?: :?
Bad description on my part. That state is not specific to CopyTree or Branch; any new file that goes to that workflow when added to the vault goes to this state. CopyTree and Brach create new files in the vault just like Save from SW.
image.png
That "Initiated" state is the one in the workflow that has "Initial state" checked:
image.png
I mentioned this because I know that's not unique to our setup and which ever operation edits the data card variable last wins.

So there's the Default Value set according to the Data Card Editor.
image.png
Then any transition(s) that the new files go through when added to the vault that might have an action to set the variable.

There's also the user/group settings for Branch CopyTree where you can set variables to some values, I don't know that you can pull data card variables here though. In screen shot you can grab the source filename without extension for example. in our case that's just a serial number, not part number, so of less help. Thing is, I don't know off the top of my head when this action happens. I want to guess that it's before the file is added, so it's before the default value from data card editor but don't take my word for it. I'm just trying to explain that if a variable is being set in more than one place, the last one wins.
image.png
I hope this is helpful.

Re: add old revision number to copy tree/branch

Posted: Thu Oct 21, 2021 6:27 pm
by jcapriotti
bnemec wrote: Thu Oct 21, 2021 5:46 pm
There's also the user/group settings for Branch CopyTree where you can set variables to some values, I don't know that you can pull data card variables here though.
You can't pull and pass a variable......only the built in system variables which is really limiting.

I think it's possible to do this with Dispatch and a workflow. Dispatch can get a variable, store it, and pass it. Downside is the copy will have the old information for at least a version or two which can mess up searches depending on how you use it.

Re: add old revision number to copy tree/branch

Posted: Fri Oct 22, 2021 12:42 pm
by berg_lauritz
bnemec wrote: Thu Oct 21, 2021 5:46 pm Bad description on my part. That state is not specific to CopyTree or Branch; any new file that goes to that workflow when added to the vault goes to this state. CopyTree and Brach create new files in the vault just like Save from SW.

image.png

That "Initiated" state is the one in the workflow that has "Initial state" checked:
image.png

I mentioned this because I know that's not unique to our setup and which ever operation edits the data card variable last wins.

So there's the Default Value set according to the Data Card Editor.
image.png

Then any transition(s) that the new files go through when added to the vault that might have an action to set the variable.

There's also the user/group settings for Branch CopyTree where you can set variables to some values, I don't know that you can pull data card variables here though. In screen shot you can grab the source filename without extension for example. in our case that's just a serial number, not part number, so of less help. Thing is, I don't know off the top of my head when this action happens. I want to guess that it's before the file is added, so it's before the default value from data card editor but don't take my word for it. I'm just trying to explain that if a variable is being set in more than one place, the last one wins.
image.png

I hope this is helpful.
This is extremely helpful. We have some of those states in between already but it somehow slipped our minds to start with one. This is exactly what we will do after we test some things. Thank you @bnemec ! This forum is just awesome for those questions, I really appreciate all of the input all the time.