I did something similar, I apologize that there is no time now to find therefore I write on memory and in general.
If Pdm Profesional - can set variable value of Materiau through Dispatch or Workflow with a condition (if not vflue "SW-Material").
In Dispatch - try to set the user variable Materiau (it seems with value - $PRP "SW-Material")
Right there it is possible to set up the shortcut menu - "To Update Material".
Perhaps, it is also necessary to use Check In/Check Out at the same time.
It seems, still there is a variant of the task of variable values by means of the Card (I have no time to check).
If there is time and it will be still necessary - I will look later.
Whether also matters configurations are used or not and all files have property - "Materiau".
If SQL request / Report is necessary - try something like:
Select distinct Vv.ValueCache
From VariableValue Vv
Where Vv.VariableID = ( select variableid
where Variablename like 'Materiau') And
Vv.ValueCache !: '$PRP SW-Material' ****
order by Vv.ValueCache ASC
**** ...... or / Vv.ValueCache !: '$PRP SW-Material' ; .......... / or Vv.ValueCache like 'IRON' ......... ; ......
I'll try to repair that whit Dispatch, thanks.
But before I would like to have the list of the faulty parts.
For you query, that exactly what I have try before, but the "ValueCache" field always return a plain text, and not the "Value/texte Expression" from the property.
See this example :
In the part : Property mapped
But in the query : ValueText and ValueCache field from VariableValue table (on just the same file)
here I don't see the "SW-material ...." in the ValueCache
This should give me "SW-Material@@Défaut@ ...." like the first image, right ?
what is weird is that I have some part in the vault with the "SW-material ...." in the ValueCache field...
I'll try to find what's wrong there...
yes with "ValueCache" is my error - I hurried and took a request from the SQL list for Cards.
I will look a bit later.
Meanwhile I found only a few examples of installation of values of the user variables by means of Dispatch (can be useful).
IF Right(%NameOfSelectedFile%, 6)=sldprt NO_CASE THEN GOTO Parts
IF Right(%NameOfSelectedFile%, 6)!=sldprt NO_CASE THEN GOTO EndParts
Material - Static string - "SW-Material@@%CurrentConfig%@%NameOfSelectedFile%.SLDPRT";
Mass - Static string - "SW-Mass@@%CurrentConfig%@%NameOfSelectedFile%.SLDPRT";
SurfaceArea - Static string - "SW-SurfaceArea@@%CurrentConfig%@%NameOfSelectedFile%.SLDPRT"
tanks again for the reply.
I'll try to do something with Dispatch or a little vba.
Unfortunately, I have the confirmation from my VAR that the "Value / text expression" from the custom property tab in SolidWorks is not in the SQL server, so we can't get it from an SQL query.
I'll batch all my parts