5 Replies Latest reply on Oct 2, 2018 2:55 AM by Jerome De San Nicolás

    Query to check if a variable is mapped (material) ?

    Jerome De San Nicolás

      Hello,

       

      I have an issue with some of my parts :

      we had some parts that don't have the material property link to the SolidWorks material, this property is mapped to our datacard in PDM.

      It work well with our new model, but with old part, OR if the user FORCE by and the value of the property, we loose the link with the SolidWorks material.

       

      This is good :

      If I change the material in my part in SolidWorks, the "Matériau" ('Material' for who don't speak baguette) property will update.

       

      This is not :

      If I change the material in my part in SolidWorks, the property don't update... and I can order the wrong material.

       

       

      Is there a way (via query on the report generator) to see if a variable is linked to the SolidWork material ?

      I was hopping to check the ValueText and the ValueCache fields of the variablevalue table, but the fields are the same, linked or not.

      Any idea?

        • Re: Query to check if a variable is mapped (material) ?
          Sam Sam

          Hi,

           

          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

             from variable

             where Variablename like 'Materiau') And

                Vv.ValueCache !: '$PRP SW-Material'                          ****

          order by Vv.ValueCache ASC

           

           

          Note:

          ****  ...... or   /  Vv.ValueCache !: '$PRP SW-Material'   ;     .......... / or   Vv.ValueCache like 'IRON'   ......... ; ......

          • Re: Query to check if a variable is mapped (material) ?
            Jerome De San Nicolás

            Hi Sam,

             

            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...

            • Re: Query to check if a variable is mapped (material) ?
              Sam Sam

              Meanwhile I found only a few examples of installation of values of the user variables by means of Dispatch (can be useful).

               

              For Parths:

              .....

              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"

              ......

              For Assemblies:

              .....

              For Drawings:

              ......