Variable without PDM version in script dispatch

Hello
I'm trying to retrieve via dispatch the value of a variable without a version of the map of an SLDPRT file.
I created the variable " INDEPENDENT " without a version in PDM. This variable is therefore not linked to a solidworks property, but to the file.
I create a command related to this variable " INDEPENDENT " in my data map so that I can assign a value to this variable.

I enter an X value for this variable, I archive the file.
I read the map again, the X value is saved.
I want to use the value of this variable in a YES-NO message, the system returns a null value.
Do you know of a way to retrieve the value of a variable without a version?

I wrote the previous message a little too quickly.
My final need is to secure some of the card's data during the flow.
From a specific step, I want to prohibit changing the value of certain variables. This is possible on data cards, by graying them out or hiding them, but if you change the solidworks property through the solidworks app, the card variable takes the last value entered. And I haven't found how to prohibit user access to solidworks properties...
I thought I could transfer the values to be saved in versionless variables (not present in solidworks properties), and reinject them into the map variables mapped to solidworks properties during archiving via a dispatch script. I can generate the value in the variable without a version, but I can't read it again to copy it into the mapped variable...
Any idea?

Hello

To post the versionless variable back into a mapped card variable, use the " Set Card Variables" function.
From the " Destination Card Variable" drop-down menu, select the mapped variable.
image
Then, in the " Enter a text string to use as a variable value" field, you need to use the " User-defined variables" option
image
In the interface presented, click on " Add " and then select from the " Type " drop-down menu " Value of the data card variable of the selected file(s )"
image
Then in the " Data Map Variable" drop-down menu, select the variable without version.
And then you use that variable in the " Enter a text string to use as a variable value" field.
The result must be of this type:
image

1 Like

Thank you Cyril.
That's exactly what I did.
However, when I run the script, it doesn't return the value of the variable without a version of the data map, it returns a null value and therefore doesn't populate the mapped variable.
Have you turned on the example you have described to me?
If so, and if it works for you, it could be that I made a mistake somewhere, or that there is a version problem.
I have the SOLIDWORKS PDM 2021 (SP 5.0).
Thank you for your feedback.

Hello

I just tested with just a message displayed to retrieve a variable without a version and the chest gives it to me well (I'm on the 2023 SP5).
From memory I had already tested on the 2019 or the 2020.

To see if it works you would have to test with this script:
image

Don't forget the " For all configurations " otherwise it returns an empty value.

Great thank you Cyril.
It's working.
It was the " for all configurations " that was missing.